I had 5.4 installed and working fine, and decided to upgrade to 5.7 and try out the aliases function. Somewhere along the way I must have messed something up because drush no longer works at all with any of my sites. The update command (no aliases) gets me:

drush -l http://modctek.com up --debug
Bootstrap to phase 0. [0 sec, 2.12 MB]                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 2.24 MB] [bootstrap]
Cache HIT cid: 5.7-commandfiles-0-ae182eb16c90439de29a6f36c42c20b3       [debug]
[0.01 sec, 2.25 MB]
Bootstrap to phase 0. [0.05 sec, 4.74 MB]                            [bootstrap]
Bootstrap to phase 6. [0.07 sec, 4.74 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.07 sec,    [bootstrap]
4.74 MB]
Initialized Drupal 7.15 root directory at                               [notice]
/home/PRIVATE/public_html/drupal-7 [0.1 sec, 6.56 MB]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.1 sec, 6.56[bootstrap]
MB]
Initialized Drupal site modctek.com at sites/modctek.com [0.1 sec,      [notice]
6.57 MB]
Cache HIT cid: 5.7-commandfiles-2-da7ade5aa11056b00ff2362fdf228073       [debug]
[0.1 sec, 6.57 MB]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.1 [bootstrap]
sec, 6.57 MB]
PDO support is required. [0.11 sec, 6.57 MB]                         [bootstrap]
Bootstrap to phase 5. [0.11 sec, 6.57 MB]                            [bootstrap]
Command pm-update needs a higher bootstrap level to run - you will   [error]
need to invoke drush from a more functional Drupal environment to run
this command. [0.11 sec, 6.57 MB]
Command pm-update needs the following modules installed/enabled to   [error]
run: update. [0.11 sec, 6.58 MB]
The drush command 'up' could not be executed. [0.11 sec, 6.58 MB]    [error]
Drush was not able to start (bootstrap) the Drupal database.         [error]
Hint: This may occur when Drush is trying to:
 * bootstrap a site that has not been installed or does not have a
configured database. In this case you can select another site with a
working database setup by specifying the URI to use with the --uri
parameter on the command line. See `drush topic docs-aliases` for
details.
 * connect the database through a socket. The socket file may be
wrong or the php-cli may have no access to it in a jailed shell. See
http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:
  Drupal version    : 7.15
  Site URI          : http://modctek.com
  Database driver   : mysql
  Database hostname : 127.0.0.1
  Database username : PRIVATE
  Database name     : PRIVATE
  Default theme     : garland
  Administration theme: garland
  PHP configuration : /usr/local/lib/php.ini
/home/PRIVATE/.drush/drush.ini
  Drush version     : 5.7
  Drush configuration:
  Drush alias files : /home/PRIVATE/.drush/aliases.drushrc.php
  Drupal root       : /home/PRIVATE/public_html/drupal-7
  Site path         : sites/modctek.com
  Modules path      : sites/all/modules
  Themes path       : sites/modctek.com/themes
  File directory path: sites/modctek.com/files
  %paths            : Array

 [0.11 sec, 6.58 MB]

I've tried changing the hostname to "localhost" (same results) though I remember having to change to 127.0.0.1 to get the previous drush install working properly. I know I'm forgetting/missing something. Is this the command-line PHP not being able to access mySQL?

Comments

modctek’s picture

This actually ended up being a combination of several things, but I got the most hints from #1664682: Inmotion Hosting VPS - Memory errors, PDO extensions - Help Configuring. My provider had updated PHP from 5.2 to 5.3, so my bashrc file was pointing at the wrong php and drush wasn't using the proper ini file. Once I got those items cleaned up, it worked like a charm.

modctek’s picture

Status: Active » Closed (fixed)
modctek’s picture

Status: Closed (fixed) » Active

Seems I spoke too soon.

Command batch-process needs a higher bootstrap level to run - you    [error]
will need to invoke drush from a more functional Drupal environment
to run this command. [1.79 sec, 28.25 MB]
The drush command 'batch-process 57 57' could not be executed. [1.79 [error]
sec, 28.25 MB]
Drush was not able to start (bootstrap) the Drupal database.         [error]
Hint: This may occur when Drush is trying to:

The error about "batch-process ## ##" is new. I don't remember seeing that error coming up before. The reason I thought it was fixed was that the "up" command was actually running through the modules, but just showing the status as "unknown" for all of them.

modctek’s picture

OK, this is driving me bananas:

drush @mysite up

gives me the above error "batch-process ## ##" on some of my sites (in the same D7 multi-site codebase) and not on others. I can't see any difference between the two, both use "127.0.0.1" as the hostname.

drush @mysite cache-clear

works just fine, which means drush has no problem getting to the database.

Also, I was able to use the rsync and sql-sync commands with aliases to copy an entire site.

What the heck is going on here?

greg.1.anderson’s picture

Status: Active » Postponed (maintainer needs more info)

Drush can't call drush in your setup (the commands that are failing all involve a callback from Drush back into Drush). Maybe drush is not in your $path, or maybe you have aliased drush to php drush.php as recommended back in the Drush-3 days. Don't do that any more; always use the drush script.

wuinfo - bill wu’s picture

Had same error when had both PHP 5.3.3 and PHP 5.4 PHP CLI in path, Take out one PHP from path solved this problem.

greg.1.anderson’s picture

Version: 7.x-5.7 » 8.x-6.x-dev
Status: Postponed (maintainer needs more info) » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If you still need help, please ask your question again on Drupal Answers and then post a link here to the new question. Please also change the status of this issue to closed (duplicate).

Use our Github project for contributing code, or reporting bugs, or requesting features.