3

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

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

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

 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at /opt/local/my_project_code/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php:145

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

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

 Symfony\Component\Console\Command\Command->run() at /opt/local/my_project_code/drupal/vendor/symfony/console/Application.php:1005

 Symfony\Component\Console\Application->doRunCommand() at /opt/local/my_project_code/drupal/vendor/symfony/console/Application.php:255

 Symfony\Component\Console\Application->doRun() at /opt/local/my_project_code/drupal/vendor/symfony/console/Application.php:148

 Symfony\Component\Console\Application->run() at /opt/local/my_project_code/drupal/vendor/drush/drush/src/Runtime/Runtime.php:118

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

 Drush\Runtime\Runtime->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>]...

2
  • Looks as if you are using a globally installed Drush while Drush only supports one install method. It requires that your Drupal site be built with Composer and Drush be listed as a dependency. Is your site managed with Composer? What template? What version of Drush? What version of Drupal?
    – leymannx
    Commented Jul 22, 2020 at 5:52
  • Ah, vendor I see. Ah, is this the Drush Launcher at /usr/local/drush? What happens when you use the local Drush directly? /opt/local/my_project_code/drupal/vendor/drush/drush/drush si -y. Please update your question for clarification.
    – leymannx
    Commented Jul 22, 2020 at 5:56

2 Answers 2

2

To people who end up here from July 2022

Composer changed its default behaviour when running in non-interactive mode and that will result in plugins not being installed.

That will result in the error on line 32 of bootstrap.php

To resolve this quickly you can manually run a composer install and approve all of the plugins.

To fix the build process you will need to do this and commit the composer.json with the approved plugins in.

This is a BC-breaking change (albeit an advertised one), currently, composer will not treat this as an error but this is being looked at

1
  • I can confirm this is the issue. Commented Jul 15, 2022 at 8:52
1

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.

1
  • That worked the first time, and I suspect it helped, but I am still working to reproduce that success.
    – Hugh Esco
    Commented Jul 23, 2020 at 6:13

Your Answer

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

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