Closed (fixed)
Project:
Drush
Version:
All-versions-3.x-dev
Component:
Core Commands
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Jan 2011 at 22:00 UTC
Updated:
3 Jan 2014 at 02:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
techgirlgeek commentedUpdate, this happened on my localhost, on the production server I was prompted whether I wanted to run the updates or not.
Comment #2
greg.1.anderson commentedPlease follow the submission guidelines described here: http://drupal.org/node/add/project-issue/drush
It looks like you have set
$options['n'] = TRUE;in your drushrc.php, or something along those lines. The following may help you diagnose whether this is the case or not:Comment #3
ezeedub commentedI just had the same problem. Here's the updb portion of the output. I got this both times I ran
drush up(first upgrading my modules, and then drupal core).Here's the output of
drush_get_merged_options():I remember now that I saw this same behavior a few days ago on another site, and running update.php afterwards worked (I didn't capture any output from that drush run though).
Comment #4
joeebel commentedSame problem here, even with -y ...
Here is the output of drush @ilww-home updatedb:
I never get a chance to answer the prompt.
And here is the output from drush_get_merged_options:
Comment #5
greg.1.anderson commentedTry with drush-HEAD and this patch.
Guessing; theoretically, this patch should not help, because DRUSH_AFFIRMATIVE and DRUSH_NEGATIVE are set during bootstrap as follows:
Thus, these values should be set to either TRUE or FALSE. You might have to step through the code to solve this one; I cannot reproduce it.
Comment #6
greg.1.anderson commentedOh, I think I solved it. Try this:
drush @ilww-home updatedb --token=secretThat should work for you. You must pay me $0.25 to find out why that works. Just kidding. This is a good brainteaser. For some reason, you have the example policy.drush.inc file in a location where drush is including it. This might happen if you had --include=/path/to/drush/examples defined, but per your call to drush_get_merged_options() you do not, so you must have copied policy.drush.inc to $HOME/.drush, or maybe you put your whole drush folder in $HOME/.drush. (Not a good idea!)
I think I deserve my $0.25. :P
Comment #7
greg.1.anderson commentedThe warning in examples/policy.drush.inc was only being printed in --debug mode. (You should follow the issue reporting guidelines.) I committed to HEAD a change to this file to make the warning print out even in lack of -v and -d.
Comment #8
moshe weitzman commented@greg - nice detective work. Unfortunately, we are going to be seeing more of this in the issue queue. It just happenned to me. I got on a shared server that only had drush3 and decided to get a drush4 for myself. Look where it ends up:
I don't think changing drush3 is going to help much since the many folks who are avoiding drush4 will avoid 3.4 as well.
Comment #9
greg.1.anderson commentedAh ha. You are right. I am responsible for drush going to $HOME/.drush as shown above :(. it's fixed now, but this bug will live on for a good time to come; we do need some remediation.
1. For people who update to new code, I suggest skipping the "examples" folder when searching for command files. You can still include the examples explicitly via --include=examples (that is, we skip folders names "examples" inside the search path, but it does not matter if the word "examples" appears in any part of any of the command search paths).
2. For people who are running drush-3.x, or drush-4.0 thru drush-4.2 and type "drush dl drush" to get the latest copy of policy.drush.inc in $HOME/.drush, I suggest further modifying the warning message to point the reader back here.
3. For people running older versions of drush (as above), and drush itself is in $HOME/.drush, there is no fix, because we cannot make any changes (by definition). Therefore, I suggest we add a FAQ about updatedb not running, point the reader to this issue, and further advise that they delete or rename policy.drush.inc in their drush installation's examples folder.
The enclosed patch does #1 and #2; I have not yet done #3.
Comment #10
greg.1.anderson commentedHere is the patch promised in #9.
Comment #11
moshe weitzman commentedAn alternative would be to comment out the code in policy.drushrc.php. Thats why including example.drushrc.php is not hurting us. Seems like a more robust solution.
Comment #12
greg.1.anderson commentedI think #10 is more robust, because it guards against people who have old copies of drush hanging around in $HOME/.drush.
Example sequence of events (executed over a span of time)
Older versions of drush do not back up drush when you dl a new drush, so I think the above may be common.
Regarding disabling the policy, maybe we could also demo an updatedb init hook that set
drush_set_option('token', 'secret');to both re-enable updatedb and show the use of init hooks?Overall, though, I think that we should exclude examples per #10, because there will be other examples showing up there over time, and I think it's too much to always be thinking about how the examples might harm active use of drush when stored in $HOME/.drush...
Comment #13
moshe weitzman commentedMakes sense. Lets commit #10. We might also consider banning /examples when searching for aliases, drushrc, etc.
Comment #14
greg.1.anderson commentedCommitted #10, including excluding examples when searching for aliases. Drush does not search deep for drushrc, so no change there. #12 not done.
Comment #15
greg.1.anderson commentedOh yes, this should be ported too. And maybe after it's committed to 4.x, perhaps it should be ported to 3.x as well...
Comment #16
msonnabaum commentedBackported to 4.x.
Comment #17
greg.1.anderson commentedCool.
Comment #18
techgirlgeek commentedSorry, never was notified of any of the updates to this issue, so just now checking back. Will definitely look into this further tomorrow on my localhost. Thanks for looking into this guys, and sorry I didn't commit the initial bug properly.
Comment #19
techgirlgeek commentedThanks for working and fixing this guys. I just removed the .drush files from my home directory and re-downloaded drush. I'll post, properly next time, if I see the issue again in the future.
Comment #20
moshe weitzman commented3.x is in deep freeze. won't commit there so status is back to fixed.