TransWikia.com

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.

UPDATE #01:

leymanxx:

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:a_somewhat_secret_db_password@localhost/my_project_code_db_dev' 
    --db-su=root --db-su-pw='my_very_secret_root_password' 
    [email protected] 
    --account-name=admin 
    --account-pass=reallysecret 
    --site-name=efc9c26-00497.dev.my_project_code.example.org

 [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:

  [Exception]
  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

leymanxx:

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:a_somewhat_secret_db_password@localhost/my_project_code_db_dev' 
    --db-su=root --db-su-pw='my_very_secret_root_password' 
    [email protected] 
    --account-name=admin 
    --account-pass=reallysecret 
    --site-name=efc9c26-00497.dev.my_project_code.example.org

# drush status
 Drupal version   : 8.9.2

<snip>

 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!

Ask a Question

Get help from others!

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