Closed (fixed)
Project:
Provision
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Nov 2010 at 22:02 UTC
Updated:
3 Dec 2010 at 23:10 UTC
Jump to comment: Most recent, Most recent file
In mysql_service.inc, the grant_host function shell call will "freeze" if the database allow anonymous connections.
Since the 'mysql -u intntnllyInvalid' call won't fail, the shell_exec call will never return and thus the processing freeze (And for a strange reason consume all available memory sometime)
Here's the trace of the execution:
sh-4.1$ /var/aegir/drush/drush --debug @hostmaster provision-install
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.04 sec, 7.71 MB] [bootstrap]
Loading drushrc "/var/aegir/hostmaster-0.4-alpha14/drushrc.php" into "drupal" scope. [bootstrap]
[0.04 sec, 7.72 MB]
Initialized Drupal 6.19 root directory at /var/aegir/hostmaster-0.4-alpha14 [0.05 sec, [notice]
8.97 MB]
Found command: provision-install (commandfile=provision) [0.06 sec, 8.96 MB] [bootstrap]
Initializing drush commandfile: drush_make [0.06 sec, 8.97 MB] [bootstrap]
Initializing drush commandfile: drush_make_d_o [0.06 sec, 8.97 MB] [bootstrap]
Initializing drush commandfile: provision [0.06 sec, 8.97 MB] [bootstrap]
Load alias @server_master [0.06 sec, 8.99 MB] [notice]
Loading mysql driver for the db service [0.06 sec, 9.01 MB] [notice]
Loading apache driver for the http service [0.06 sec, 9.02 MB] [notice]
Load alias @platform_hostmaster [0.06 sec, 9.03 MB] [notice]
Including /var/aegir/.drush/provision/db/install.provision.inc [0.06 sec, 9.05 MB] [bootstrap]
Including /var/aegir/.drush/provision/dns/install.provision.inc [0.06 sec, 9.05 MB] [bootstrap]
Including /var/aegir/.drush/provision/example/install.provision.inc [0.06 sec, 9.06 MB] [bootstrap]
Including /var/aegir/.drush/provision/http/install.provision.inc [0.06 sec, 9.06 MB] [bootstrap]
Including /var/aegir/.drush/provision/platform/install.provision.inc [0.06 sec, 9.07 MB][bootstrap]
Function ereg_replace() is deprecated db.drush.inc:74 [0.06 sec, 9.11 MB] [notice]
Executing: mysql -u intntnllyInvalid -h 'speedup.dorsal.polymtl.ca' -P '3306' [0.06 sec, [notice]
9.12 MB]
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 0001-Add-an-empty-exec-option-to-the-mysql-command-so-tha.patch | 972 bytes | greenscientist |
| #3 | 0001-Use-a-mysql_connect-function-instead-of-a-shell-exec.patch | 1.85 KB | greenscientist |
Comments
Comment #1
greenscientist commentedI'm currently trying to change the line 91 to:
$command = sprintf('echo "quit" | mysql -u intntnllyInvalid -h %s -P %s',
which add an echo "quit" as input to the mysql command.
It seems to work, but need more testing...
Comment #2
Anonymous (not verified) commentedYes this is bad.
It at least used to fail and exit with that spectacular error 'Dummy connection failed to fail.'
Comment #3
greenscientist commentedI've attached a patch which try the connection with a direct mysql_connect call.
This is less error prone than an exec call.
Comment #4
anarcat commentedGreat idea! This is exactly what I thought we should do.
However, you need to parse the error message and return the same match as we do in the commandline form, otherwise everything breaks down beyond that. I believe that the purpose of this function is to find the address of the server we're connecting from, as seen from the mysql server, so that functionality is very important.
Otherwise +1 on the patch once that is fixed.
Comment #5
adrian commentedyou cant do this
the exec call may be calling the command on a remote web server, to determine what the grant needs to be for the webserver to access the db server.
Comment #6
greenscientist commentedOk, I see your point.
Finally, simply adding -e "" to the mysql seem to be doing the trick.
Comment #7
anarcat commentedThat patch seems sound, I'll see if I can test this quickly to get it into the next release.
Comment #8
anarcat commentedI tested an install with the patch, and it works, so that's good enough for me, pushing to master.
Welcome to the project, Yannick! :)