I am trying to update a drupal 8 site to drupal 9. It is on Godaddy with cpanel.

I had to bring it up to the latest 8.x version before going up to drupal 9. I am using composer to manage the dependencies. As part of this I updated drush to v10.

Drush has suddenly stopped being able to find the root of the Drupal install and cannot do much of anything. When I run drush status i get the following:

~/vendor/bin/drush status
 PHP binary    : /opt/alt/php74/usr/bin/php
 PHP config    : /opt/alt/php74/etc/php.ini
 PHP OS        : Linux
 Drush script  : /home/lz7m8hr2s8ob/vendor/drush/drush/drush
 Drush version : 10.6.2
 Drush temp    : /tmp
 Drush configs : /home/lz7m8hr2s8ob/vendor/drush/drush/drush.yml
 Drupal root   : /home/lz7m8hr2s8ob/public_html/public_html

The actual root is /home/lz7m8hr2s8ob/public_html

I have tried:

  1. Passing in the --root flag (Does absolutely nothing)
  2. Running drush from inside the site root
  3. Deleting and re-installing drush with composer

How do I force drush 10 to use the correct root?

I tested the upgrade on a local copy and another copy of the site on a similar server. This issue did not arise.

Here is an example of an error when trying to execute a clear-cache in case that helps:

 ~/vendor/bin/drush -vvv cr
 [preflight] Config paths: /home/lz7m8hr2s8ob/vendor/drush/drush/drush.yml
 [preflight] Alias paths: /home/lz7m8hr2s8ob/public_html/drush/sites,/home/lz7m8hr2s8ob/drush/sites
 [preflight] Commandfile search paths: /home/lz7m8hr2s8ob/vendor/drush/drush/src
 [debug] Starting bootstrap to site [0.09 sec, 8.61 MB]

In BootstrapHook.php line 32:

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

Exception trace:
  at /home/lz7m8hr2s8ob/vendor/drush/drush/src/Boot/BootstrapHook.php:32
 Drush\Boot\BootstrapHook->initialize() at /home/lz7m8hr2s8ob/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:34
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook() at /home/lz7m8hr2s8ob/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:27
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at /home/lz7m8hr2s8ob/vendor/consolidation/annotated-command/src/CommandProcessor.php:145
 Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at /home/lz7m8hr2s8ob/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:289
 Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at /home/lz7m8hr2s8ob/vendor/symfony/console/Command/Command.php:221
 Symfony\Component\Console\Command\Command->run() at /home/lz7m8hr2s8ob/vendor/symfony/console/Application.php:1005
 Symfony\Component\Console\Application->doRunCommand() at /home/lz7m8hr2s8ob/vendor/symfony/console/Application.php:255
 Symfony\Component\Console\Application->doRun() at /home/lz7m8hr2s8ob/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /home/lz7m8hr2s8ob/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /home/lz7m8hr2s8ob/vendor/drush/drush/src/Runtime/Runtime.php:48
 Drush\Runtime\Runtime->run() at /home/lz7m8hr2s8ob/vendor/drush/drush/drush.php:72
 require() at /home/lz7m8hr2s8ob/vendor/drush/drush/drush:4
  • Have you got webflow/drupal-finder installed?
    – Jaypan
    May 13 at 15:09
  • Dumb question; how do I check that? It's not a module. Is it a php dependency? Am i suppose to manually use it?
    – tanbog
    May 14 at 0:51
  • Wait, found it. It;s a dependency. Yes it's installed.
    – tanbog
    May 14 at 1:14
  • 2
    Ok. So it turned out, I accidentally copied a composer.json file into the public_html directory. When Drush bootstrapped it looked in both the composer file in the webroot AND the composer file in siteroot and concatenated the custom path I had set, so public_html became public_html/public_html sigh...
    – tanbog
    May 14 at 2:50


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.