recent head site migration completely broken:

mumia:~$ php /var/hostmaster/drush/drush.php 'provision' 'migrate' 'test.machin.com' '/var/hostmaster/drupal-6.9' --task_id='96' --db_id='2' --profile='hostmaster' --platform='6' --publish_path='/var/hostmaster/drupal-5.x' --site_id='14' --language='en' --drush_path='/var/hostmaster/drush/drush.php' --web_id='3' --web_host='localhost' --script_user='hostmaster' --root='/var/hostmaster/drupal-5.x' 
Initializing provision_drupal                                            [notice]
Generating mysql dump for test.machin.com.                               [backup]
mysqldump -u -p  > sites/test.machin.com/database.sql                    [notice]
Adding sites directory to                                                [backup]
/var/hostmaster/backups/test.machin.com-2009-03-20_6.tar
cd /var/hostmaster/drupal-5.x/sites/test.machin.com; tar -rf             [notice]
/var/hostmaster/backups/test.machin.com-2009-03-20_6.tar * 
gzip /var/hostmaster/backups/test.machin.com-2009-03-20_6.tar            [notice]
Deleted mysql dump from sites directory                                  [message]
Running: php /var/hostmaster/drush/drush.php  'provision' 'deploy'       [command]
'test.machin.com'
'/var/hostmaster/backups/test.machin.com-2009-03-20_6.tar.gz'
--root='/var/hostmaster/drupal-6.9' --backend

Warning: json_encode() expects exactly 1 parameter, 2 given in /var/hostmaster/drush/includes/backend.inc on line 170

Call Stack:
    0.0015     128608   1. {main}() /var/hostmaster/drush/drush.php:0
    0.0095     539484   2. drush_bootstrap() /var/hostmaster/drush/drush.php:23
    0.0612    2111060   3. drush_dispatch() /var/hostmaster/drush/drush.php:119
    0.0612    2111148   4. _drush_dispatch_cmd() /var/hostmaster/drush/includes/drush.inc:33
    0.0613    2111148   5. call_user_func_array() /var/hostmaster/drush/includes/drush.inc:47
    0.0613    2111204   6. provision_command() /var/hostmaster/drush/includes/drush.inc:0
    0.0791    2125188   7. provision_invoke() /var/hostmaster/.drush/provision/provision.inc:96
    0.3234    2177104   8. provision_drupal_provision_migrate() /var/hostmaster/.drush/provision/provision.inc:61
    0.3235    2177104   9. drush_backend_invoke() /var/hostmaster/.drush/provision/platform/migrate.provision.inc:49
    0.3244    2177716  10. _drush_backend_invoke() /var/hostmaster/drush/includes/backend.inc:223
    0.3244    2177716  11. _drush_proc_open() /var/hostmaster/drush/includes/backend.inc:248
    0.3706    2178776  12. json_encode() /var/hostmaster/drush/includes/backend.inc:170

Database import failed                                                   [error]
Initializing provision_drupal                                            [notice]
Deploying site from                                                      [message]
/var/hostmaster/backups/test.machin.com-2009-03-20_6.tar.gz
tar -zxf /var/hostmaster/backups/test.machin.com-2009-03-20_6.tar.gz -C  [notice]
/var/hostmaster/drupal-6.9/sites/test.machin.com
Running: tar -zxf                                                        [notice]
/var/hostmaster/backups/test.machin.com-2009-03-20_6.tar.gz -C
/var/hostmaster/drupal-6.9/sites/test.machin.com
Successfully extracted the contents of                                   [message]
/var/hostmaster/backups/test.machin.com-2009-03-20_6.tar.gz
Generate virtual host configuration file.                                [notice]
Generate settings.php file                                               [notice]
Changed permissions of settings.php to 640                               [message]
Changed permissions of settings.php to 440                               [message]
Change group ownership of settings.php to www-data                       [message]
Created testmachincom database                                           [success]
Found database dump at                                                   [message]
/var/hostmaster/drupal-6.9/sites/test.machin.com/database.sql.
Database dump at                                                         [message]
/var/hostmaster/drupal-6.9/sites/test.machin.com/database.sql is readable
Importing database using command: mysql -utestmachincom -p7ytoaHiqoX     [notice]
-hlocalhost testmachincom <
/var/hostmaster/drupal-6.9/sites/test.machin.com/database.sql
mysql -utestmachincom -p7ytoaHiqoX -hlocalhost testmachincom <           [notice]
/var/hostmaster/drupal-6.9/sites/test.machin.com/database.sql
Dropping database testmachincom                                          [notice]
Revoking privileges                                                      [notice]
Changes for provision_mysql_provision_deploy module have been rolled     [Rollback]
back.
Generate settings.php file                                               [notice]
Changed permissions of settings.php to 640                               [message]
Changed permissions of settings.php to 440                               [message]
Change group ownership of settings.php to www-data                       [message]
Changes for provision_drupal_provision_deploy module have been rolled    [Rollback]
back.
Removed apache virtual host configuration                                [message]
Changes for provision_apache_provision_pre_deploy module have been rolled[Rollback]
back.
An error occurred at function : provision_drupal_provision_migrate       [error]

Additionnally, the deployed isn't properly rollbacked (the sites/ directory still exists).

Comments

anarcat’s picture

Title: site migration fails on head (json_encode() API error) » site migration fails on head

Turns out the json API error is harmless, and I've got a patch, in #408818: API error in json_encode() call in backend.inc.

So the problem lies somewhere else.

adrian’s picture

Status: Active » Needs review

I did a fair amount of rewriting on that code, the fix is part of the bootstrap issue we were having with drush.

the patches are here : http://drupal.org/node/411822

and they rely on the drush bootstrap level patch.

anarcat’s picture

Status: Needs review » Needs work

So we're still stuck with this error messages which gets repeated for every module:

user warning: Unknown column 'info' in 'field list' query: UPDATE system SET info = 'a:10:{s:4:\"name\";s:10:\"Aggregator\";s:11:\"description\";s:57:\"Aggregates syndicated content (RSS, RDF, and Atom feeds).\";s:7:\"package\";s:15:\"Core - optional\";s:7:\"version\";s:3:\"6.9\";s:4:\"core\";s:3:\"6.x\";s:7:\"project\";s:6:\"drupal\";s:9:\"datestamp\";s:10:\"1231976413\";s:12:\"dependencies\";a:0:{}s:10:\"dependents\";a:0:{}s:3:\"php\";s:5:\"4.3.5\";}', name = 'aggregator', filename = 'modules/aggregator/aggregator.module', bootstrap = 0 WHERE filename = 'modules/aggregator/aggregator.module' in /var/hostmaster/drupal-6.9/includes/module.inc on line 141.

We found this was in the modules_rebuild_cache() function, we're digging deeper now. It looks like this function is called before the fix_requirements()...

anarcat’s picture

Assigned: Unassigned » adrian

Adrian is working on a patch for this to better handle errors in drush directly, so we'll wait. In the meantime, if you want to have upgrades working, you can use the following drush patch:

--- includes/drush.inc	24 mar 2009 14:38:25 -0400	1.16
+++ includes/drush.inc	25 mar 2009 18:28:21 -0400	
@@ -575,7 +575,7 @@
           drush_log(ereg_replace('/^warning: /', '', $error), 'warning');
         }
         elseif (preg_match('/^user warning:/', $error)) {
-          drush_set_error('DRUSH_DRUPAL_ERROR_MESSAGE', ereg_replace('/^user warning: /', '', $error));
+          drush_log(ereg_replace('/^user warning: /', '', $error), 'warning');
         }
         else {
           drush_set_error('DRUSH_DRUPAL_ERROR_MESSAGE', $error);

This is intentionnally not a real patch because it's not a (proper) fix.

adrian’s picture

Status: Needs work » Needs review

Solved this in head now.

you need head of hosting, drush and provision, and you NEED to run update.php on hosting.

anarcat’s picture

Status: Needs review » Fixed

Yay! At last!

That was a tricky one, the latest HEAD of provision, hosting *and* drush now work properly.

Status: Fixed » Closed (fixed)

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

  • Commit dca8e5c on debian, dev-dns, dev-envobject, dev-koumbit, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newhooks, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-restore, dev-services, dev-simplerinstaller, dev-site_rename, dev-ssl, dev_716166_apache_conf, dev_dns, dev_server_verify, prod-koumbit, ssl, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x authored by adrian:
    #411822 - refactor to use drush_bootstrap. This also should fix #408810...
  • Commit 339db5a on debian, dev-dns, dev-envobject, dev-koumbit, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newhooks, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-restore, dev-services, dev-simplerinstaller, dev-site_rename, dev-ssl, dev_716166_apache_conf, dev_dns, dev_server_verify, prod-koumbit, ssl, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x authored by adrian:
    #408810 - site migration fails on head. This takes into account the new...