I did check the issue #487300: Drush hangs when using Pressflow to ensure that I wasn't posting a duplicate although that does look similar to my issue. However, I am not using Pressflow or any non-standard distro of Drupal. Just 6.x from DO.
When I execute drush on the command line (in both PuTTY and MacOSX terminal, just to doublecheck that it wasn't the interface) I receive no response to the command. It hangs and I have to send the exit signal (CTRL-C) to get out.
I have run a sample "Hello World" script on the command line using php to ensure it wasn't that failing me.
This is running as root and my version info (via cat /proc/version) is below:
Linux version 2.6.18-164.6.1.el5PAE (mockbuild@builder16.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Nov 3 16:55:59 EST 2009
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 644038_curl_timeout.patch | 1.04 KB | anarcat |
Comments
Comment #1
webkenny commentedSorry. Forgot the most important version above: (X-Powered-By: PHP/5.2.10)
Comment #2
cesarmiquel commentedI have a similar problem using drush-HEAD. I did an strace and found that the program is trying to connect to an IP in php.net and hangs there. Maybe the server is down. I do:
$ strace -f drush ... [pid 9369] connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.0.11")}, 28) = 0 [pid 9369] gettimeofday({1259253715, 435766}, NULL) = 0 [pid 9369] poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}]) [pid 9369] send(5, "\37\230\1\0\0\1\0\0\0\0\0\0\3cvs\3php\3net\0\0\1\0\1"..., 29, MSG_NOSIGNAL) = 29 [pid 9369] poll([{fd=5, events=POLLIN}], 1, 5000) = 1 ([{fd=5, revents=POLLIN}]) [pid 9369] ioctl(5, FIONREAD, [217]) = 0 [pid 9369] recvfrom(5, "\37\230\201\200\0\1\0\2\0\4\0\4\3cvs\3php\3net\0\0\1\0\1\300\f\0\5"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.0.11")}, [16]) = 217 [pid 9369] close(5) = 0 [pid 9369] socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 5 [pid 9369] connect(5, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("69.147.83.196")}, 16and hangs there.
So.. it seems Drush is trying to access port 80 of that server. I tried telneting and its down.
Now.. I don't know why its trying to connecto to php.net but I think it should either timeout gracefully and continue. It seems the timeout is too long.
Comment #3
robertdouglass commentedI bet these are the lines that're causing that:
./includes/environment.inc:112:define('DRUSH_TABLE_URL', 'http://cvs.php.net/viewvc.cgi/pear/Console_Table/Table.php?revision=1.28...');
./includes/environment.inc:337: if ($file = @file_get_contents(DRUSH_TABLE_URL)) {
./includes/environment.inc:341: drush_shell_exec("wget -q -O includes/table.inc " . DRUSH_TABLE_URL);
./includes/environment.inc:343: drush_shell_exec("curl -s -o includes/table.inc " . DRUSH_TABLE_URL);
So yeah, better reporting and a shorter timeout is needed.
Comment #4
moshe weitzman commentedmake sure your pressflow is more recent than when the issue was fixed there.
Comment #5
webkenny commentedMoshe,
This is not related to Pressflow. This is a general Drush failure when the php.net IP address does not respond. #2 and #3 identified the point of failure. My initial comment about PF was only to illustrate the similarity.
Comment #6
robertdouglass commentedMoshe, I think the issue is what should happen if either of these lines fail:
./includes/environment.inc:341: drush_shell_exec("wget -q -O includes/table.inc " . DRUSH_TABLE_URL);
./includes/environment.inc:343: drush_shell_exec("curl -s -o includes/table.inc " . DRUSH_TABLE_URL);
Today they failed because the URL behind DRUSH_TABLE_URL was unavailable. This leaves the client hanging for a 3 minute timeout without any information. Maybe we need a messages that says "Now getting needed PEAR dependency, this requires a network connection."
That would at least have let us know what it was trying to do. Maybe even print the DRUSH_TABLE_URL in that message so that we could have more quickly diagnosed that the remote server was the point of failure. I think I'd also make the available information about the dependency on this library more prominent in the readme.
That's why I'm changing the title again.
Comment #7
moshe weitzman commentedSorry, I posted into the wrong issue. Better error handling here is welcome.
Comment #8
moshe weitzman commentedI added 30 second timeouts to these calls. That wasn't really needed though. If folks would add --debug or --verbose to their command, they would see the exact wget or curl command and can diagnose just fine.
Comment #9
anarcat commentedThe --connect-timeout option doesn't take an equal sign in curl:
Fix attached.
Comment #10
moshe weitzman commentedcommitted. thanks.
Comment #12
grendzy commentedThis seems to still be an issue in HEAD. drush --debug outputs nothing, just hangs forever, I could only find the cause with xdebug. I don't really understand why, I deleted this code from environment.inc (since I assumed only drush_shell_exec will produce debugging info) but I got the same result.
Comment #13
greg.1.anderson commentedSee also #487300-33.
Comment #14
roball commented@#8: Has this fix also gone into 6.x-3.3? Because neither the --debug nor the --verbose flag makes any difference. I found that during that bootstrap phase, -d and -v are even not honoured at all, so a
drush_log($message, 'debug')won't ever display before includes/environment.inc's "if ($file = @file_get_contents(DRUSH_TABLE_URL)) {"!Comment #15
moshe weitzman commentedImproved in HEAD and probably not to be fixed in prior versions.