Seems like a drush5 oddity we missed.

aegir@marcos:~/hostmaster-HEAD/profiles/hostmaster$ drush @hostmaster hosting-tasks
aegir@marcos:~/hostmaster-HEAD/profiles/hostmaster$ Unknown options: --context_type, --platform, --server, --db_server,  [error]
--site_path, --site_enabled, --language, --client_name,
--redirection, --cron_key, --profile, --ssl_enabled.  See `drush help
hosting-task` for available options. To suppress this error, add the
option --strict=0.

aegir@marcos:~/hostmaster-HEAD/profiles/hostmaster$

Comments

anarcat’s picture

Status: Active » Needs work

Rah this one is weird. We are using the drush invoke properly, or at least the same way as elsewhere - the only difference is we fork there... Hence the following patch actually fixes the problem:

diff --git a/modules/hosting/task/hosting_task.module b/modules/hosting/task/hosting_task.module
index 3bebc6e..bd3f349 100644
--- a/modules/hosting/task/hosting_task.module
+++ b/modules/hosting/task/hosting_task.module
@@ -519,7 +519,7 @@ function hosting_tasks_queue($count = 20) {
   drush_log(dt("Running tasks queue"));
   $tasks = _hosting_get_new_tasks($count);
   foreach ($tasks as $task) {
-    drush_invoke_process('@self', "hosting-task", array($task->nid), array(), array('fork' => TRUE));
+    drush_invoke_process('@self', "hosting-task", array($task->nid), array(), array('fork' => FALSE));
   }
 }
 

... but then radically changes the behavior of that code - it doesn't fork anymore! Weird that this is related...

omega8cc’s picture

Yeah, drush wants you to purge its internal cache first. I have discovered this while trying Aegir 2.x with Drush 5.7:

The drush command 'provision-save @server_localhost' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.                                  [error]
A Drupal installation directory could not be found                                                                                                                                                            [error]
The drush command 'provision-verify' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.                                                  [error]
A Drupal installation directory could not be found                                                                                                                                                            [error]
The drush command 'provision-save @server_master' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.                                     [error]
A Drupal installation directory could not be found                                                                                                                                                            [error]
The drush command 'provision-verify' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.                                                  [error]
A Drupal installation directory could not be found                                                                                                                                                            [error]
omega8cc’s picture

So we use in BOA installer something like:

if [ "$_USE_STOCK" = "YES" ] ; then
  su -s /bin/bash - aegir -c "drush cache-clear drush >/var/aegir/install.log 2>&1"
fi

It should go after adding Provision but before running hostmaster install.

anarcat’s picture

Now that's really weird. When do you run this command? Seems to me this should be part of the debian package, at the very least...

It nevertheless doesn't fix my problem, which seems to be unrelated to that issue. I still get the error after clearing the cache.

anarcat’s picture

Status: Needs work » Fixed

I have fixed this in 26dfbd2, but I'd be very curious to hear more about that cache clear and if it is really necessary - in which case we should probably add it at the end of the provision postinst script in the Debian package and the manual install inscructions!

omega8cc’s picture

Yes, it should be a part of the install - or we should add that --strict=0 option, probably.

We use this in our custom install script which is basically a fork of previous manual install script in Aegir, so it allows us to add/test things like that.

Note that we have tried this with Aegir 2.x head and Drush 5.7

anarcat’s picture

It would be nice if such improvements are contributed back to the main project in the future. At least filing a bug would have helped pinpoint such a problem...

anarcat’s picture

Let's move the discussions about the cache-clear into #1843044: install may fail without a cache-clear drush?.

Status: Fixed » Closed (fixed)

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

  • Commit 26dfbd2 on 6.x-2.x, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x by anarcat:
    #1829430 fix hosting-tasks by passing invoke = TRUE to drush 5 (?)
    

  • Commit 26dfbd2 on 6.x-2.x, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x by anarcat:
    #1829430 fix hosting-tasks by passing invoke = TRUE to drush 5 (?)