The queue daemon keeps dying recently, on a squeeze system (php 5.3, drush 7.x-5.x)
Restarting queue daemon with /usr/bin/php /var/aegir/drush/drush.php --php='/usr/bin/php' --php-options=''\'''\''\'\''
Calling proc_open(''\''/usr/bin/php'\''' ''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\' \'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'' -d magic_quotes_gpc=Off -d magic_quotes_runtime=Off -d magic_quotes_sybase=Off'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''
\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\''\'\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\''\'\''\'\'''\'''\''\'\'''\'''\''\'\'''\'''\'''
--verbose @hostmaster hosting-queued.
Array to string conversion hosting_queued.drush.inc:191 [notice]
pcntl_exec(): Error has occured: (errno 7) Argument list too long hosting_queued.drush.inc:191 [warning]
WD hosting_queued: Could not restart the queue daemon, aborting. [error]
Drush command terminated abnormally due to an unrecoverable error.
It seemd to be related to the patch that went into drush from https://drupal.org/node/1748228#comment-7659959
However reverting that did not help.
I also quickly tried the change below... no luck:
--- a/queued/hosting_queued.drush.inc
+++ b/queued/hosting_queued.drush.inc
@@ -179,7 +179,7 @@ function hosting_queued_restart($signal = NULL) {
// extra leading spaces.
foreach ($options as $key => $value) {
if ($value !== TRUE) {
- $args[] = "--$key=" . escapeshellarg($value);
+ $args[] = "--$key=" . drush_escapeshellarg($value);
}
else {
$args[] = "--$key";
Comment | File | Size | Author |
---|---|---|---|
#8 | hosting.code_.2077793-8.patch | 1.57 KB | helmo |
#5 | hosting.code_.2077793-5.patch | 1.21 KB | helmo |
Comments
Comment #1
ergonlogicThis could be related to #2050881: drush.php: Permission denied creating crontab, or at least share a common solution.
It looks like we're building a drush command over here too, in hosting_queued_drush_find_drush(). As with that other issue, we should probably just call drush_build_drush_command() in both cases.
Comment #2
helmo CreditAttribution: helmo commentedNot sure if drush_build_drush_command would help, we need an array of arguments and an executable path.
Comment #3
ergonlogicRight, but Drush shouldn't be called directly (drush.php) nor via PHP (php drush.php), but rather through the appropriate shell script. This is what
drush_build_drush_command()
is supposed to do for us. As for an array of arguments, shouldn't we be using the Drush API? That is,drush_get_arguments()
should probably be preferred over looking directly in $_SERVER['argv'], no?Anyway, I don't know that any of that would actually solve the problem at hand. Maybe just removing the escapeshellarg() entirely would help. After all, it's intended to escape user input, whereas these options should only be coming from the system itself.
Comment #4
anarcat CreditAttribution: anarcat commentedthis seems like a critical problem!
Comment #5
helmo CreditAttribution: helmo commentedNew log ... shortened for readability.
I've patched up a fix for this... tested on Debian squeeze and Wheezy. It's dirty dough :(
Setting a short "Process lifetime timeout: " on /admin/hosting/queued really helps testing this.
I also found the reason for the following warning:
Array to string conversion hosting_queued.drush.inc:191
The $_ENV array contained another array in $_ENV['argv']. Thanks php for the clear warning ;)
I'm adding an unset for this as I don't think we need that part of $_ENV.
Comment #6
anarcat CreditAttribution: anarcat commentedhum.. and what about the idea of using drush_build_drush_command()?
Comment #7
helmo CreditAttribution: helmo commented@anarcat: If that leaves us with a cleaner solution... I'm in favor.
I would like to fix this for squeeze, but also realize that my last squeeze Aegir setup should be upgraded to wheezy fairly soon.
Comment #8
helmo CreditAttribution: helmo commentedDarn... now I also see this in an aegir-up vagrant wheezy VM.
This new patch simplifies it a great deal... or would that create issues? portability?
Comment #9
anarcat CreditAttribution: anarcat commentedwhaaat a mess! again - i really think we should use the drush_build_command() function to find out what drush is, and stop guessing around argv...
Comment #10
anarcat CreditAttribution: anarcat commentedfor the record, this is how hosting-dispatch gets created for the cronjob:
can't se simply use something similar?
Comment #11
anarcat CreditAttribution: anarcat commentedhaha this is hilarious. @helmo, your patch should just work and is awesomely simple.
we should make a function out of it and also call it in hosting-setup. i'll take a stab at it.
Comment #12
anarcat CreditAttribution: anarcat commentedi started making a function, and it turned out to be so ridiculous that I feel we don't need a function at all:
when you got more comments than code, you know that (a) something is wrong and (b) it's probably the language's fault.
and for the record, I believe that if we have any further problems with calling drush, we should use this:
aaanyways. i committed and pushed your patch. yay.
Comment #13
marafa CreditAttribution: marafa commentedhi
does this mean the hosting queue demon is not working? the task queue just sits there doing nothing if i enable it
Comment #14
helmo CreditAttribution: helmo commentedYes, eventually the amount of quotes results in an "Argument list too long" error.
restarting is a workaround.... but updating, or patching #8 is better :)