Hi,
after upgrading to Drush-Head, I'm unable to use the stand-alone Drush anymore. This applies for Drupal installations of version 5 and 6 unter Debian GNU/Linux, and FreeBSD. In all environments the module version of Drush was working fine. Before "upgrading" to HEAD, I deleted the directory ./sites/all/modules/drush, but did not disable/uninstall the module (should I have done this?). The error message:
Drush was not able to start (bootstrap) Drupal. [error]
Hint: This error can only occur once the database connection has already been succesfully initiated, therefor this error
generally points to a site configuration issue, and not a problem connecting to the database.
On the shell promt, some very strage outputs appear:
Drush was attempting to connect to :
[...]
Database Name : drupal
Database Name : ...
Database : Connected
Drupal Bootstrap : Successful
[...]
Greetings, -asb
* The field "Database Name" appears twice, in the second appearance it's the database password, not the database name.
* The error says above: "Drush was not able to start (bootstrap) Drupal". The error below says: "Drupal Bootstrap: Successful". Now what?
Comments
Comment #1
adrian commentedIt was setting the bootstrap phase, BEFORE the actual bootstrap was attempted. So that's fixed.
I also fixed the duplicate name of the field.
This is only to make the error message make sense, and doesn't fix the actual issue with it not bootstrapping, so please test again.
Run the command with the '--verbose=2' option, which will give you a lot more context as to what is going wrong.
Unfortunately for us DRUSH_BOOTSTRAP_DRUPAL_FULL is a bit of a black box. It's very tricky to get useful error messages out of that, and all we can do is try to fail gracefully when something goes wrong.
Please let me know once you've debugged further.
Comment #2
asb commentedHi Adrian,
thanks for the quick reply; if things don't work anymore, they tend to show how incredibly useful they are if they work ;)
Drush is called from /var/www/drupal and aliased to /var/www/drupal2/sites/all/modules/drush/drush.php, so the "previously declared..." statement seems to be correct correct; however, the reference to /var/www/drupal/sites/all/modules/drush_extras/pm.drush.inc is irritating since the "drush_extras" module is (was) installed, but is disabled (but not deleted). After deleting the module's folder, Drush started working again on this D6 site.
Calling Drush from /var/www/drupal2 - a D5 site - results in a slightly different behaviour; on this site, "drush_extras" was deleted already. Output:
Same error with --uri http://fqdn or other parameters ("The command 'drush.php http://www.mysite.com watchdog show' could not be executed." etc.)
On another D6 site, Drush partially works better:
But:
On a forth - D5 - site, it goes like this:
Strange, very strange... Either I'm making major mistakes, or the old Drush versions were working a lot better, especially on D5.
Thanks for any hints!
-asb
Comment #3
adrian commentedFirstly :
you have the drush_extras module still hanging around. you need to delete all instances of it.
Secondly :
The 'refresh' command requires the 'update' module to be enabled on the site.
Thirdly :
In the latest HEAD, we changed the update command into 'updatedb', the command that was upgrade was renamed to 'updatecode',
and the plan is to create a 'update' command eventually that does an updatecode and then an updatedb, but this hasn't happened yet.
You should use the 'help' command, which will show you a list of all the commands that you can use in that specific context.
The php memory error you will need to change your php.ini settings to avoid.
Comment #4
mojzis commentedI think the instructions to remove drush_extras should be somewhere (on the project page ?) in bold for a while ...
Comment #5
asb commented> you have the drush_extras module still hanging around. you need to delete all instances of it.
As stated above, after noticing the error regarding drush_extras, I deleted it from all sites. Without exception. "drush_extras" is gone. Really.
> The 'refresh' command requires the 'update' module to be enabled on the site.
What kind of module or extension is this? On drupal.org, there's no "update" module ("No projects found in this category"). At my D5 sites, I've installed and enabled update status and upgrade status modules; in D6, those are in core already, more or less. Or am I missing something?
> In the latest HEAD, we changed the update command into 'updatedb', the command that was upgrade was renamed to 'updatecode'
> You should use the 'help' command, which will show you a list of all the commands that you can use in that specific context.
Good idea since currently this seems to change on a daily basis. With the most recent version from HEAD, there seems to be no equivalent for "upgrade" anymore (that "updatecode" you mentioned above ;)
> The php memory error you will need to change your php.ini settings to avoid.
Maybe, but not probable. The site and /admin/reports/updates are running fine, PHP's memory_limit is "24M" and there are very few modules. Why would PHP-CLI require more memory than the operational website?
Final question: Is Drush currently still a tool for end users (like site admins/sysops), or is it for coders/developers only?
Greetings, -asb
Comment #6
mojzis commentedUpdate :
It is one of the core optional - "update status"
Comment #7
adrian commentedThe update module is for d6, the update_status is used for D5. I don't actually think that command will work as is at present on D5.
> In the latest HEAD, we changed the update command into 'updatedb', the command that was upgrade was renamed to 'updatecode'
You need to have specified both --root and --uri , or be in the site directory of the site you are working on.
if the sites is sites/default you don't need to specify --uri, and you may simply be in the drupal root.
Same as above, the command is only available if you have a site you can call it on available.
Your error message stated :
Some operating systems have separate php.ini files for modphp and php-cli, debian comes to mind.
check the applicable php.ini file.
Drush 2.x is currently being actively developed and is heading for Alpha 2 at present, with an almost complete rewrite in between.
It's still intended as a tool for sysadmin/sysops, and it will function far better for the purpose than it previously has.
Here's a small writeup of SOME of the changes that have happened in the last month : http://groups.drupal.org/node/20625
It's going to get a lot more stable shortly, as the major refactoring work has been completed.
Comment #8
mojzis commentedadrian THANKS for the php.ini hint ! I've been counting my bytes for the last 2 hours :-) I think this should go somewhere into the readme probably ...
Comment #9
asb commented[D5]
> I don't actually think that command will work as is at present on D5.
That explains the problems, if currently drush can't be used to upgrade D5 sites modules anymore (all commands from above were run from each site's root).
Still I don't understand why the previous and working version was unpublished, forcing users to "upgrade" to alpha code that - at least currently - can't functionally fully replace the unpublished (but stable) release version. However, I don't want to waste any more of your time discussing this.
A notice/warning on the project page stating that (a) currently there's no supported and fully functional Drush for D5 sites, and (b) that end-users like site admins/sysops currently shouldn't use Drush-Head since the code is actively developed and thus not ready for production environments would be helpful.
Changing status to "postponed" and hoping that support for D5 will be added soon again.
Thanks & greetings, -asb
Comment #10
adrian commentedTurns out it does work. I tested it myself.
You need to
a) drush.php dl update_status
b) log into the site and enable the update_status module. the enable command is d6 only
c) drush.php refresh
d) drush.php update
Comment #11
asb commentedHi,
downloaded the newly published Alpha2 for D5, uncompressed it in my home directory, pointed alias to the new location, and deleted all "drush" directories from the /sites/all/modules directories. Indeed, this version/configuration behaves differently. I think, running Drush from outside Drupal's module directories seems to be crucial.
* D5 success: 1 site
* D5 failed/errors: 5 sites
* D6 success: 5 sites
* D6 failed/errors: 1 sites
D5 failure #1 (site "ci", running drush from the site's root as user "root"):
D5 failures #2 and #3 (sites "fo", "ec" and several others, each running drush from the site's root):
(identical error with site "ci")
D5 failure #4 (site "em", running drush from the site's root):
As it appears, Drush thinks that no modules are enabled/installed. That is not quite true - on this site we're running quite a bunch of modules (~90, including Drupal core); according to /admin/logs/updates, three of them have Updates available. Something seems to be broken here.
D6 failure #1 (site "ed", running drush from the site's root as user "asb"; that one's on FreeBSD 7.0 thus the different paths):
Greetings, -asb
Comment #12
moshe weitzman commentedThat D6 output has no failures. It just has a lot of notices which we will fix in next alpha. See #435010: PHP NOTICE for a workaround.
Grugnog2 may look into the D5 errors.
Comment #13
asb commentedHi,
don't get me wrong; I love Drush a lot, I like to use it on a regular basis, and I think that the rewrite was a very huge leap in the right direction (providing the groundwork to get something like the maintenance section of Mediawiki into Drupal). The only real complaint I had was the lack of properly updated information, but that has been fixed mostly in the meantime. Thank you very much for the work you're doing on Drush!
That said, I think the issue about Drush-HEAD not being able to bootstrap is fixed (I think it works again since I moved the "Drush" directory out of Drupal's ./modules directory, as stated on the project page); as my last report showed, the failures are now caused by other issues; to summarize shortly:
* 4 of the D5 sites have the "Createfromweb" module installed; this module has been unpublished/revoked. As it seems, Drush can't handle this special case properly (yet). On my D6 sites I have no unpublished/revoked modules running, so I can't tell if this only applies for D5 sites.
* The complete failure of Drush on one of the D5 sites (empty modules list) seems to be an exception; this might be caused by something completely different; however, at the moment only "Drush" operations are affected (I experienced such an empty modules list before on another D5 site, but there ./admin/build/modules was also falsly empty).
* The errors/warnings on the D6 installation on FreeBSD 7.0 might have other causes, also; currently I'm getting a "500 Internal Error" from the webserver (Lighttpd), and other Drush operations don't work at all; I think, using Drush with D6 is pretty safe at the moment, so this seems to be an exception/special case, also.
Maybe it would be best to open new issues for the remaining problems, as far as Drush is afected?
Thanks & greetings, -asb
Comment #14
bramface commentedComment #16
jrdixey commentedI had a very similar problem after updating Drush to All-versions-3.1 (the current recommended version). My intention was to start using it for maintenance and updates instead of Drush 2. This is with a Drupal 6.15 install.
Roughly, this is what I did:
- used Drush 2 to take the site offline using drush eval command
- downloaded and unzipped Drush 3.1 into the /home/drush directory (where I had previously run Drush 2)
Drush 'could not execute', so after a little investigating ...
- downloaded the Console_Table PEAR package and dropped it into home/drush/includes, renamed to table.inc
(as recommended here: http://joachimwillems.be/node/36)
Drush still wouldn't run, so after a bit more investigating ...
- configured drushrc.php to use the correct db, using the example file as a guide, and dropped it into home/drush
(I've not had to do this before, but figured Drush 3 might require it)
- listed all modules into a file (modulelist.txt), then disabled them using the .txt file as input, with Drush 3.1
(this is the way I usually disabled modules with Drush 2)
The drush disable command grumbled that I should have used drush pm-disable, so I re-ran with the correct command:
drush pm-disable `cat modulelist.txt`
Got the following error:
Fatal error: Unsupported operand types in /home/drupal/includes/form.inc on line 517
Drush command could not be completed.
This was displayed at the end of a list of all the modules that Drush reported had been disabled.
At this point I could not re-enabled the modules, take the site out of maintenance mode, or run any other Drush commands; attempting to run Drupal from the browser with ?q=user to force login also produced a bootstrap error (strangely enough, not quite the same one) and a WSOD.
So, I restored from backup files and database. No harm done, but I thought I should submit this error and see if I can find out how to avoid it in future (aside from going back to using Drush 2.x).
I poked around a little bit and found that there is a new syntax available in Drush 3:
drush pm-disable `drush pm-list --pipe --type=module --status=enabled`
Is this the preferred way to do it, rather than using drush pm-list to output the list first and then importing it to drush pm-disable?
BTW if reopening this issue is not the right thing to do, let me know and I'll start a new issue instead.
Comment #17
greg.1.anderson commentedI hope that you removed drush 2, and did not mash the two together...
Generally speaking, you can pm-update your drupal installation without disabling all of your modules first.
I can't tell what might have caused your problem above.
Comment #18
jrdixey commentedHa ha, no, I didn't mash the two together - I changed the name of the "drush" directory to "drush-2", then created a new directory "drush", then unzipped the Drush 3.1 files into it.
Good to have that confirmed, about not having to disable the modules first - it's been a while since I've done a core update but I think I'd already started doing it without disabling modules. Maybe I would have run into this before in Drush 2 if I'd tried that previously, I don't know. (I'll try it today on a test version of the site and see what happens though.)
One other thing I'd forgotten about but found in my notes:
Before I attempted to disable all the modules, I ran drush cache-clear with no arguments. I saw an error related to the fgets command (sorry no further details recorded). Cache-clear all ran with no errors.
Comment #19
greg.1.anderson commentedYour error message in #16 is a drupal message, not a drush message; could be that you're having trouble with a drupal module.
Comment #20
jrdixey commentedYes, it's a Drupal error. What I was wondering was whether the pm-disable process in Drush might have modified the Drupal code (bootstrap) in such a way that it could have caused the error message. I do have a lot of modules though, so disabling them one by one for the upgrade (or not disabling them at all) might be a good idea.
Comment #21
greg.1.anderson commentedI've upgraded drupal 6.5 or so to 6.17 without disabling modules, and I've upgraded 6.15 to 6.17 with drush without any problems.
There is one example I can think of where the drush bootstrap is different than the browser bootstrap is that the browser will always set the base url correctly, whereas drush will set the uri to whatever the --uri (or -l) parameter is. If you're using site aliases, the uri passed to drush must be the name of the folder that contains settings.php (e.g. 'default'), which can cause problems with some modules. Try
drush -r /path/to/root -l http://youruri.com pmdisable modulenameand see if this works better thandrush -r /path/to/root -l default pm-disable modulenameif there is a difference in your configuration. Doing this one module at a time would help isolate the problem.Comment #22
jrdixey commentedHi Greg, Sorry for the delay in answering this - I moved back to Drush 2 and did the security updates without disabling modules. But I will try this again with Drush 3 when I get a chance. Feel free to close this if you want to.
Comment #23
owen barton commentedThis looks like some kind of broken module dependency perhaps, but there is not much we can do without a way to reproduce it reliably. If you can simplify the issue to a concise set of steps please reopen and we can take a look.
Comment #24
sheldonkreger commentedI am running XAMPP on Ubuntu to build a Drupal 7.12 site locally.
"drush dl example" worked after I changed some file permissions to allow writing and execution. However, "drush en example" did not work.
The solution is to visit your site's "settings.php" file and make the following changes:
OLD CODE (Line 203 for me):
NEW CODE:
In short, I changed the value of 'host' to 127.0.01 rather than "localhost". Great victory.
Comment #25
bis20 commentedAFTER 1 Day Confusing:
Just change "sqli" to "sql" (if mysql supported) in settings.php.
this solve my problem. :)
Comment #26
Screenack commentedFYI for those researching their problem #24 threw me a bone.
My settings.php file is using conditional logic based on this statement:
switch($_SERVER['SERVER_NAME'])wherein matching db connection string statements will load. However, drush doesn't parse settings.php in this manner so I had to populate the default switch with the correct database. Problem solved.