0

I have a Drupal 8.9 site I built on my development server. I've now copied it over to my production server (Ubuntu 16) and set up the database. I need to run drush cr to finish the process but when I do I get Bootstrap failed.

I've been all over the web trying different things to get it to work. I've changed 'localhost' to '127.0.0.1' in settings.php. I've removed drush and reinstalled. I've double checked that the database is accessible with the credentials in settings.php. I've run out of ideas.

Here's the verbose output:

administrator@ubuntu:/var/www/html/ycfld$ drush cr -vvv
 [preflight] Config paths: /home/administrator/.composer/vendor/drush/drush/drush.yml
 [preflight] Alias paths: /var/www/html/ycfld/drush/sites,/var/www/html/drush/sites
 [preflight] Commandfile search paths: /home/administrator/.composer/vendor/drush/drush/src
 [debug] Starting bootstrap to site [0.05 sec, 7.81 MB]

In BootstrapHook.php line 32:

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


Exception trace:
  at /home/administrator/.composer/vendor/drush/drush/src/Boot/BootstrapHook.php:32
 Drush\Boot\BootstrapHook->initialize() at /home/administrator/.composer/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:34
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook() at /home/administrator/.composer/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:27
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at /home/administrator/.composer/vendor/consolidation/annotated-command/src/CommandProcessor.php:145
 Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at /home/administrator/.composer/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:289
 Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at /home/administrator/.composer/vendor/symfony/console/Command/Command.php:221
 Symfony\Component\Console\Command\Command->run() at /home/administrator/.composer/vendor/symfony/console/Application.php:1018
 Symfony\Component\Console\Application->doRunCommand() at /home/administrator/.composer/vendor/symfony/console/Application.php:271
 Symfony\Component\Console\Application->doRun() at /home/administrator/.composer/vendor/symfony/console/Application.php:147
 Symfony\Component\Console\Application->run() at /home/administrator/.composer/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /home/administrator/.composer/vendor/drush/drush/src/Runtime/Runtime.php:49
 Drush\Runtime\Runtime->run() at /home/administrator/.composer/vendor/drush/drush/drush.php:72

And here's the status:

administrator@ubuntu:/var/www/html/ycfld$ drush status
 PHP binary    : /usr/bin/php7.4
 PHP config    : /etc/php/7.4/cli/php.ini
 PHP OS        : Linux
 Drush script  : /home/administrator/.composer/vendor/drush/drush/drush.p
                 hp
 Drush version : 10.3.1
 Drush temp    : /tmp
 Drush configs : /home/administrator/.composer/vendor/drush/drush/drush.y
                 ml
 Drupal root   : /var/www/html/ycfld

I'd appreciate any insights. This one thing is all that stands in my way of the site going live (I think).

  • 2
    Are you using composer workflow? If yes remove vendor directory and execute composer install. It might be due to missing vendor dependencies. – miststudent2011 Jul 17 at 23:00
  • Did that and I still get the same error. One of the frustrations is that this works fine on my dev box and they should be virtually the same environments. – Chanel Jul 20 at 16:43
  • I did copy over composer.json and composer.lock from my dev box. I didn't think to delete those before installing composer on my production system. Do those need to be purged and somehow rebuilt? – Chanel Jul 20 at 17:44
  • I installed drush and composer and reinstalled but this time I installed drush 9 instead of drush 10. Now I'm getting a different error: Command cache-rebuild needs a higher bootstrap level to run - you [error] will need to invoke drush from a more functional Drupal environment to run this command. Command cache-rebuild requires Drupal core version 8+ to run. I am on version 8. – Chanel Jul 20 at 19:26
  • Oops, I thought I was on drush 9 but I was actually on drush 8. I upgraded to 9 and now I'm back to the bootstrap failure. – Chanel Jul 20 at 19:30

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.