Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a server with multiple Drupal 6 installs on it. On one of them, I can run drush status just fine. All the rest, I get an unrecoverable error. All sites run fine in a browser.
Is there any documentation on how I can troubleshoot this?
Here's the debug:
$ drush -d status
Bootstrap to phase 0. [0.02 sec, 2.47 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.03 sec, 2.67 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.06 sec, 5.49 MB] [bootstrap]
Initialized Drupal 6.14 root directory at /var/www/example.com/public_html [0.07 sec, 6.27 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.08 sec, 6.28 MB] [bootstrap]
Initialized Drupal site default at sites/default [0.08 sec, 6.28 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.08 sec, 6.28 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.09 sec, 6.32 MB] [bootstrap]
Successfully connected to the Drupal database. [0.09 sec, 6.32 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.09 sec, 6.63 MB] [bootstrap]
Drush command terminated abnormally due to an unrecoverable error. [0.31 sec, 27.72 MB]
Comments
Comment #1
mmilano CreditAttribution: mmilano commentedUpdate: I get the same behavior on 4.x dev and 5.x dev. I've removed all drushrc.php files from the mix in case there was a bad custom config somewhere, but the results are the same.
Comment #2
greg.1.anderson CreditAttribution: greg.1.anderson commentedIs there some module or set of modules that are installed on the sites that don't work that is not installed on the site that does work?
Comment #3
mmilano CreditAttribution: mmilano commentedIt's pretty confusing now.
Server A: Has 4 sites, 1 works with drush, all others get the error when running anything. This one is running PHP 5.3, confirmed same version in the CLI.
Server B: I copied one of the sites that don't work on Server A over, including the DB, and I am able to run drush on that site. This one is running PHP 5.2
Both servers have pdo and mysql pdo installed.
Comment #4
greg.1.anderson CreditAttribution: greg.1.anderson commentedYou could disable modules on the non-working sites on server A until drush started working. Skip the modules that are enabled on the working site on server A. Use a copy of the sites, of course.
Some modules might not work on php 5.3. I recently had to update date and calendar modules on an old site I inherited before it would run on 5.3. Of course, in that instance they didn't work in the browser either, but the same concept may apply.
Comment #5
mmilano CreditAttribution: mmilano commentedWell, I found the offender, but I'm still confused as to why it works on one environment and not the other.
The content of the site is wine based, and we have a cookie check in hook_init(). If they don't have the cookie, it redirects them to the age form that asks them their age and sets the cookie.
The exact line that is causing the problem is the drupal_goto(), which would definitely be getting hit.
Why would drupal_goto() in hook_init() kill drush on PHP 5.3 and not 5.2? The destination of drupal_goto() does not trigger another drupal_goto(). This module is setup with a heavier weight than anything else to make sure it doesn't short out the others.
Is there anything in the bootstrap that I can detect if drush is running, so I can set my age check to let drush through? Adding code to accommodate drush is a last resort, but not out of the question.
Comment #6
brunorios1 CreditAttribution: brunorios1 commentedi'm having the same problem described in #5...
i have a custom module with drupal_goto() in hook_init() and i'm getting a "Drush command terminated abnormally due to an unrecoverable error."
Comment #7
greg.1.anderson CreditAttribution: greg.1.anderson commentedThis is the same issue as #827478: Disable a module ONLY for drush's bootstrap?; unfortunately, the only way to solve the problem is to wrap your call to drupal_goto in your hook init with a check for drush.
Comment #8
brunorios1 CreditAttribution: brunorios1 commentedthanks greg!
Comment #10
sobi3ch CreditAttribution: sobi3ch commentedWith Jenkins job running this
drush @TCS-OpenAtrium_stage -y vset site_offline 1
.. I get same problem again
Drush command terminated abnormally due to an unrecoverable error. [error]
So I found simple solution to check that accually I'm in the CLI mode:
http://stackoverflow.com/a/933375/473390