Exception: In BootstrapHook.php line 32, how can I consistently resolve this?

Drupal Answers Asked by Hugh Esco on November 17, 2021

My build process is (mostly working), but sometimes when I swap out to a new project, I am winding up with an error which looks like the output below. I have found this error message extremely unhelpful in sorting out what my underlying issue might be. And having resolved this issue in the past, and folded it into my build process, does not seem to have resolved it for all future builds of similar projects. I am seeking advice on how to proceed here, would appreciate any help I can get, please. Thanks.



Switching out to use the local drush ( sudo -u jenkins vendor/drush/drush/drush site-install . . . ) does not appear to have changed the outcome.

Is your site managed with Composer? Yes. What template? no site template, just a composer.json file derived originally from drupal-composer/drupal-project. What version of Drush? Drush Commandline Tool 9.7.2 What version of Drupal? composer.json specifies: "drupal/core": "~8.8.5",.

— Hugh Esco

# sudo -u jenkins /usr/local/drush/drush site-install 
    -y -vvv 
    --db-url='mysql://my_project_code_db_user_dev:[email protected]/my_project_code_db_dev' 
    --db-su=root --db-su-pw='my_very_secret_root_password' 
    [email protected] 

 [preflight] Config paths: /opt/local/my_project_code/drupal/vendor/drush/drush/drush.yml,/opt/local/my_project_code/drupal/drush/drush.yml
 [preflight] Alias paths: /opt/local/my_project_code/drupal/web/drush/sites,/opt/local/my_project_code/drupal/drush/sites
 [preflight] Commandfile search paths: /opt/local/my_project_code/drupal/vendor/drush/drush/src,/opt/local/my_project_code/drupal/drush
 [bootstrap] Starting bootstrap to root [0.12 sec, 8.69 MB]

In BootstrapHook.php line 32:

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

Exception trace:
  at /opt/local/my_project_code/drupal/vendor/drush/drush/src/Boot/BootstrapHook.php:32

 DrushBootBootstrapHook->initialize() at /opt/local/my_project_code/drupal/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:34

 ConsolidationAnnotatedCommandHooksDispatchersInitializeHookDispatcher->callInitializeHook() at /opt/local/my_project_code/drupal/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:27

 ConsolidationAnnotatedCommandHooksDispatchersInitializeHookDispatcher->initialize() at /opt/local/my_project_code/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php:145

 ConsolidationAnnotatedCommandCommandProcessor->initializeHook() at /opt/local/my_project_code/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:289

 ConsolidationAnnotatedCommandAnnotatedCommand->initialize() at /opt/local/my_project_code/drupal/vendor/symfony/console/Command/Command.php:221

 SymfonyComponentConsoleCommandCommand->run() at /opt/local/my_project_code/drupal/vendor/symfony/console/Application.php:1005

 SymfonyComponentConsoleApplication->doRunCommand() at /opt/local/my_project_code/drupal/vendor/symfony/console/Application.php:255

 SymfonyComponentConsoleApplication->doRun() at /opt/local/my_project_code/drupal/vendor/symfony/console/Application.php:148

 SymfonyComponentConsoleApplication->run() at /opt/local/my_project_code/drupal/vendor/drush/drush/src/Runtime/Runtime.php:118

 DrushRuntimeRuntime->doRun() at /opt/local/my_project_code/drupal/vendor/drush/drush/src/Runtime/Runtime.php:49

 DrushRuntimeRuntime->run() at /opt/local/my_project_code/drupal/vendor/drush/drush/drush.php:72

 require() at /opt/local/my_project_code/drupal/vendor/drush/drush/drush:4

site:install [--db-url DB-URL] [--db-prefix DB-PREFIX] 
[--db-su DB-SU] [--db-su-pw DB-SU-PW] 
[--account-name [ACCOUNT-NAME]] [--account-mail [ACCOUNT-MAIL]] 
[--site-mail [SITE-MAIL]] [--account-pass ACCOUNT-PASS] 
[--locale [LOCALE]] [--site-name [SITE-NAME]] 
[--site-pass SITE-PASS] [--sites-subdir SITES-SUBDIR] 
[--config-dir CONFIG-DIR] [--existing-config] [-h|--help] 
[-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] 
[--no-ansi] [-n|--no-interaction] [-d|--debug] 
[-y|--yes] [--no] 
[--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] 
[-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] 
[-D|--define DEFINE] [--notify] [--xh-link XH-LINK] 
[--druplicon] [--] <command> [<profile>]...

One Answer


Thank you friend for your questions. They led me to update the version spec for drupal/core (and drupal/core-dev) in my composer.json to read "^8.8" instead. After that I was able to run:

# rm -rf vendor/ web/

# composer update 

# sudo -u jenkins /usr/local/drush/drush site-install 
    -y -vvv 
    --db-url='mysql://my_project_code_db_user_dev:[email protected]/my_project_code_db_dev' 
    --db-su=root --db-su-pw='my_very_secret_root_password' 
    [email protected] 

# drush status
 Drupal version   : 8.9.2


 Database         : Connected
 Drupal bootstrap : Successful

and to produce a working base installation of drupal! Updating that in my code and running this again through my build process to see if it flies. Thanks for prodding me with that question.

Answered by Hugh Esco on November 17, 2021

Add your own answers!

Related Questions

Node is not created, but nid is returned

2  Asked on December 26, 2021 by ziobudda


EntityDrupalWrapper->value() causes infinite recursion on user login?

1  Asked on December 24, 2021 by tigertrussell


Feed import breaks due to ajax error

1  Asked on December 24, 2021 by kenpeter


Multi site Image cache issue

0  Asked on December 24, 2021 by user99683


How to make relationships between users

1  Asked on December 22, 2021


Need CKEditor to encode special characters

1  Asked on December 22, 2021 by bemarlan


Checkboxes in a simple form are not displayed

1  Asked on December 22, 2021 by sebish


How to change scheduler date format in *_node_form

1  Asked on December 21, 2021 by oskar-calvo


hiding taxonomy terms on term page

1  Asked on December 21, 2021 by user3027413


TypeError on “drush config-export”

1  Asked on December 21, 2021


“Broken pipe” between Nginx and PHP-FPM

1  Asked on December 21, 2021 by stephen-winnall


Restrict delete operation on a node referenced by another node

2  Asked on December 19, 2021 by user48552


How to perform views date calculations using global math?

2  Asked on December 19, 2021 by tinohuda


Get menu link siblings

4  Asked on December 19, 2021 by erin-mclaughlin


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP