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.

CommentFileSizeAuthor
#9 644038_curl_timeout.patch1.04 KBanarcat

Comments

webkenny’s picture

Sorry. Forgot the most important version above: (X-Powered-By: PHP/5.2.10)

cesarmiquel’s picture

I 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")}, 16

and hangs there.

$ host 69.147.83.196
196.83.147.69.in-addr.arpa domain name pointer y1.php.net.

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.

robertdouglass’s picture

Title: Drush does not respond » Better failure if unable to get DRUSH_TABLE_URL
Component: Interoperability » Code

I 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.

moshe weitzman’s picture

Title: Better failure if unable to get DRUSH_TABLE_URL » Drush does not respond
Component: Code » Interoperability
Status: Active » Postponed (maintainer needs more info)

make sure your pressflow is more recent than when the issue was fixed there.

webkenny’s picture

Status: Postponed (maintainer needs more info) » Active

Moshe,

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.

robertdouglass’s picture

Title: Drush does not respond » Plan for network failure when wget or cron is used to fetch DRUSH_TABLE_URL

Moshe, 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.

moshe weitzman’s picture

Sorry, I posted into the wrong issue. Better error handling here is welcome.

moshe weitzman’s picture

Status: Active » Fixed

I 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.

anarcat’s picture

Priority: Normal » Critical
Status: Fixed » Needs work
StatusFileSize
new1.04 KB

The --connect-timeout option doesn't take an equal sign in curl:

curl: option --connect-timeout=30: is unknown
curl: try 'curl --help' or 'curl --manual' for more information

Fix attached.

moshe weitzman’s picture

Status: Needs work » Fixed

committed. thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

grendzy’s picture

Version: All-Versions-2.1 »
Status: Closed (fixed) » Active

This 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.

if ($file = @file_get_contents(DRUSH_TABLE_URL)) {
  @file_put_contents($tablefile, $file);
}
greg.1.anderson’s picture

See also #487300-33.

roball’s picture

@#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)) {"!

moshe weitzman’s picture

Component: Interoperability » PM (dl, en, up ...)
Status: Active » Fixed

Improved in HEAD and probably not to be fixed in prior versions.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.