0

I have an Ubuntu 18.04 server where I have one Drupal 8 and two Drupal 7 sites. I have installed drush 8.4.5 which works great for the Drupal 8 site but on the 7 ones it can't bootstrap.

After some googling I found that a very common reason for this is when the mysql command is not in the PATH, but this is not the case here, in fact all db commands like drush sqlc work fine.

Here is the output when I run drush status -d

Cache HIT cid: 8.4.5-commandfiles-0-a3cd8cb920bcde827cc232180c6d7f26 [0.01 sec, 3.07 MB]                                                                                                             [debug]
Loaded alias @widgets from file /home/user/.drush/lsv.aliases.drushrc.php [0.07 sec, 8.05 MB]                                                                                                    [notice]
Cache SET cid: 8.4.5-alias-path--043cb3d69eb478aa2b3e38377546b6de [0.07 sec, 8.05 MB]                                                                                                                [debug]
Bootstrap to phase 0. [0.07 sec, 8.06 MB]                                                                                                                                                        [bootstrap]
Trying to bootstrap as far as we can. [0.07 sec, 8.07 MB]                                                                                                                                            [debug]
Drush bootstrap phase : bootstrap_drupal_root() [0.08 sec, 8.42 MB]                                                                                                                              [bootstrap]
Initialized Drupal 7.59 root directory at /var/www/html/widgets [0.08 sec, 8.42 MB]                                                                                                              [bootstrap]
Find command files for phase 1 (max=7) [0.08 sec, 6.93 MB]                                                                                                                                           [debug]
Cache HIT cid: 8.4.5-commandfiles-1-5c1ee58258b6846d7827dff1da4d928c [0.08 sec, 6.93 MB]                                                                                                             [debug]
Cache HIT cid: 8.4.5-annotationfiles-1-47d8cbe4e8ce28c2c1c5b0f779e97f8a [0.08 sec, 6.93 MB]                                                                                                          [debug]
Drush bootstrap phase : bootstrap_drupal_site() [0.08 sec, 6.94 MB]                                                                                                                              [bootstrap]
Initialized Drupal site widgets.bb at sites/default [0.08 sec, 6.94 MB]                                                                                                                          [bootstrap]
Find command files for phase 2 (max=7) [0.09 sec, 6.94 MB]                                                                                                                                           [debug]
Drush bootstrap phase : bootstrap_drupal_configuration() [0.09 sec, 6.94 MB]                                                                                                                     [bootstrap]
Find command files for phase 3 (max=7) [0.09 sec, 6.96 MB]                                                                                                                                           [debug]
sql-query: SELECT 1; [0.09 sec, 7.02 MB]                                                                                                                                                            [notice]
Executing: mysql --defaults-extra-file=/tmp/drush_teStTK --database=widgets --host=127.0.0.1 --silent  < /tmp/drush_79ibgU
  1
sql-query: SHOW TABLES; [0.1 sec, 7.02 MB]                                                                                                                                                          [notice]
Executing: mysql --defaults-extra-file=/tmp/drush_Rwkses --database=widgets --host=127.0.0.1 --silent  < /tmp/drush_VA3WyB
  actions
  authmap
  [...remaining site db tables]
Bootstrap phase bootstrap_drupal_database() failed to validate; continuing at bootstrap_drupal_configuration(). [0.12 sec, 7.05 MB]                                                                  [debug]
Found command: core-status (commandfile=core) [0.12 sec, 7.05 MB]                                                                                                                                [bootstrap]
Loading outputformat engine. [0.14 sec, 8.55 MB]                                                                                                                                                    [notice]
Calling hook drush_core_status [0.15 sec, 8.81 MB]                                                                                                                                                   [debug]
Returned from hook drush_core_status [0.15 sec, 8.82 MB]                                                                                                                                             [debug]
 Drupal version         :  7.59
 Site URI               :  mysite.com
 Database driver        :  mysql                                                       
 Database hostname      :  127.0.0.1                                                   
 Database port          :                                                              
 Database username      :  dbuser
 Database name          :  dbname
 PHP executable         :  /usr/bin/php                                                
 PHP configuration      :  /etc/php/7.2/cli/php.ini                                    
 PHP OS                 :  Linux                                                       
 Drush script           :  /home/user/.config/composer/vendor/drush/drush/drush.php 
 Drush version          :  8.4.5                                                       
 Drush temp directory   :  /tmp                                                        
 Drush configuration    :                                                              
 Drush alias files      :  /home/user/.drush/mysite.aliases.drushrc.php                
 Drupal root            :  /var/www/html/mysite                                       
 Drupal Settings File   :  sites/default/settings.php                                  
 Site path              :  sites/default                                               

Command dispatch complete [0.15 sec, 8.86 MB]                                                                                                                                                       [notice]
 Timer  Cum (sec)  Count  Avg (msec) 
 page   0.067      1      66.81

As you can see I've already tried using a drush alias (no special configuration there) but without changing anything.

  • Did you do the One Drush for all projects installation? – No Sssweat Oct 7 at 4:34
  • Is the site is hosted on Acquia ? If yes try to run drush from docroot older not from the folder above it. – miststudent2011 Oct 7 at 7:39
  • @NoSssweat yes, I installed drush 8.4.5 globally using composer (also tried with 7). It works great for Drupal 8 projects just not for the 7 ones. – Thomas Pappas Oct 7 at 15:19
  • @miststudent2011 no it's not on Acquia, it's on an Ubuntu 18.04 server, in general I've tried running it from the project root, the "sites/default" folder, as well as using an alias, all still having the same behavior – Thomas Pappas Oct 7 at 15:21
  • I'd check if there's any logic on settings.php that could be interfering or any files included/required from there – rovr138 Oct 10 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.