I am opening this ticket because I just managed to get a fresh rc3 install going, and previously reported issues of 'cannot find the mysql database' errors and so forth while attemptign to verify the initial platform in this ticket 550696 started by Annakan. A few other issues were resolved from that ticket.
I am now reproducing Annakan's later issue, post-patch of the 'install_disable_theme' issues determined to be an incorrect implementation of install profile api in hostmaster.profile. The issue I am reproducing is the 'command 'drush.php provision verify' could not be found.' error that occurs on initial verify of the initial platform.
Screenshot attached. Now I'll go to work to try and work out what's causing and update if I find anything.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 553348.patch | 1.38 KB | mig5 |
| #2 | Screenshot-Verify aegir5.home_.mig5_.net | 100.47 KB | mig5 |
| Screenshot-Verify aegir5.home_.mig5_.net | 105.59 KB | mig5 |
Comments
Comment #1
Anonymous (not verified) commentedOutput of
php /var/aegir/drush/drush.php --root='/var/aegir/drupal-6.13' 'provision' 'verify' --backend --debug, which is what the verify on the site is trying to run in the taskCleaned up to be a *bit* readable
Comment #2
Anonymous (not verified) commenteder. it was on a fresh install and I forgot to install provision into ~/.drush/ :/ sorry once again for the noise.
Now I have done that, re-ran the verify and I'm back to 'could not connect to the master database'. Screenshot attached. The title of this ticket will need to be updated
Comment #3
Anonymous (not verified) commentedSolved. In the install , we're advised to grant a superuser of sorts to create new databases, the command suggested is:
Per line 25 of hosting/db_server/hosting_db_server.module
Despite doing this, it didn't work until I also ran this
I am completely baffled as to why the wildcard doesn't pick this up.. wtf? A debianism maybe?!
Anyway, that is *definitely* what fixed it for me.
How this hasn't affected anyone else before is beyond me.
Comment #4
anarcat commentedaaaah damn it, yes. that's an old issue. Good catch.
So that is not a debianism, it's a mysql-ism. '%' applies only to network connections and 'localhost' is special: it's the local socket, so '%' is not picked up.
We need to use the same logic as is being used in the provision module to guess the grant we need to create. This logic is enclosed in _provision_mysql_grant_host() in provision/db_server/provision_mysql.drush.inc (so we can't use it directly in hosting).
Comment #5
Annakan commentedI feel like the bad guy of the story here, sorry for the trouble but this did not fix the issue for me.
I deleted the DB.
Recreated it and added the step mig5 suggested.
And ....
Started fresh from a new setting.php copied from default ...
then ...
I followed the wizard from start to finish ...
And
... I have the "same" (looking the same) error :(
I also tried to execute the command from the command line
php /var/www/aegir/drush/drush.php --root='/var/www/aegir/drupal-6.13-AEgir' 'provision' 'verify' --verbose=2 --master_db_host=localhost --master_db_user=aegir --master_db_passwd=XXXX --debug --master_db='mysqli://aegir:XXXX@localhost' --verbose=2
with the --backend option the result is the same (of course)
I have another troubling phenomenon : the cron do not run the queue but does it from the command line
crontab
but from the command line
works perfectly and empty the queue ...
Looks like a vicious permission problem, I don't know, I mention it because it MAY be related...
/depressed :)
Comment #6
Annakan commentedI am tracing the issue to a visudo / apachectl command issue ...
May be related to my freeBSD platform
will keep you posted
Comment #7
Anonymous (not verified) commentedreply to #4
I tried doing something similar to _provision_mysql_grant_host() from provision/db_server/provision_mysql.drush.inc, but in hosting/db_server/hosting_db_server.module, problem of course being that one can't call drush_get_option, or at least not at this stage in the installer (can we leverage drush commands at this stage?), so unsure of how to proceed. Maybe someone with better skills can move forward.
Comment #8
anarcat commentedMaybe a simple workaround here would be to just tell the user the host part could be @'localhost' if the mysql server is local (which is usually the case anyways). In fact, we most likely want to make *that* the default in the documentation (and point to @% as an option) since 0.3 does *not* aim to have multiple server support (it's just a configuration that happens to be fairly common).
So I would welcome a workaround patch that would say @'localhost' and mention of @'%' as an option to unblock rc4 here.
Comment #9
Anonymous (not verified) commentedPatch against HEAD attached per suggestion.
Cheers
Comment #10
anarcat commentedOkay excellent, patch committed. Now we want to figure out how we're going to detect the mysql server in the wizard. It's not release critical anymore because the instructions provide a nice workaround, but it would be better to provide proper instructions. _provision_mysql_grant_host() need to be duplicated and rewritten to tear out the drush stuff (a comment on top of the function *must* indicate it's a dupe, both in provision and hosting) and be integrated in the code here.
Comment #11
Annakan commentedunfortunately my trail went cold.
I am just wondering about the
part in the --backend result ....
In the profile install wizard the correct www group is found and validated.
I was wondering also for the
in the task error log.
I think I now need to be able to instrument drush to determine where some silent error is swallowed ... What I would give for a clear and nice exception traceback right now :)
My kingdom for a traceback ;)
Can somebody point me to the dispatch function in Drush ?
The verify command is properly registered but the "verify" function is never called, so something happens in beetween.
Being able to output the dispatch order of commands in Drush core might help me narrow where the "command not completed" is produced.
Thanks a lot
Comment #12
Anonymous (not verified) commentedAnnakan,
I get these too and always have since rc2
I really recommend you re-install based on rc4 which was very much improved over many hours by the team. I'd be interested to see if your situation improves after following the excellent, overhauled instructions of the INSTALL.txt.
Drop by on IRC if you run into issues. I just installed rc4 using only the above INSTALL.txt with absolutely no errors occuring. It'll be interesting to identify what might be 'freebsd' issues as opposed to debianisms.
Comment #13
Annakan commentedOK I was planning to do that this week end .
I'll start fresh on a new "jail" (a kind of freeBSD VM/virtuozo container) and follow the procedure.
I'll probably try tonight to dig/trace more into the drush code to see if I can get closer to the error point, just for my own curiosity and to try to understand the whole logic a bit more.
Thanks a lot for you time
Comment #14
Annakan commentedGot it :)
Call me stubborn but I wanted to find the bottom of it and for once stubbornness paid of because I would have had the same problem with RC4.
I managed to install remote Eclipse-PDT - CLI debugging through my NAT-ed home computer to my main coloc server, something that could prove useful (for me at least) in the future (if it is such a common skill forget I ever wrote this sentence but if some people are interested I could write a short doc)
This lead to the line
as the one that provoked a run-time failure and thus the command failure.
Now guess what ?
On my FreeBSD box I installed the PhP extensions with mysqli because it is the recommended modern PhP interface for Mysql, but not the "Mysql" extensions proper.
It is mandatory to have the "old school mysql" extensions support and not only the "mysqli extensions" to use AEgir.
PHP Mysql support must be understood in the literal sense for now. :)
That information is somewhat hidden in the
apt-get install php5 php5-cli php5-mysqlline in INSTALL.TXT under a debian-ism :)Since Drupal supports either Mysql extensions or MysqlI extensions, I was none the wiser on the Drupal front but obviously the AEgir modules do not .... hence the problem.
I will now wipe out the full install and redo it following step by step the new RC4 instruction and report anything unclear, odd or non obvious.
I'll have questions on the recommended file structure and upgrade policy (I have bad gut feelings about it) but I will first follow the instruction to the letter and ask about it after that.
Thanks a lot to the AEgir team.
Comment #15
anarcat commented@Annakan - please open a separate issue about the mysql vs mysqli issue. I'm not sure this should happen at all or how Drupal works around this issue.
Otherwise, the last summary I posted here still stands:
Comment #16
doka commented@Annakan (#6): I had to add the aegir user to sudo list (visudo), in order to give permission to restart the apache. It was somewhere mentioned, but not in the install.txt. It was on a Ubuntu 9.04 server.
Comment #17
j2parker commentedTwo attempts at aegir installation fail at the same place, Verify your configuration.
Fresh Ubuntu 8.04 install on VPS.
php /var/aegir/drush/drush.php --root='/var/aegir/drupal-6.14' 'provision' 'verify' --backend --debug
{"type":"notice","message":"Undefined index: base_url","timestamp":1254316304.61,"error":null},{"type":"bootstrap","message":"Initializing drush commandfile: provision_drupal","timestamp":1254316304.61,"error":null},{"type":"bootstrap","message":"Initializing drush commandfile: provision_mysql","timestamp":1254316304.61,"error":null},{"type":"notice","message":"Undefined index: db_url",...
"error":"PROVISION_MASTER_DB_FAILED"},{"type":"error","message":"An error occurred at function : drush_provision_mysql_provision_verify_validate",...
"error_log":{"PROVISION_MASTER_DB_FAILED":["Could not connect to the master database."]},...
phpinfo
mysql
MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => 5.0.51a
MYSQL_MODULE_TYPE => external
MYSQL_SOCKET => /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib -lmysqlclient
Directive => Local Value => Master Value
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => no value => no value
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off
mysqli
MysqlI Support => enabled
Client API library version => 5.0.51a
Client API header version => 5.0.51a
MYSQLI_SOCKET => /var/run/mysqld/mysqld.sock
Directive => Local Value => Master Value
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.reconnect => Off => Off
I have verified db, dbuser and dbuser password.
The install process has stopped at 'Verify your configuration'. phpMyAdmin shows 60 tables created in db aegir.
Comment #18
Anonymous (not verified) commentedYou perhaps didn't configure a superuser mysql user.
There is a dbuser/pass for the main aegir site, like any other drupal site. There is also required to be a mysql superuser who can create new databases. Given that you are running a verification of the platform, I suspect the failure above is specific to the superuser (if there is one) not being able to create new databases.
Ironically this very ticket is the one from which a fix was made (#9) to the help steps given in the install process which you perhaps didn't follow during the install at the 'Database server' configuration stage:
Comment #19
j2parker commentedThanks for clarifying that there are 2 mysql users required. The confusion arises because INSTALL.txt instructs to add mysql user aegir
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON aegir.* TO 'aegir'@'localhost' IDENTIFIED BY 'XXXXXXXX';
Then during the installation wizard, at 'Database configuration'
Database username: * does not prefill. It should prefill with aegir.
Later at 'Configure your database server'
Username: * does prefill with aegir. It should not prefill as this is the superuser mysql user you mention above.
Additionally, I was able to resolve the Undefined index: db_url.
nano /var/aegir/drupal-6.14/sites/aegir.example.com/settings.php
Change
# $base_url = 'http://example.com'; // NO trailing slash!
To
$base_url = 'http://aegir.example.com'; // NO trailing slash!
after the 'Install Profile' step.
Comment #20
Anonymous (not verified) commentedI have committed two fixes that make it much more clear that there is a requirement for a database superuser capable of creating more databases, and that we recommend creating a separate user to the db user of the 'main' aegir site. We also now suggest a standard naming convention:
Main aegir site: database name 'aegir', database user 'aegir'
Superuser: database user 'aegir_root'.
The examples given in the "How do I configure this" section now use 'aegir_root' by default. There is also a nice big bold statement on that configuration page in the install saying
In my opinion if the user reads the instructions, it is impossible to be misled.
On the superuser configuration page, you are right, it does populate the field with the database user name of the earlier 'main' aegir database config. I'm not sure if we can fix this since this form is taken direct from the actual db_server module's hook_form().. on the other hand it looks like we are deliberately populating these fields in the hostmaster profile, which I think is misleading. I need to discuss this further with Vertice/anarcat.
But the actual instructions are a lot more verbose, blatant, and most of all consistent now in INSTALL.txt, the actual browser-based instructions, and also the docs on g.d.o which I updated.
Comment #21
Anonymous (not verified) commentedThe wizard is gone in the dev-services branch and the db server for the superuser is configurable/prompted in the install.sh script - I feel this is sufficient now, no further detection magic required.