We're seeing this issue where none of the "verify", "install" or similar commands run in our install of Aegir. The crontab is set to fire every minute and contains this line:

*/1 * * * * /usr/bin/php /app/aegir/drush/drush.php --php='/usr/bin/php' '@hostmaster' hosting-dispatch

Every minute, we get a mail notification stating:

The drush command '@hostmaster hosting-dispatch' could not be found.     [error]
A Drupal installation directory could not be found                       [error]

Which tells me that crontab is running fine.

Running /usr/bin/php /app/aegir/drush/drush.php --php='/usr/bin/php' '@hostmaster' hosting-dispatch --debug gives this output

Bootstrap to phase 0. [0.02 sec, 3.26 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.03 sec, 3.52 MB] [bootstrap]
Load alias @hostmaster [0.03 sec, 3.52 MB]                                                                                                    [notice]
Bootstrap to phase 5. [0.07 sec, 7.17 MB]                                                                                                  [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.07 sec, 7.17 MB]                                                                 [bootstrap]
Loading drushrc "/app/aegir/platforms/gwu-cms-1.0/drushrc.php" into "drupal" scope. [0.07 sec, 7.17 MB]                                    [bootstrap]
Initialized Drupal 7.4 root directory at /app/aegir/platforms/gwu-cms-1.0 [0.09 sec, 9.57 MB]                                                 [notice]
The drush command '@hostmaster hosting-dispatch' could not be found. [0.1 sec, 9.57 MB]                                                        [error]
Could not find a Drupal settings.php file at ./sites/default/settings.php. [0.1 sec, 9.58 MB] 

Isn't Aegir supposed to create settings.php file ... yet is says it cannot find it ... ? Any ideas?

Many thanks!

Comments

kmasood’s picture

Component: Miscellaneous » Code
kmasood’s picture

Was able to fix this by using Symlinks. It was our setup. See this thread: http://drupal.stackexchange.com/questions/8357/drush-missing-the-provisi...

Steven Jones’s picture

Status: Active » Fixed

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

kenpeter’s picture

Hi,

I have the same issue. Every minute I got a similar email from aegir saying:

The drush command 'hosting-dispatch' could not be found.  Run `drush     [error]
cache-clear drush` to clear the commandfile cache if you have
installed new extensions.
A Drupal installation directory could not be found                       [error]
Do "crontab -e" gives me
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:
/usr/local/games:/var/aegir/.drush:/usr/share/php/drush
*/1 * * * * /usr/bin/env php /usr/share/php/drush/drush.php '@hostmaster' hosting-dispatch

As you can see I added /var/aegir/.drush:/usr/share/php/drush to the end, but this doesn't work.

I discovered that "function drush_hosting_dispatch()" in "/var/aegir/hostmaster-6.x-2.0/profiles/hostmaster/modules/hosting/dispatch.hosting.inc" has the source code for hosting-dispatch

This means I need to somehow add /var/aegir/hostmaster-6.x-2.0/profiles/hostmaster/modules/hosting/dispatch.hosting.inc to the $PATH.

Could someone shine some light on me?

helmo’s picture

@kenpeter: $PATH is not needed, drush has to find it when the @hostmaster site alias is evaluated.

drush sa @hostmaster could tell you if drush looks in the right hostmaster tree.

Which drush version do you have?

kenpeter’s picture

@helmo, I am using drush 6.2 with aegir 2.0.

drush sa @hostmaster gives me:

$aliases['hostmaster'] = array (
  'context_type' => 'site',
  'platform' => '@platform_',
  'server' => '@server_master',
  'db_server' => '@server_master',
  'uri' => 'kenpeter',
  'root' => NULL,
  'site_path' => '/sites/kenpeter',
  'site_enabled' => true,
  'language' => 'en',
  'client_name' => 'admin',
  'aliases' =>
  array (
  ),
  'redirection' => false,
  'cron_key' => '',
  'profile' => 'hostmaster',
);

As you can see, it seems corrupt. After I fix it, e.g. 'root' = '/path/to/hostmaster', etc. I am able to run drush @hostmasster hosting-dispatch anywhere.

The issue is, when I restart my local machine, the $aliases['hostmaster'] will be rewritten again. Is it a way to fix it?