Cannot redeclare provision_mysql_drush_init()
Jeff Burnz - September 4, 2009 - 09:02
| Project: | Provision |
| Version: | HEAD |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
BTW, I assume this against head, I installed aegir using the install.sh and none of the installed modules have version numbers.
Running any drush command as the aegir user results in this error, e.g.
aegir@adaptivethemes:/root$ cd /var/aegir/drupal-6.*
aegir@adaptivethemes:~/drupal-6.13$ /var/aegir/drush/drush.php hosting setup
Fatal error: Cannot redeclare provision_mysql_drush_init() in /var/aegir/.drush/provision/db_server/provision_mysql.drush.inc on line 12
Drush command could not be completed. [error]Running drush help as root I see the "provision" commands are not there. If I try to run "drush" as aegir user I get the above error.
The first queued task "Verify adaptivethemes.net (Drupal 6.13)" is not verified, cron appears to not be running or a crontab is not set.
Drupal 6-1.3
Ubuntu 9.04
Apache2
PHP 5.2
aegir@adaptivethemes:~$ id
uid=1000(aegir) gid=1000(aegir) groups=33(www-data),1000(aegir)
I'm more than happy to pay someone to help me get Aegir up and running...

#1
Hmm I can't reproduce this in a fresh checkout of HEAD.
First of all it's odd that you used install.sh and got HEAD components? Did you download the install.sh.txt from hostmaster 6.x-0.3 ?
Second, the drush command should include the --uri=http://adaptivethemes.net (or whatever, it should be the URL of the aegir site itself) parameter: however, only recently the install.sh.txt was fixed to *not* install the main aegir site in sites/default (now that it is a regular site in itself in aegir, we need the --uri parameter..). On the other hand, if somehow you are running HEAD from the last couple days, you've got this fix..
Finally, do you happen to have any other components inside /var/aegir/.drush/ other than provision? Perhaps for something non-aegir specific?
#2
Jeff: did you tried to install aegir in the past? perhaps you have another copy of provision anywhere. Check if you have a provision folder inside
path/to/drush/commands, inside the drupal root or perhaps you copied it to provision.old ... the fact is that twoprovision/db_server/provision_mysql.drush.incfiles are being loaded by drush...#3
Ok, I will try to answer this best I can:
We used install.sh Revision 1.8.
Aegir was installed on a pristine Ubuntu VPS, the host did a clean install for us just prior to running install.sh.
@jonhatten
root@adaptivethemes:/# find . -name "provision_mysql.drush.inc"./var/aegir/.drush/provision/db_server/provision_mysql.drush.inc
./var/aegir/.drush/provision/provision.tmp/db_server/provision_mysql.drush.inc
I assume I should remove /var/aegir/.drush/provision/provision.tmp/db_server/provision_mysql.drush.inc
Actually I ran the hosting setup as root and it did run, but Aegir is reporting errors
The command 'drush.php provision verify' could not be found.Removing task from hosting queue
An error occurred at function : drush_hosting_hosting_task
So should I just remove the offending extra file and run the hosting setup again?
#4
Hi Jeff,
You should go further than that and remove the provision.tmp directory and its contents altogether. So get rid of that first.
The hosting setup command should not be run as root, it should be run as the aegir user. You will need to edit your root's crontab, remove the entry that will have been placed into it, and run the command as the aegir user inside /var/aegir/drupal-6.13:
/var/aegir/drush/drush.php --uri=http://aegir.example.com hosting setupwhere aegir.example.com is your main aegir site.
For troubleshooting's sake, check the crontab of the aegir user and you should see this:
*/1 * * * * (php '/var/aegir/drush/drush.php' hosting dispatch --root='/var/aegir/drupal-6.13' --uri=http://aegir.example.com)If not, or if there are multiple entries or anything weird like that, just make it as above.
I'm keeping this ticket open while I try to determine whether the 'provision.tmp' stuff that was left there is a bug in install.sh, though I've never come across it.
#5
Thank-you mig5 and you to jonhattan,
I followed the steps in #4 and now have it all running with nice green verified everything (installed a platform and my first site as well).
I still don't know why the "provision.tmp" dir was created, nothing seemed to go wrong during the install.sh process.
Guys, this has to be the most responsive and helpful issue queue I have ever posted in, cheers, it is very much appreciated.
#6
Glad to hear all is working for you now!
I should've mentioned in the last comment, 'provision.tmp' is a residual leftover from the install.sh . The issue is that it shouldn't have left it there (and I'm dubious as to why it's in a subdirectory of the main provision dir!) . So hence why I'll keep this open for a bit, see if I can reproduce.
If you're feeling generous and have a moment, it'd be appreciated if you could let us know what you precisely did, i.e can you confirm that you did this:
1) Downloaded the install.sh.txt itself onto your server
2) Put it in /var/aegir/
3) executed it as the root user
(i.e did you put it somewhere other than /var/aegir or something.. anything I can try and mimic to try and reproduce)
Thanks for getting into Aegir!
#7
Went like this,
1) Downloaded the install.sh.txt itself onto your server - YES
2) Put it in /var/aegir/ - NO, in /root/
3) executed it as the root user - YES
Other than that there just one thing, I believe the script is meant to create the symlink for Drush but I had to do this manually.
#8
Jeff: did you run the script twice? That will explain that provision.tmp/ were a folder inside provision/ because of this function of install.sh being called twice to checkout provision module:
cvs_co () {bn=`basename $3`
cvs -z6 co -d $bn.tmp -r$2 contributions/$1
mv $bn.tmp $3
}
#9
#10
Just wanted to say this tread helped me troubleshoot my issue installing drush.
I used the install script and got the duplicate provision_mysql.drush.inc file in provision.tmp
locate didn't show tow provision_mysql.drush.inc so this was helpful in finding the offending file.