my brand new default drupal install is throwing this error from drush. when i visit the site with my browser, logged in or not, i get the normal default drupal page, not the site off-line message that it's outputting below...

$ drush update
Refreshing update status information ...
Done.
Update information last refreshed: Mon, 08/17/2009 - 18:54

Update status information on all installed and enabled Drupal modules:
 Name    Installed version  Proposed version  Status     
 Drupal  6.13               6.13              Up to date 

No code updates available.                                                                                                                                                                                         [ok]
Drush command could not be completed.                                                                                                                                                                              [error]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/misc/favicon.ico" type="image/x-icon" />
    <title>Site off-line | Drupal</title>
    <link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?0" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?0" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?0" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/maintenance.css?0" />
<link type="text/css" rel="stylesheet" media="all" href="/themes/garland/style.css?0" />
<link type="text/css" rel="stylesheet" media="all" href="/themes/garland/minnelli/minnelli.css?0" />
<link type="text/css" rel="stylesheet" media="print" href="/themes/garland/print.css?0" />
        <!--[if lt IE 7]>
      <link type="text/css" rel="stylesheet" media="all" href="/themes/garland/fix-ie.css" />    <![endif]-->
  </head>
  <body>

<!-- Layout -->
  <div id="header-region" class="clear-block"></div>

    <div id="wrapper">
    <div id="container" class="clear-block">

      <div id="header">
        <div id="logo-floater">
        <h1><a href="/" title="Drupal"><img src="/themes/garland/minnelli/logo.png" alt="Drupal" id="logo" /><span>Drupal</span></a></h1>        </div>

      </div> <!-- /header -->

      
      <div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
          <h2>Site off-line</h2>                              <div class="clear-block">
            <p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p><hr /><p><small>If you are the maintainer of this site, please check your database settings in the <code>settings.php

file and ensure that your hosting provider's database server is running. For more help, see the handbook, or contact your hosting provider.



An error occurred at function : drush_pm_post_update

Comments

jrefano’s picture

realized debug dump would be more useful. also: default drupal 6.13 install. using MAMP w/ MAMP PRO restored to factory settings.

drush -d update
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.018 sec]                                                                                   [bootstrap]
Initialized Drupal 6.13 root directory at /Users/john/canary/wilma [0.026 sec]                                                                          [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.027 sec]                                                                                   [bootstrap]
Initialized Drupal site default at sites/default [0.027 sec]                                                                                            [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.028 sec]                                                                          [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.033 sec]                                                                               [bootstrap]
Successfully connected to the Drupal database. [0.033 sec]                                                                                           [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.04 sec]                                                                                    [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.137 sec]                                                                                  [bootstrap]
Found command: update [0.138 sec]                                                                                                                    [bootstrap]
Including /Applications/drush/commands/pm/updatecode.inc [0.139 sec]                                                                                 [bootstrap]
Including version specific file : /Applications/drush/commands/pm/update_info/drupal_6.inc [0.14 sec]                                                   [notice]
Refreshing update status information ...
Done.
Update information last refreshed: Mon, 08/17/2009 - 20:38

Update status information on all installed and enabled Drupal modules:
 Name    Installed version  Proposed version  Status     
 Drupal  6.13               6.13              Up to date 

No code updates available. [0.717 sec]                                                                                                               [ok]
Running: php /Applications/drush/drush.php  --root='/Users/john/canary/wilma' --uri='http://default'  'updatedb' --backend [0.754 sec]                 [command]
Drush bootstrap phase : _drush_bootstrap_drush() [0.861 sec]                                                                                         [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.861 sec]                                                                                   [bootstrap]
Initialized Drupal 6.13 root directory at /Users/john/canary/wilma [0.861 sec]                                                                          [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.861 sec]                                                                                   [bootstrap]
Initialized Drupal site default at sites/default [0.861 sec]                                                                                            [notice]
Found command: updatedb [0.861 sec]                                                                                                                  [bootstrap]
Including version specific file : /Applications/drush/commands/core/drupal/update_6.inc [0.861 sec]                                                     [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.861 sec]                                                                          [bootstrap]
PDO support available, but the mysql driver has not been installed. Assuming success. [0.861 sec]                                                    [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.861 sec]                                                                               [bootstrap]
Successfully connected to the Drupal database. [0.861 sec]                                                                                           [bootstrap]
Drush command could not be completed. [0.861 sec]                                                                                                    [error]

[ ... dump of default site-offline page html ... ]

An error occurred at function : drush_pm_post_update [0.862 sec]                                                                                     [error]
Command dispatch complete [0.863 sec]               
jrefano’s picture

I did some digging through the drush code and the script is failing in line 621 of environment.inc:

  drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);

Does that help?

jrefano’s picture

Status: Active » Closed (fixed)

Found the issue, which ended up being a local config thing.

My path needed to be updated so that drush was using the php that comes with MAMP (/Applications/MAMP/bin/php5/bin/php) instead of the one that comes with OSX (/usr/bin/php).

Doh.

ivansf’s picture

It indeed works if I use /usr/bin/php instead of the one that comes with MAMP but then it can't connect to the database.

ivan-sotos-macbook-pro:d6uc ivan$ /usr/bin/php /Developer/drush/drush.php dl admin_menu
PDO::__construct(): [2002] No such file or directory (trying to      [warning]
connect via unix:///tmp/mysql.sock)
SQLSTATE[HY000] [2002] No such file or directory                     [warning]
Project admin_menu (6.x-1.5) downloaded to                           [success]
/Users/ivan/Sites/www/d6uc/sites/all/modules/.
ivan-sotos-macbook-pro:d6uc ivan$ 
xjm’s picture

Category: bug » support

I'm having the same problem as in #4 above.
* Mac OS 10.6
* Apache and PHP recompiled from source to use PHP 5.2.10
* MySQL and so on installed via macports as per http://drewish.com/node/110

My site works fine (no problems with database connectivity); it's just drush commands that fail with this error.

I don't think this is a bug in Drush; it seems like it's probably a missing configuration somewhere, but I am not sure what.

Edit: I opened a new issue for this: #726970: Drush bootstrap problem on OS X 10.6

aangel’s picture

This (crossed-out) issue above has a solution when upgrading to MAMP/MAMP PRO 1.9...drush finds the wrong php.
http://drupal.org/node/726970#comment-2914148