All those already correctly imported in octopus1 instance sites (with correct profile names in settings.php and in drushrc.php) now got again "default" profile in the frontend, see: http://skitch.com/omega8cc/di96r/fullscreen

Running verify on the site didn't fix that, but the name of the profile is still correct in settings.php and in drushrc.php

Before verify: http://skitch.com/omega8cc/di99d/fullscreen

After verify: http://skitch.com/omega8cc/di99m/fullscreen

After verify in the frontend: http://skitch.com/omega8cc/di991/fullscreen

Now let's delete the platform node and try to simply import the platform again: http://skitch.com/omega8cc/di99a/fullscreen

The result this time, watch closely: http://skitch.com/omega8cc/dsyyf/fullscreen

Now almost all sites got the correct profile, while the site we verified (above) is now broken and still has incorrect, default profile, now written also in the settings.php and drushrc.php, see: http://skitch.com/omega8cc/dsyyq/fullscreen

Note: it worked the same with first import from Apache powered old Aegir install to octopus1 Nginx instance and next the same platform imported from octopus1 to octopus2 instance got default profile for every site, while both octopus1 and octopus2 are Aegir instances using latest head code from git.

The problem is, that I have seen a few times imports (or even cloning) of Open Atrium sites, resulting with all non-core modules disabled on site import due to forced by Aegir default profile. Then only manual database import/overwrite and changing the install profile nid for the site node in the Aegir database fixed this.

Right now all imports, even from previous Aegir installs are dangerous and can result with duplicated manual work, and still you have to know what and where to change to get such failed import fixed.

CommentFileSizeAuthor
#3 package.patch4.13 KBmig5
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

omega8cc’s picture

And this is the result: http://skitch.com/omega8cc/dsykk/fullscreen

Broken site, with all non-core modules and themes disabled.

Anonymous’s picture

I've just reproduced this:

Copy an atrium platform + site from one aegir system (running HEAD) to another, and on import of the site, the profile is 'default' (machine name rather than 'nice' name).

Anonymous’s picture

Priority: Major » Critical
Status: Active » Needs review
FileSize
4.13 KB

For a long time (since March '09 when the hosting_package_instance_load function's query got changed) we have been making calls to hosting_package_instance_load() but without specifying the table of the attributes (i.e asking for rid and shortname instead of i.rid and p.shortname), as originally it was just a SELECT ALL from one table with no joins (see this commit).

This affects more than just this ticket. Patch attached for myself and omega8cc to review before I commit..

Anonymous’s picture

I committed this, but omega8cc's frightened me into thinking it didn't fix the issue. :) So I won't mark this as fixed until it seems to have stopped imported sites from getting 'default' or 'Drupal' as the install profile.

mrfelton’s picture

Some time after upgrading from 0.12 to 0.13, I have hit this problem. All platforms are now showing as using the default Drupal profile. I tried with the above patch, and then re-verified these platforms, but still they show as using the default profile. Do I need to manually fix these already broken platforms somehow?

EDIT: Ignore - actually my problem is different, in that my platforms are not recognizing any of the modules that are available, other than the default core modules.

omega8cc’s picture

The only fix now is: delete the platform(s) node(s) - by going to the platform node, hit edit tab and replace node/123/edit with node/123/delete in the URL, and confirm delete. It will delete also all sites nodes and tasks related. Then import those platforms again. Now all sites should receive correct profiles. IMPORTANT: don't verify sites by using verify task or you will break them completely.

[EDIT] You can safely verify any site after you imported the platform the second time and it displays the correct profile name.

Anonymous’s picture

Status: Needs review » Needs work

Just going to chime in again and confirm that this is still a major problem and my patch hasn't seemed to have helped.

I just re-arranged my own aegir live install and imported platforms, and it screwed all my sites, setting 'default' profile everywhere, disabling modules, and in one case, even renamed the profile package with the title of another install profile (go figure).

So the whole thing is a big mess, and some things in provision/platform/deploy.provision.inc are just plain wrong, for example:


    $site_packages = drush_get_option('packages', array(), 'site');
    $profiles = array_keys($site_packages['profiles']);
    $profile = $profiles[0];

$site_packages here simply returns a null array. Something is seriously wrong with our package syncing stuff, and much of the rest of deploy that does the schema comparison stuff depends on having merged in the modules provided from profiles etc.

This is also the reason why you see 'array_keys' PHP warnings related to 'profiles' on deploy tasks (so import, migrate, restore etc).

Editing it to be this, *does* work, but I'm so confused by the packages logic that I'm not sure it's appropriate:


    $site_packages = drush_get_option('packages', array(), 'drupal');
    $profiles = array_keys($site_packages['profiles']);
    $profile = $profiles[0];

Also, why do we just take $profile[0] here? That's not necessarily the profile we have installed on the site if there are multiple profiles on the platform.

I think the reason it's null for the site context is because we do a provision_save_site_data() just prior, and thus the drushrc's rewritten and none of the profile packages (or probably *any* packages since we haven't done a sync or anything) are available.

So all the following code probably doesn't work at all:


    $merged_modules = array_merge($drupal_packages['base']['modules'], $drupal_packages['profiles'][$profile]['modules']);
    foreach ($site_packages['modules'] as $name => $module) {
....

I think this desperately needs Adrian's eyes, as the package stuff has always hurt mine..

adrian’s picture

Status: Needs work » Needs review

[master 07d8f68] This seems to resolve #907248 - aegir forces default profile.
2 files changed, 28 insertions(+), 1 deletions(-)

I think this may have fixed the bug in HEAD. please test.

adrian’s picture

I added some changes to how migrate works too , which had the same issue.

Basically the inline verify would add values to the site's drushrc.php, but they would not be loaded by the import or migrate tasks and therefor not pushed upstream to hosting.

I added a method to re-load the values associated to the site, and also added a method to stop the stale data from automatically being written to the drushrc.

cloned sites trigger an import on the new node, so fixing import would fix them too.

You should be able to fix existing sites with :


drush provision-save @site.com  --profile='custom'
drush @site.com provision-verify --debug
drush @hostmaster hosting-task @site.com import --debug

omega8cc’s picture

Status: Needs review » Fixed

Ladies and Gentlemen! It is confirmed as fixed in git HEAD now!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 98b392c on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x by mig5:
    #907248 - fix calls to hosting_package_instance_load with the proper...

  • Commit 98b392c on 6.x-2.x, 7.x-3.x, dev-ssl-ip-allocation-refactor, dev-sni, dev-helmo-3.x by mig5:
    #907248 - fix calls to hosting_package_instance_load with the proper...
dagomar’s picture

I experienced something like this and @adrian's comment really helped me to solve this issue. I had to do it slightly different because it was still being reverted to the Standard profile, but this worked for me:

(from the sites/yoursite.com)

drush provision-save @yoursite.com --profile='your_profile'
drush provision-verify @yoursite.com --debug
drush cc all
drush @hostmaster hosting-import @yoursite.com --debug
drush @hostmaster hosting-task @yoursite.com import --debug --force