Closed (fixed)
Project:
Drush
Component:
Core Commands
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Dec 2011 at 21:49 UTC
Updated:
1 Jun 2012 at 22:11 UTC
Jump to comment: Most recent file
Hi,
i just noticed that drush doesn't seem to show me the updates that failed when running "drush updatedb". I tested it via the web interface at /update.php - there i get the expected messages.
Best,
Georg
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | dummy_d7.tar_.gz | 597 bytes | juampynr |
| #3 | dummy_d6.tar_.gz | 611 bytes | juampynr |
| #2 | drush-updatedb-does-not-show-failed-updates-1367280-2.patch | 3.11 KB | juampynr |
Comments
Comment #1
moshe weitzman commentedPlease follow the advice here when posting support requests.
Comment #2
juampynr commentedThere is no logic to check for errors after the batch has been executed.
In Drupal 7, Drush launches an exception on failed updates. When doing it from update.php, Drupal calls watchdog_exception() so they get logged too. I have added a call to watchdog() so we do it as well.
In Drupal 6 does not throw an exeption and errors are not even logged when using update.php. Still, I added another watchdog() within _drush_log_update_sql().
The reason why I am looking at the watchdog is because updates are executed in a batch process, so we cannot get a return value from it. This has the downside that if dblog module is disabled, we do not knowt about the result of the update, that is why I added a check at the post update hook to warn about this.
Note that I could not use git format-patch for this patch because I have just done it for #1562764: Undefined variable: db_scheme dbtng.inc:109 when using drush_db_select in Drupal 6. Instead I created it using git show HEAD, which I have seen that it formatted the commit message properly.
Comment #3
juampynr commentedHere are the steps to reproduce the issue:
The last command should have shown an error as the database update is adding a field that already exists. update.php in Drupal core uses the $_SESSION variable to hand errors to the results page. As we do not have $_SESSION on Drush, I have used the watchdog table instead to look for errors. Drupal 7 calls watchdog when there are are errors during updates, but Drupal 6 does not. However, as Drush takes care of the drush_update_do_one() function, we can control this.
Comment #4
moshe weitzman commentedAccording to #1554732: Updb does not show update hook $ret value, This works in drush 4 without resorting to nastiness like querying watchdog table by timestamp. Lets see if we can get back to where we were with drush4
Comment #5
wizonesolutionsI ran into this as well when I botched a
db_add_field. update.php told me what was wrong; Drush just kept offering the database update every time I randrush updb.Comment #6
moshe weitzman commentedI tried the D7 version of dummy module as per #3 and it properly reports an error for me. Am trying with latest drush5 from master branch, though I don't think this code has changed in a while. drush_set_error() gets called in drush_update_do_one() and thats why we properly error here. So, please reopen with more instructions about how to reproduce this.
Comment #7
moshe weitzman commentedI decided to checkout drush 5.1 and it does indeed have the bad behavior described here. So now I am even more confident that this bug is already fixed in master branch and will be fixed in 5.2 (coming within a week).
Comment #8
jonhattanI think this got fixed with #1547432: drush_invoke_process() should default to integrate errors
Comment #9
juampynr commentedYep, it makes total sense. Thanks.