Checklist:
* make sure you have a aegir user and that it is the same configured in your webserver node
done

* make sure drush is installed properly and is the same path in the webserver node
done

* make sure provision is in ~aegir/.drush
done

* and that both hosting and provisiona appear in the drush help
FAIL

Info
* the full task log of the failed task (if relevant) otherwise the detailed error message
* the complete versions of Drupal core, provision, hosting, drush and the hostmaster install profile you are running

Core: 5.16
Provision: 5.x-0.2-alpha1
Drush: HEAD-all-versions (5-May-2009)
hostmaster install profile: 5.x-0.2-alpha1

* the output of drush.php help (if you have a "command not found")

$ drush
Execute a drush command. Run `drush help [command]` to view command-specific
help.

Examples:
  drush dl cck zen                     	Download CCK module and Zen theme.                 
  drush --uri=http://example.com status	Show status command for the example.com multi-site.

Options:
  -r <path>, --root=<path>	Drupal root directory to use (default: current directory)            
  -l <uri> , --uri=<uri>  	URI of the drupal site to use (only needed in multisite environments)
  -v, --verbose           	Display all available output                                         
  -q, --quiet             	Hide all output                                                      
  -y, --yes               	Assume 'yes' as answer to all prompts                                
  -s, --simulate          	Simulate all relevant actions (don't actually change the system)     
  -i, --include           	A list of paths to search for drush commands                         
  -c, --config            	Specify a config file to use. See example.drushrc.php                
  -u, --user              	Specify a user to login with. May be a name or a number.             
  -b, --backend           	Hide all output and return structured data (internal use only).      

Commands: 
  help                	Print this help message. Use --filter to limit command list to one command file (e.g. --filter=pm)
  status              	Provides a birds-eye view of the current Drupal installation, if any.                             
  dl                  	Download core Drupal and projects like CCK, Zen, etc. 

drush command output:

$ /usr/bin/drush --root='/srv/www/vhosts/PATH' 'provision' 'verify' --verbose=2
Drush bootstrap phase : _drush_bootstrap_drupal_root()                                                                          [bootstrap]
Initialized Drupal 6.11 root directory at /srv/www/vhosts/PATH                                                    [notice]
Found command: provision verify                                                                                                 [bootstrap]
Initializing drush commandfile: provision_drupal                                                                                [bootstrap]
Initializing drush commandfile: provision_apache                                                                                [bootstrap]
Initializing drush commandfile: provision_mysql                                                                                 [bootstrap]
Including /var/aegir/.drush/provision/platform/verify.provision.inc                                                             [bootstrap]
Including /var/aegir/.drush/provision/web_server/verify.provision.inc                                                           [bootstrap]
Including /var/aegir/.drush/provision/dns_server/verify.provision.inc                                                           [bootstrap]
Including /var/aegir/.drush/provision/db_server/verify.provision.inc                                                            [bootstrap]
Could not connect to the master database.                                                                                       [error]
An error occurred at function : provision_mysql_provision_verify_validate                                                       [error]

Comments

anarcat’s picture

Status: Active » Postponed (maintainer needs more info)

That is rather weird: you have drush installed in /usr/bin/drush? is that a symlink? what if you try running drush straight from its checked out directory instead?

It seems that drush *can* find provision, otherwise you wouldn't get things like:

Found command: provision verify                                                                                                 [bootstrap]
Initializing drush commandfile: provision_drupal                                                                                [bootstrap]

Your problem is that it can't connect to the database server. Did you go through the install wizard?

I think it's normal that running provision verify manually at this point doesn't work because the initial drushrc.php isn't created. That is created through the first task ran on the system, fired by the frontend. So you should retry that task and try to run it with:

drush.php task -v <taskid>

Where <taskid> is the nid of the task.

anarcat’s picture

Btw, you're having a problem similar to #446620: can't get past 'drush.php provision verify' failing, but it may not be exactly the same so i'm not marking as a dupe.

skwashd’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

My problem was the the cronjob was running as root. Once I fixed that and used the full path to drush.php not the symlink at /usr/bin/drush it all works.

Sorry for the noise

davidburns’s picture

Can you explain the steps of how you were able to have your cronjob run as a different user?
Also, how it was that you verified your cron was being ran as root?

I would normally check the log files, but you may be able to provide an easier method of doing this.

Thanks

skwashd’s picture

For the cronjob running as a different user you have 2 options.

Option 1
login as the user (so use su)
run crontab -e
add the crontab entry
save and wait

Option 2 (my preferred option)
create a file called /etc/cron.d/drupal (check distro docs to verify path)
put the following line in the file
*/1 * * * * aegir-user (/usr/bin/php '/path/to/drush.php' --root='/path/to/docroot' hosting dispatch > /dev/null)
save and wait

I was playing with root's crontab when i noticed the aegir entry in there.