4

I have Drupal 8.8.1 and Drush 10.1.1, both installed with Composer.

I'm running the following to update my site DB:

$ drush updb

In BootstrapHook.php line 32:

  Bootstrap failed. Run your command with -vvv for more information.  

As it suggests I run with the -vvv flag to get more information:

$ drush updb -vvv
Begin redispatch via drush_invoke_process().                                                                               [notice]
Calling proc_open(env COLUMNS=131 /var/www/drupal/drupal-8.8.1/vendor/drush/drush/drush  --root=/var/www/drupal/drupal-8.8.1 --verbose  updatedb 2>&1);

In BootstrapHook.php line 32:

  [Exception]                                                         
  Bootstrap failed. Run your command with -vvv for more information.  


Exception trace:
  at /var/www/drupal/drupal-8.8.1/vendor/drush/drush/src/Boot/BootstrapHook.php:32
 Drush\Boot\BootstrapHook->initialize() at /var/www/drupal/drupal-8.8.1/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:34
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook() at /var/www/drupal/drupal-8.8.1/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:27
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at /var/www/drupal/drupal-8.8.1/vendor/consolidation/annotated-command/src/CommandProcessor.php:145
 Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at /var/www/drupal/drupal-8.8.1/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:289
 Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at /var/www/drupal/drupal-8.8.1/vendor/symfony/console/Command/Command.php:221
 Symfony\Component\Console\Command\Command->run() at /var/www/drupal/drupal-8.8.1/vendor/symfony/console/Application.php:1000
 Symfony\Component\Console\Application->doRunCommand() at /var/www/drupal/drupal-8.8.1/vendor/symfony/console/Application.php:255
 Symfony\Component\Console\Application->doRun() at /var/www/drupal/drupal-8.8.1/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /var/www/drupal/drupal-8.8.1/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /var/www/drupal/drupal-8.8.1/vendor/drush/drush/src/Runtime/Runtime.php:49
 Drush\Runtime\Runtime->run() at /var/www/drupal/drupal-8.8.1/vendor/drush/drush/drush.php:72
 require() at /var/www/drupal/drupal-8.8.1/vendor/drush/drush/drush:4

$ drush status
 Drupal version : 8.8.1                                                     
 Site URI       : http://default                                            
 PHP binary     : /opt/remi/php72/root/usr/bin/php                          
 PHP config     : /etc/opt/remi/php72/php.ini                               
 PHP OS         : Linux                                                     
 Drush script   : /var/www/drupal/drupal-8.8.1/vendor/drush/drush/drush     
 Drush version  : 10.1.1                                                    
 Drush temp     : /tmp                                                      
 Drush configs  : /var/www/drupal/drupal-8.8.1/vendor/drush/drush/drush.yml 
 Drupal root    : /var/www/drupal/drupal-8.8.1                              
 Site path      : sites/default       

Can anyone advise on how to resolve this?

3
  • it seems as though drush can't connect to the database, are you running inside the drupal installation root folder ? Check that the database connectivity is OK.
    – GiorgosK
    Dec 27, 2019 at 17:05
  • Cheers @GiorgosK, I was running it from the directory containing my settings.php file, which in previous versions would run for that site, but doesn't seem to any more. Dec 28, 2019 at 15:08

3 Answers 3

1

Delete drush from vendor directory

Go to DRUPAL_ROOT:

rm -Rf vendor/drush # in case of Linux system

composer install # Will reinstall requisite drush verion from composer.lock file

It worked for me as well as building again detects the site_path to connect database properly

can refer as well Bootstrap failing with Drush 9.1.0

2
  • This solution helped me, the only difference is that I had to make a : rm -Rf vendor/ instead of just deleting drush
    – romain ni
    Oct 28, 2020 at 15:42
  • Man you just saved my life, this totally worked for me!!
    – DarkteK
    Oct 14, 2022 at 20:55
1

The clue is in the "status" message, which shows the site path is sites/default. In previous versions of Drush, I was able to just change the current directory to the directory containing the settings.php file and Drush would detect the site. Drush 9/10 seems to require I specify it.

Running drush updb --uri=http:example.com from the DRUPAL_ROOT/web directory worked perfectly.

0

I have the error while deploying to server

In BootstrapHook.php line 32:
                                                                     
Bootstrap failed. Run your command with -vvv for more information. 

After run drush -vvv I saw an error connected with wrong credentials to DB.
So it can be caused also by wrong credentials/.env file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.