Hi there:

I'm trying to run Drush for speeding the migration of a lot of records and I'm getting these errors:

$ drush migrate status
Cannot set variable `max_execution_time` to `60` in your PHP configuration!Probably you do not have proper privileges.                                [error]
Command migrate status needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this       [error]
command.
The command 'drush.php migrate status' could not be executed.

The same with any other command I've tried, except drush -d status that comes up with:


Found command: status [0.044 sec]                                                                                                                     [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.045 sec]                                                                                    [bootstrap]
Initialized Drupal 6.14 root directory at /var/www/siteroot [0.063 sec]                                                                                 [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.063 sec]                                                                                    [bootstrap]
Initialized Drupal site default at sites/default [0.099 sec]                                                                                             [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.114 sec]                                                                           [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.118 sec]                                                                                [bootstrap]
Successfully connected to the Drupal database. [0.118 sec]                                                                                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.125 sec]                                                                                    [bootstrap]
Cannot set variable `max_execution_time` to `60` in your PHP configuration!Probably you do not have proper privileges. [0.363 sec]                    [error]
Including non-version specific file : /home/ari/drush/commands/core/drupal/environment.inc [0.363 sec]                                                   [notice]
  PHP configuration : /etc/php5/cli/php.ini
  Drupal Root       : /var/www/siteroot
  Drupal version    : 6.14
  Site Path         : sites/default
  Site URI          : http://default
  Database Driver   : mysql
  Database Hostname : localhost
  Database Username : root
  Database Name     : db_name
  Database Password : db_pass
  Database          : Connected
  Drupal Bootstrap  : Successful
  Drupal User       : Anonymous
An error occurred at function : drush_core_status [0.503 sec]                                                                                         [error]
Command dispatch complete [0.503 sec]                                                                                                                    [notice]
Timer 'page' is  0.389 sec. [0.504 sec]  

The PHP error continues showing, although /etc/php5/cli/php.ini has:

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 60     ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
memory_limit = 228M      ; Maximum amount of memory a script may consume (16MB)

Thanks for your help.

Comments

ari-meetai’s picture

anyone?

ari-meetai’s picture

can't find an answer to this as of yet.

moshe weitzman’s picture

Status: Active » Closed (fixed)

not really a drush issue AFAICT. we don't mess with max_execution_time since it has no effect on CLI PHP

rezha’s picture

Did someone solve this?

jhedstrom’s picture

I just ran into this on a site where the drupal_tweaks module was enabled. I didn't have time to debug that module, but disabling it made the issue go away. It has something to do with that module calling ini_set with empty parameters, or parameters that can't be changed at runtime from php-cli.

webthingee’s picture

Component: Code » PM (dl, en, up ...)

I have found that on a site with any multi-sites (i.e. I run domain.com, and domain.l to keep seperate db's for development). I have had to use the commands for drupal as such:

drush up panels --uri=http://domain.l
freephile’s picture

I've run into this same problem but haven't solved it. The only command I can run is 'status' which seems to ignore the error in drush_core_status as it executes the _drush_bootstrap_drupal_full()

drush -d -l dev.beangroup.com sm
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.05 sec, 2.36 MB] [bootstrap]
Initialized Drupal 6.19 root directory at /var/www/drupal [0.06 sec, 3.01 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.07 sec, 3.01 MB] [bootstrap]
Initialized Drupal site dev.beangroup.com at sites/dev.beangroup.com [0.18 sec, 3.42 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.2 sec, 3.71 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.24 sec, 4.06 MB] [bootstrap]
Successfully connected to the Drupal database. [0.24 sec, 4.06 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.25 sec, 4.07 MB] [bootstrap]
: in (line of ). [0.32 sec, 8.3 MB] [error]
Command pm-list needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this command. [0.32 sec, 8.3 MB] [error]
The drush command 'sm' could not be executed. [0.32 sec, 8.3 MB] [error]

grundlett@WS02:/var/www/drupal$ drush -d -l dev.beangroup.com status
Found command: core-status (commandfile=core) [0.05 sec, 2.36 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.05 sec, 2.37 MB] [bootstrap]
Initialized Drupal 6.19 root directory at /var/www/drupal [0.06 sec, 3.02 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.06 sec, 3.02 MB] [bootstrap]
Initialized Drupal site dev.beangroup.com at sites/dev.beangroup.com [0.18 sec, 3.44 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.18 sec, 3.44 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.19 sec, 3.79 MB] [bootstrap]
Successfully connected to the Drupal database. [0.19 sec, 3.79 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.19 sec, 3.79 MB] [bootstrap]
: in (line of ). [0.28 sec, 8.03 MB] [error]
Drupal version : 6.19
Site URI : dev.beangroup.com
Database driver : mysqli
Database hostname : 127.0.0.1
Database username : XXXXXX < redacted
Database name : XXXXXX < redacted
Database : Connected
Drupal bootstrap : Successful
Drupal user : Anonymous
Default theme : garland
Administration theme : minnelli
PHP configuration : /etc/php5/cli/php.ini
Drush version : 3.3
Drush configuration : /etc/drush/drushrc.php
Drupal root : /var/www/drupal
Site path : sites/dev.beangroup.com
File directory path : sites/beangroup.com/files

An error occurred at function : drush_core_status [0.28 sec, 8.02 MB] [error]
Command dispatch complete [0.28 sec, 8.01 MB] [notice]
Timer Cum (sec) Count Avg (msec)
page 0.105 1 104.82

Peak memory usage was 8.09 MB [0.28 sec, 8.01 MB] [memory]

NickWebman’s picture

ummm... I got this problem when I was in the home directory instead of the whatever.com directory.

Lame, yes, but perhaps this helps another person searching for the same issue...

aangel’s picture

Not likely to be drush...turning off Drupal Tweaks made my occurrence of this error go away.

brycesenz’s picture

I faced the same problem, and turning off Drupal Tweaks solved my issue as well.

sphism’s picture

--user=1

might help

wizonesolutions’s picture

Drupal Tweaks was the issue for me as well. Is the module still maintained? It should be reported as an issue there. I'll check...

tribsel’s picture

i have this problem too and dont use drupal tweaks.

montchr’s picture

I'm also having this problem and I don't use Drupal Tweaks either.

I'm able to run a dl command fine but it seems like anything else gives me this message.

mattez’s picture

Version: All-Versions-2.1 »
Component: PM (dl, en, up ...) » Miscellaneous

Loot at this disq: #1011932: Support unix_socket in D7 $databases var in settings.php
Comment #6 try 2) worked form me.
I changed DB setup in settings.php from 'localhost' to its IP '127.0.0.1'

leer’s picture

On Windows 7, running the command from the sites\default directory (per Comment #8), rather than the Drush directory, worked for me.

joachim’s picture

Title: "Command [name] needs a higher bootstrap level to run" problem » MAMP 2: mysql socket not found, errors "Command [name] needs a higher bootstrap level to run"
Component: Miscellaneous » Base system (internal API)
Category: support » bug
Status: Closed (fixed) » Active

> I changed DB setup in settings.php from 'localhost' to its IP '127.0.0.1'

Made no change for me.

> running the command from the sites\default directory

Made no change for me.

I have started seeing this error since I upgraded MAMP to 2.0.5, and hence am now running my localhost sites on PHP 5.3 rather than 5.2.

I've chased the problem as far as drush_valid_db_credentials().
Removing the @ in front of the call to mysqli_real_connect() in drush_valid_db_credentials() shows me this:

mysqli_real_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)             [warning]
environment.inc:418 [0.07 sec, 9.27 MB]
mysqli_real_connect(): (HY000/2002): No such file or directory environment.inc:418 [0.07 sec, 9.27 MB]                   [warning]
No such file or directory [0.07 sec, 9.27 MB]                                                                            [bootstrap]

A workaround is to do this:

$ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock

but shouldn't mysqli stuff be able to find the socket? Drupal running in the browser seems to connect ok.

e0ipso’s picture

This worked form me.

A workaround is to do this:

$ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock

Thanks!

ByteSlinger’s picture

I'm not using MAMP, but Acquia Drupal Dev Desktop. I had the "needs a higher bootstrap level" error and changing localhost to 127.0.01 in my settings.php file solved the problem. Thanks mattez!

lanquarem’s picture

I had the same problem with Mamp on MacOS.

It came from the MAMP preferences : by default, the ports for MySQL and Apache in MAMP are 8888 and 8889 .

I selected the "default ports" option (80 for Apache and 3306 for MySQL) and Drush now works perfectly : no more bootstrap level error message.

Kjartan’s picture

Status: Active » Closed (duplicate)

#437642: support for different MYSQL socket added support for unix_socket, so if you have it setup correctly in your sites settings.php it should work properly.

The actual issue here is a misconfiguration in mysql and/or php, usually as a result of the website using one php config while php-cli uses another. If you modify settings.php and add a unix_socket to the database configuration you can force Drupal and Drush to use the same socket.

Danny Englander’s picture

I spent days trying to find a fix for this issue so I am glad I found this finally. #18 is great but just in case the directory does not exist in the first place, i also did this command first:

sudo mkdir /var/mysql

So the final commands in order would be:

 sudo mkdir /var/mysql
 sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
tomgf’s picture

Trying to tackle a similar problem I have found out that drush was using a php.ini (~/.drush/php.ini) that was not including the proper PDO drivers:

PDO support => enabled
PDO drivers => sqlite, sqlite2

Comparing it with the php.ini from MAMP, I noticed that there were some missing directives, particularly these:

extension_dir = "/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/"
[…]
extension=pdo_mysql.so

Adding these directives to my ~/.drush/php.ini solved the problem and now drush runs without inconveniences on my MAMP environment:

PDO support => enabled
PDO drivers => sqlite, sqlite2, pgsql, mysql
PDO Driver for MySQL => enabled

Note: I found out this problem running drush -d|--debug, that provides extra information.

1richards’s picture

#15 fixed this for me. Took too darn long to find this... Thanks!