Hostmaster-0.4-alpha7

In attempting to import an external site, I am able to successfully create the platform, and it seems to verify correctly (green check), but the log has many errors:

Task starts processing
Running: /var/aegir/drush/drush.php --root='/var/aegir/platforms/drupal-6.10' provision-verify --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Loading drushrc "/var/aegir/platforms/drupal-6.10/drushrc.php" into "drupal" scope.
Initialized Drupal 6.10 root directory at /var/aegir/platforms/drupal-6.10
Found command: provision-verify (commandfile=provision)
Initializing drush commandfile: drush_make
Initializing drush commandfile: drush_make_d_o
Initializing drush commandfile: provision
Initializing drush commandfile: provision_apache
Undefined index: base_url provision_apache.drush.inc:50
Initializing drush commandfile: provision_drupal
Initializing drush commandfile: provision_mysql
Undefined index: db_url provision_mysql.drush.inc:16
Including /var/aegir/.drush/provision/web_server/verify.provision.inc
Including /var/aegir/.drush/provision/platform/backupmigrate/verify.provision.inc
Including /var/aegir/.drush/provision/platform/verify.provision.inc
Including /var/aegir/.drush/provision/db_server/verify.provision.inc
Including /var/aegir/.drush/provision/ssl/verify.provision.inc
Virtual host configuration path exists.
Virtual host configuration ownership of path has been changed to aegir.
Virtual host configuration permissions of path have been changed to 0700.
Virtual host configuration path is writable.
Platforms configuration path exists.
Platforms configuration ownership of path has been changed to aegir.
Platforms configuration permissions of path have been changed to 0700.
Platforms configuration path is writable.
Undefined variable: file provision_apache.drush.inc:219
Generating apache server configuration file .
Apache has been restarted
Provision configuration path exists.
Provision configuration ownership of path has been changed to aegir.
Provision configuration permissions of path have been changed to 0711.
Provision configuration path is writable.
Provision PHP configuration path exists.
Provision PHP configuration ownership of path has been changed to aegir.
Provision PHP configuration permissions of path have been changed to 0711.
Provision PHP configuration path is writable.
Global configuration file exists
Backup path exists.
Backup ownership of path has been changed to aegir.
Backup permissions of path have been changed to 0700.
Backup path is writable.
Drupal sites directory is writable by the provisioning script
This platform is running drupal 6.10
Found 92 modules in base
Found 7 themes in base
Found install profile default
Changed permissions of sites/all to 0755
Changed permissions of sites/all/themes to 2775
Changed permissions of sites/all/modules to 2775
Changed permissions of sites/all/libraries to 2775
Changed permissions of sites/all/private to 0755
Changed permissions of sites/all/private/files to 2770
Changed permissions of sites/all/private/temp to 2770
Mysql can create new databases.
Found existing drushrc.php file
Changed permissions of drushrc.php to 0600
Drushrc file (/var/aegir/platforms/drupal-6.10/drushrc.php) was written successfully
Changed permissions of drushrc.php to 0400
Command dispatch complete
Peak memory usage was 8.43 MB
WD php: Invalid argument supplied for foreach() in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.module on line 310.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
WD php: array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
Invalid argument supplied for foreach() in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.module on line 310.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
array_key_exists(): The second argument should be either an array or an object in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28.
Command dispatch complete
Peak memory usage was 20.73 MB

Then, when I try to import the site, I get similar errors:

Task starts processing
Running: /var/aegir/drush/drush.php --root='/var/aegir/platforms/drupal-6.10' provision-import 'spiritofthe-children.org' --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Loading drushrc "/var/aegir/platforms/drupal-6.10/drushrc.php" into "drupal" scope.
Initialized Drupal 6.10 root directory at /var/aegir/platforms/drupal-6.10
Found command: provision-import (commandfile=provision)
Initializing drush commandfile: drush_make
Initializing drush commandfile: drush_make_d_o
Initializing drush commandfile: provision
Initializing drush commandfile: provision_apache
Undefined index: base_url provision_apache.drush.inc:50
Initializing drush commandfile: provision_drupal
Initializing drush commandfile: provision_mysql
Undefined index: db_url provision_mysql.drush.inc:16
Including /var/aegir/.drush/provision/platform/import.provision.inc
Drush bootstrap phase : _drush_bootstrap_drupal_site()
Initialized Drupal site spiritofthe-children.org at sites/spiritofthe-children.org
Drush bootstrap phase : _drush_bootstrap_drupal_configuration()
Drush bootstrap phase : _drush_bootstrap_drupal_database()
Successfully connected to the Drupal database.
Drush bootstrap phase : _drush_bootstrap_drupal_full()
WD php: fopen(sites/spiritofthe-children.org/drushrc.php): failed to open stream: Permission denied in /var/aegir/drush/includes/context.inc on line 537.
Drushrc (sites/spiritofthe-children.org/drushrc.php) could not be written
Could not change permissions of drushrc.php to 384 (chmod to 600 failed on sites/spiritofthe-children.org/drushrc.php)
fopen(sites/spiritofthe-children.org/drushrc.php): failed to open stream: Permission denied in /var/aegir/drush/includes/context.inc on line 537.
Command dispatch complete
Peak memory usage was 26.58 MB
An error occurred at function : drush_hosting_hosting_task
Changes for drush_hosting_hosting_task module have been rolled back.
Command dispatch complete
Peak memory usage was 18.85 MB

Not sure if this is a bug, but I've checked the configuration according to the guide and can see nothing wrong...

I am able to provision new sites...

Comments

Anonymous’s picture

Project: Hostmaster (Aegir) » Hosting
Component: Miscellaneous » Code
Category: support » bug

This is actually a bug. Initial verifications of platforms work fine, but subsequent Verify tasks against them throw this set of errors:

WD php: Invalid argument supplied for foreach() in                                                                                                [error]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.module on line 310. [1.58 sec, 21.7 MB]
WD php: array_key_exists(): The second argument should be either an array or an object in                                                         [error]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.6 sec, 21.73 MB]
WD php: array_key_exists(): The second argument should be either an array or an object in                                                         [error]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.69 sec, 21.74 MB]
WD php: array_key_exists(): The second argument should be either an array or an object in                                                         [error]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.7 sec, 21.74 MB]
WD php: array_key_exists(): The second argument should be either an array or an object in                                                         [error]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.72 sec, 21.74 MB]
WD php: array_key_exists(): The second argument should be either an array or an object in                                                         [error]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.72 sec, 21.74 MB]
Invalid argument supplied for foreach() in /var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.module on [warning]
line 310. [1.73 sec, 21.44 MB]
array_key_exists(): The second argument should be either an array or an object in                                                                 [warning]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.73 sec, 21.44 MB]
array_key_exists(): The second argument should be either an array or an object in                                                                 [warning]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.73 sec, 21.44 MB]
array_key_exists(): The second argument should be either an array or an object in                                                                 [warning]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.73 sec, 21.44 MB]
array_key_exists(): The second argument should be either an array or an object in                                                                 [warning]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.73 sec, 21.44 MB]
array_key_exists(): The second argument should be either an array or an object in                                                                 [warning]
/var/aegir/hostmaster-0.4-alpha7/profiles/hostmaster/modules/hosting/package/hosting_package.instance.inc on line 28. [1.73 sec, 21.44 MB]
Command dispatch complete [1.73 sec, 21.39 MB]                                                                                                       [notice]
 Timer  Cum (sec)  Count  Avg (msec) 

I have been putting backtraces all over the places and I can't see anything wrong with the foreach in hosting_packages_sync() - first I thought the $context array in the platform's post verify hookwas not returning the packages or something but it seems ok.. not sure what's going on

It doesn't appear to occur for sites on subsequent Verifications, only of platforms (difference seems to be Platform runs hosting_package_sync($packages['base']) as opposed to Site's hosting_package_sync($packages); )

j2parker’s picture

The number of errors produced is proportional to the number of sites on the platform. Six errors for each site. One for line 310 and five for line 28.

If all sites are removed from the platform the verify task errors cease.

Anonymous’s picture

Title: Imported site "verifies", but has errors... » Verifications of platforms containing sites throw package-related PHP errors
Priority: Normal » Critical

I have discovered that reverting this commit stops the error

http://git.aegirproject.org/?p=provision.git;a=commitdiff;h=9e4cedcdab43...

Problem is I don't know why yet..

Anonymous’s picture

Should note that in that commit, the only bit causing the issue is the removal of this. The other two bits can be left in just fine. Somehow removing this bit screws it up even though the hosting_packages_sync bit in the platform post verify is only meant to be syncing $packages['base']

    // Iterate through the sites, finding site specific packages
    foreach (drush_get_option('sites', array()) as $site) {
      $packages['sites'][$site] = _provision_find_packages('sites', $site);
    }
nooble’s picture

I am also having this issue with every site I have tried to import into alpha7. Is the alpha7 release just broken, or do sites import under certain conditions? Is it better to use a previous version until this issue is resolved? Has any progress been made into fixing it?

Anonymous’s picture

Status: Active » Needs review

So this is because in the platform's post verify hook we are still doing some syncing of the site packages:

See http://pastie.org/private/jrkbhycfqnyt8j50we6w

Not sure if that last removal should be hosting_package_instance_sync($site->nid, $packages['base']); , just without syncing the site-specific packages.. anarcat?

Note the regression occurred in #604800: platform comparison doesn't handle properly non-global modules but since discussion has taken place here since, I won't reopen that old issue.

butler360’s picture

I just saw the same thing doing a test upgrade to Alpha7.

So does this actually cause any problems? Should I do a real upgrade to Alpha7 or wait for Alpha8?

anarcat’s picture

mig: that patch looks good, i would commit, esp. if it fixes the issue.

lukus’s picture

Hi - I'm experiencing the same error. Is there anything I can do to fix it, or should I wait for the next release?

EDIT: I applied the patch in #6

Anonymous’s picture

Status: Needs review » Fixed
j2parker’s picture

Confirming. Patches eliminated the errors.

Status: Fixed » Closed (fixed)

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