Doing a drush up on some servers is hanging on the command line.
Using "strace drush up" we can see where the problem occurs, right after building up the list of module versions in a /tmp/ file.
Here's the end of the strace right before drush hangs.
lstat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
lstat("/tmp/pm-updatecode.HPfxou", {st_mode=S_IFREG|0600, st_size=11446, ...}) = 0
open("/tmp/pm-updatecode.HPfxou", O_WRONLY|O_CREAT|O_APPEND, 0666) = 3
fstat(3, {st_mode=S_IFREG|0600, st_size=11446, ...}) = 0
lseek(3, 0, SEEK_CUR) = 0
lseek(3, 0, SEEK_CUR) = 0
write(3, "\n\nCode updates will be made to t"..., 84) = 84
close(3) = 0
dup(0) = 3
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
read(3, ^C <unfinished ...>
Doing a cat/tail of the /tmp/pm-updatecode.HPfxou file shows a complete and formatted list of modules and their versions etc.
We've tried executing the drush command as normal users and the root user. Same problem. Stumped now.
Servers having the problem are:
Fedora 12 64bit
Ubuntu 10.04 64bit
Comments
Comment #1
buddaWorth adding that the problem also occurs with Drush 3.x -- although the strace log is different:
Comment #2
greg.1.anderson commentedRun
topat the same time that you are doing the update and see if you are running out of memory, or anything unpleasant like that.It is advisable to do updates on a copy of your site, not on the site itself. As a workaround, you could copy the live site to a dev machine on another server, do the update there, and then push the results back. If your site has a lot of active user content:
I guess the big question here is whether the updatedb runs on the live site. If it does not, replace the part after test test test with:
Disclaimer: you may need or want to add options to these commands. Test and confirm carefully on your own. Keep rolling backups (or use a vcs) in case your "test test test" step turns out to be inadequate, and you find something after the fact.
Comment #3
greg.1.anderson commentedComment #4
jonhattanwhat's the exact command you're running? also post the --debug output.
Comment #5
chrishaslam commentedFurther to above checking error_logs etc there is no reference to memory being exhausted, and drush up does work for other sites on the same server
We are running drush -l dev.thedomain.co.uk up, here's the --debug below
At this point drush hangs indefinitely, with the corresponding strace being:
Comment #6
clemens.tolboomI did a --yes switch which 'solved' it.
But I found out that the drush_confirm is in err somehow. There is no prompt.
Following the hint to #499758: Prompt abort before user can answer there might be a prompt error again.
By typing y and enter runs the update. See #1041924: Drush up hangs after self-update check which sounds similar.
My env on Mac OS 10.6
Comment #7
clemens.tolboomDoing some further search http://www.google.nl/search?sourceid=chrome&ie=UTF-8&q=php+no+prompt+rea... I ended up on http://stackoverflow.com/questions/187736/command-line-password-prompt-i...
There is a php mention of stream_set_block and some php bug references. This http://bugs.php.net/bug.php?id=34972 sound interesting as it mentions php-5.3
But inspecting drush code
I'm not sure this is related though as stdout is somehow not displayed right.
Comment #8
budda--yes gets me past the problem.
The server PHP version is:
Comment #9
clemens.tolboomToday I used drush on same system but different local site and it worked.
Unfortunately I can't remember which site I did yesterday.
Comment #10
clemens.tolboomBoth local sites are D6. One doesn't show the prompt (y/n) when running
drush upcwhile the other does.How can I investigate further?
Or should I first upgrade to the 4.2 version? This ticket is about the 4.1 version.
Comment #11
clemens.tolboomI just did a
drush upcon the failed environment which is now working as expected. It prompts nicely. I don't understand :(I'm updating modules so visited the /admin/reports/updates too to see the list. Cleared caches etc.
Comment #12
greg.1.anderson commentedUpgrade to drush-HEAD. See #1024824: Installing drush in $HOME/.drush can cause policy.drush.inc to force updatedb to abort mysteriously for the fix.
Workaround: move drush out of $HOME/.drush.