When running "drush up drupal," drush says that the upgrade completed successfully, but no update actually occurs. Instead the initial backup is restored instead. Here's the output:
Do you really want to continue? (y/n): y
Project drupal was updated successfully. Installed version is now 7.2.
Backups were saved into the directory [ok]
/home/xxx/drush-backups/xxx/20110622192752/drupal.
Backups were restored successfully. [ok]
Subsequent checking shows that the Drupal version is still set at 7.0. This behavior occurs on ANY module update as well.
Comment | File | Size | Author |
---|---|---|---|
#35 | drush-1196972.patch | 994 bytes | jonhattan |
Comments
Comment #1
greg.1.anderson CreditAttribution: greg.1.anderson commentedRun with --debug; you are getting a rollback. Looks like the error message could be better in this instance.
Comment #2
zoon_unit CreditAttribution: zoon_unit commentedYou're right, there is a rollback but there is no error message of any kind even in the debug output. Here's the key info:
What makes this doubly frustrating is that I upgraded from 7.x-4.4 because it failed to recognize all module updates. The ones it finds, it upgrades successfully, but nothing will make it update the modules that don't make the 4.4 update list.
Comment #3
greg.1.anderson CreditAttribution: greg.1.anderson commentedThe order of those messages is a bit odd. Try drush-5.x-dev; include the output from drush status, and all of the output from pm-update --debug.
Comment #4
SebCorbin CreditAttribution: SebCorbin commentedSame thing here trying to get drupal (or any project) updated from 7.4 to 7.7, worked once on my blog, failed on another site (same server) using drush 4.5-rc1
Comment #5
msonnabaum CreditAttribution: msonnabaum commentedIt's very important here that we get ALL the debug output. I ran into a similar issue, but the actual error happens towards the beginning of the process, so it's difficult to know whether or not it's related.
My issue was that we failed to get update information for 2 projects, and from that we turned the drupal_set_message(, 'error') into a drush_set_error, which causes rollback for whatever happens afterwards. Obviously not the desired behavior. Doesn't appear to happen in 5, haven't quite nailed down why yet.
Comment #6
zoon_unit CreditAttribution: zoon_unit commentedThis problem is related to the available updates report issue mentioned here:
http://drupal.org/node/1197326
Fixing the update_max_fetch_time fixed both the drupal reports issue and also "drush up" as well.
A workaround for this problem is to set the update_max_fetch_time to 30 seconds with Drush:
drush vset update_max_fetch_time 30
Comment #7
SebCorbin CreditAttribution: SebCorbin commentedSorry 'drush vset update_max_fetch_time 30' doesn't change anything, here's my verbose debug output :
Failed to get available update data for one project. [2.65 sec, [error]
37.21 Mo]
Comment #8
holtzermann17 CreditAttribution: holtzermann17 commentedSubscribe.
Comment #9
msonnabaum CreditAttribution: msonnabaum commentedThat's why it's rolling back. Granted, this is not the desired behavior, but do you know which project is unable to get update info?
I started #1236034: Don't translate drupal_set_message into drush_set_error yesterday to try to address this, but that's not a fix we can do in 4. Perhaps Greg has some ideas on how we can handle this more elegantly.
Comment #10
greg.1.anderson CreditAttribution: greg.1.anderson commentedI think we should demote the above error to a warning, and insure that the unavailable project is skipped in the update operation. It would also be really spiff if there was a big warning at the end listing all of the projects that were missed. Maybe we should even prompt the user and ask if it is okay to procede with a partial update.
We should not warn or fail if the project that no info is available for is not in the list of requested updates. It is questionable whether or not upc should even report status on projects that were not requested in the update list.
Comment #11
SebCorbin CreditAttribution: SebCorbin commentedHow do I know which project updates cannot be fetched ?
Comment #13
SebCorbin CreditAttribution: SebCorbin commentedAnswering to myself : go to admin/reports/updates and check which project is greyed.
I had a views_datasource patched, I just edited it to not have project information. Anyway thanks for helping, but the project name should be mentioned ;)
Comment #14
jonhattanto demote the error to a warning there're two options: Issue #1236034: Don't translate drupal_set_message into drush_set_error or override the 'finished' callback of update.module's batch set. To override this we also need a internal change in drush to allow the batch process include a file from DRUSH_ROOT, as the batch api is restricted to files under DRUPAL_ROOT.
To avoid fetching data for non-drupal.org projects can be done but I think it doesn't fix for all conditions that can trigger this issue: for example a network failure may produce this same error.
Comment #15
holtzermann17 CreditAttribution: holtzermann17 commentedI thought the idea was that modules in sites/all/modules/ wouldn't be updated by Drush up, but those are the (two) projects that are greyed out in admin/reports/updates -- so, what, do I have to disable them before running update?
Comment #16
SebCorbin CreditAttribution: SebCorbin commentedProblem found : renaming and closing.
@holtzermann17: (sites/all/modules gets updated by drush up too). 2 solutions, either you comment out the drupal.org project informations at the end of your greyed out modules' info files; or you just disable them before running your update and re-enable them after. The first one is the simpler, you may have junk at the end info files added by newbie developers or obsolete modules.
Anyway, this discussion continues here for future development : #1236034: Don't translate drupal_set_message into drush_set_error
Comment #17
jonhattanThis is not fixed yet.
Showing up the project's .info files may help a lot. Also it is important to know if they're git clones and if you're using git_deploy module.
Comment #18
SebCorbin CreditAttribution: SebCorbin commentedOk, so here it is :
Someone made a patch for views_datasource to port the D6 module to D7 (yes it is a huge patch). But the patch was altering project info file :
But, due to the absence of the co-maintainer, no info can be fetched for 7.x-dev branch
Comment #19
thomjjames CreditAttribution: thomjjames commentedsubscribing
Comment #20
jackalope CreditAttribution: jackalope commentedAs of version 7.x-4.5 I'm running into these rollback problems because Drush is checking and failing to find update information for my features. This didn't happen with previous versions and doesn't happen with 5.x-dev. Should I be telling Drush to exclude checks for my features somehow?
Comment #21
erikhopp CreditAttribution: erikhopp commentedI just ran into this problem as well. I had a situation where the custom feature that I created was blocking a core update when it was enabled (it could not find release history since it is a feature I made myself). By disabling the feature, I was able to update core from 7.7 to 7.8.
Comment #22
Pocketpain CreditAttribution: Pocketpain commentedSame here, sub
Comment #23
bambilicious CreditAttribution: bambilicious commentedSubscribing.
Comment #24
dcfvg CreditAttribution: dcfvg commentedSubscribing.
Comment #25
Anonymous (not verified) CreditAttribution: Anonymous commentedSubscribing...
Comment #26
vesapalmu CreditAttribution: vesapalmu commentedSame problem, subscribing
Comment #27
tinefin CreditAttribution: tinefin commentedSubscribing
Comment #28
prabhatjn CreditAttribution: prabhatjn commentedI had the same problem. Just upgraded my drush from 4.5 to 5.x dev version, and everything was fine.
Perry.
Comment #29
Pocketpain CreditAttribution: Pocketpain commentedVersion 5.x fixed this problem for me to.
Thanks.
Comment #30
sagannotcarl CreditAttribution: sagannotcarl commentedUpdating to All-versions-5.x-dev (Oct 4, 2011) fixed the problem for me.
Comment #32
jonhattanComment #33
hynnot CreditAttribution: hynnot commented+1
Comment #34
kelvinleehk CreditAttribution: kelvinleehk commentedUpdating to All-versions-5.x-dev (Nov 15, 2011) fixed the problem for me.
Comment #35
jonhattanTo recapitulate:
this bug is present in drush 4.x since 4.5 for drupal 7.
The origin is when drush switched to launch by itself a batch process to get avaliable update info at #1002658: Drush does not correctly handle D7 project status queries
The bug is also potentially present in drush 5.x but we don't hit it because of the changes in backend at #1058874: drush_backend_invoke buffers output till end of command. Show progress..
... but the code producing the error is still there. It happens if a backend command's output is integrated to the main process. A proposal to fix this was #1236034: Don't translate drupal_set_message into drush_set_error, that may not be appropiate in some scenarios.
So attached patch just clears the error context for the concrete case of this issue.
Patch applies both to 4.x and master and I suggest to commit to both branches although in master it is not an issue at present for a canonical invocation of drush upc (perhaps with some argument (--interactive, --integrate or like) it is possible to hit the bug).
Comment #36
moshe weitzman CreditAttribution: moshe weitzman commentedI think this is a good solution.
Comment #37
jonhattanCommitted to master and 4.x (via awesome git cherry-pick)
Comment #39
mlncn CreditAttribution: mlncn commented"Backups were restored successfully." Noooooooooo!
Glad this is fixed in the latest development versions, because a rollback when everything that matters succeeds is a major expectation fail-- and when, say, i'm in the mountains of West Virginia doing work through a cell phone data plan and barely getting a signal with a repeater and a booster that my brother set up, i can't afford it.
Workaround in the meantime, the no-backup flag:
drush upc --no-backup
Comment #40
kerasai CreditAttribution: kerasai commented--no-backup
Nice one
Comment #41
rerooting CreditAttribution: rerooting commentedAh ha! Both of those work -
Note that
--no-backup
should probably only be used when you are using a VCS like git, or when you have project versions and any applied patches memorized! I might use this switch more often, since I am already using git for everything.Also, we are using Pantheon for some projects, and I MUST use drush 4.5 for that. So, what I've done, is symlinked the seperate versions - so
drush
defaults to 5, anddrush4
defaults to 4.5. Works out pretty well.Comment #42
ericxb CreditAttribution: ericxb commentedfwiw: after updating to 5.x-dev some months ago (Nov 2) gracefully cleared up the difficulty. I updated 5.x-dev to the latest version on drupal.org with files dated Jan 16, 2012 and now we're "restoring from backup" again.
Thanks to mlncn for the --no-backup idea. Probably OK on my dev site.
Comment #43
m3m3nto CreditAttribution: m3m3nto commented--no-backup is a workaround that works, but pay attention.
It seems that drush doesn't call updatedb after the code update!
I've some views updates (7301 - Enlarge the name column) yet pending after the upgrade to Views 3.1 today...
Comment #44
rickmanelius CreditAttribution: rickmanelius commented--no-backup worked for me... will stick with this until a stable 5.0 release. Thanks for the tip.
Comment #45
ressa CreditAttribution: ressa commentedUpgrading to 5.0.0 with
sudo pear install drush/drush-5.0.0
fixed it, and I can now update both modules and Core without rollback.I did get this error at first:
So I switched to root with
sudo -i
and randrush up
to get the file in the right place and fix the error, after which my everyday user had full Drush functionality.Comment #46
kkrehl CreditAttribution: kkrehl commentedAfter updating drush to the development version, it was finally showing that a custom feature was causing the problem. Maybe you can just disable your features, update and enable them again!
Comment #47
ckngReopen, problem persist.
Comment #48
ckngWrong version, problem still persist for 7.x-4.5, All-versions-4.x-dev and 7.x-5.0-rc2.
Comment #49
Beanjammin CreditAttribution: Beanjammin commentedThe only way I've found to get past this is to use --no-backup, basically denying drush the ability to rollback the update.
Not sure if this is related, but `drush up drupal` isn't updating the database so I have to run `drush updatedb` afterwards.
Comment #50
the_g_bomb CreditAttribution: the_g_bomb commentedI am seeing this with a dash of #1266614: Custom modules, Strongarm and Features on "Failed to get available update data" list. I think my custom modules are blocking the update.
Comment #51
yareckon CreditAttribution: yareckon commentedJust a couple of notes for folks suffering from this issue:
1) as SebCorbin mentioned in #13, going to the report at /admin/reports/updates is really helpful, you can see there what module (may not be the one you think) is causing the issue. It's the greyed out one.
2) if you are porting D6 modules, you will frequently run into this issue as the project names of the module is found on d.o. but no release history from D7 will be found. Are you in this situation?
Comment #52
rpmskret CreditAttribution: rpmskret commentedI am using the bandaide from poster #39. But the update is never registered so that drupal report out of date on whatever was updated this way.
I need to at first run ..
drush up mymodule
.. and then run ..drush up mymodule --no-backup
Only then is the update both installed and acknowledged.
Comment #53
rerooting CreditAttribution: rerooting commented@romanse make sure your site is running cron regularly. This is what provides regular update information. If that information is not available when you go to run drush up, it may be either that or the greyed out module issue noted above.
Comment #54
rpmskret CreditAttribution: rpmskret commented@rerooting: thank's for the tips. :)
This has become a big deal by now. Updates are fast and furious. So I worked on updating drush as you suggest in your last "1." tip.
I was using putty on windows to do remote drush on a live server. Could not use
drush self-update
for what ever reasons that way. But I got onto the server machine and ran the self-update. Serveral drush versions were in the auto menu returned and I selected the recommended 5.7. That installed in a flash. No new updates yet but I am optimistic drush 5.7 has this issue fixed on linux as it does on windows. *cheers.Comment #55
steinmb CreditAttribution: steinmb commentedCrossposting from #1428608: Can't get Drupal core or modules to update, backups are auto-restored for no apparent reason Did not find this thread before after posting to it. We should prob. just close that one and keep this? Moving the version to the latest 8.x. My testing showed me that 7.x also seems to share the same vulnerability.
Comment #56
dman CreditAttribution: dman commentedI found that it was some custom features causing this for me.
Based on what I'd learnt 20 minutes earlier about Omega subthemes causing update failures because of their project= line I checked the features.
It looks like features generation has taken to adding a "project=featurename" line to the info files.
And drush upc is assuming that the feature (most of which are highly localized) are actually full-blown projects on d.o.
My fix - to avoid the --no-backup route - is to remove the project=xxx line from each info file of hacked or local custom modules.
That makes upc ignore it and not bail out over such a trivial warning.
Comment #57
izmeez CreditAttribution: izmeez commentedJust drifted into this issue today. Thanks everyone for the comments.
@dman, yes features adds a line "project =" and to me it makes sense. I also like that it shows on the report of available updates greyed out as custom features or modules. Not to see it there would be counter intuitive for administration of sites.
Hopefully, newer versions of drush will solve the problem and "not bail out over such a trivial warning".
@rerooting thanks for the summary in #53.
Comment #58
msypes CreditAttribution: msypes commentedI just tried the recommendation in #57, and still got the rollback.
Comment #59
dropfen CreditAttribution: dropfen commentedI found a workaround to this, maybe it will help someone, who has the same problem.
The problem is, that in all of your features, there is a *.info file which contains the "project" property, but in most cases you don't need it. You can comment out this line, and drush will not stack at this point.
So, if you have all of your features in a separate dir, you can switch to to the features dir and execute this command:
find . -name "*.info" -exec sed -ie "/^project/ s/^/; /" {} \;
But be vary carefull with this command: It will comment out all project lines in all Info files of the current dir & subdirs.
Comment #60
izmeez CreditAttribution: izmeez commented@msypes I just used drush 7.x-5.x-dev and didn't have to change any of the .info files.
Comment #61
greg.1.anderson CreditAttribution: greg.1.anderson commentedThis issue was marked
closed (won't fix)
because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate)
.Please ask support questions on Drupal Answers.
Comment #62
rodrigoaguilerahttps://github.com/drush-ops/drush/issues/160
Comment #63
ambukg CreditAttribution: ambukg commentedHi All,
I am getting an error in updating Drupal from 6.32 to 6.33 using Drush command.
When I execute the command it getting stuck at the terminal for a long time. I have to execute Ctrl + C to release the terminal.
Please find the below Drush status details and command output.
################## drush status ############
Drupal version : 6.32
Site URI : http://default
Database driver : mysqli
Database username : --------------
Database name : --------------
Database : Connected
Drupal bootstrap : Successful
Drupal user : Anonymous
Default theme : --------------
Administration theme : garland
PHP executable : /usr/bin/php
PHP configuration : /etc/php.ini
PHP OS : Linux
Drush version : 6.3.0
Drush configuration :
Drush alias files :
Drupal root : /home/account_name/public_html
Site path : sites/default
File directory path : sites/default/files
Temporary file directory path : /tmp
###################### drush up -vv ##########################
Initialized Drupal 6.32 root directory at /home/dacarlidrupal7/public_html_inside_pubhtml [notice]
Initialized Drupal site default at sites/default [notice]
Loading release_info engine. [notice]
Loading version_control engine. [notice]
Loading package_handler engine. [notice]
Executing: wget --version
/usr/bin/php -d magic_quotes_gpc=Off -d magic_quotes_runtime=Off -d magic_quotes_sybase=Off /home/dacarlidrupal7/drush-6.3.0/drush.php --php=/usr/bin/php [notice]
--php-options=' -d magic_quotes_gpc=Off -d magic_quotes_runtime=Off -d magic_quotes_sybase=Off' --backend=2 --verbose
--root=/home/dacarlidrupal7/public_html_inside_pubhtml --uri=http://default pm-updatestatus 2>&1
Please help in resolving the issue.
Regards,
Comment #64
rodrigoaguilerathe issues for drush are now in github.