I had Drush 9 working before it got upgraded to 9.1.0 and am a little bit at my wits end why Bootstrap is failing and why I get "Bootstrap failed" or "! [NOTE] Drupal root not found. Pass --root or a @siteAlias in order to see Drupal-specific commands."
- My build directory is separate from my vendor directory. (shorthanded below to
[build]
and[composer]
) - There are a couple of debugged commands below, one trying to use an alias, and one just using the help command.
- There are a couple extra alias paths (the last two) which are not valid and I can't figure out where they come from (they are not in my
drush.yml
anywhere), but my alias file is found...@default.dev
does seem to work. - adding
-r
or-uri
(or using that in place of the alias) does not make any difference... I still get the Bootstrap failed.
What has changed from earlier versions of Drush 9, or what am I doing incorrectly here? There was similar things with Drush 8 at some point, but none of the solutions that I saw in there worked, and I didn't see anything specific to Drush 9.
[794e@794elmp01 htdocs]$ drush @default.dev cr -d
[preflight] Config paths: /../.drush/drush.yml,/var/..[composer]/vendor/drush/drush/drush.yml
[preflight] Alias paths: /../.drush/sites,/var/..[build]/sites,/var/..[build]/drush/sites,/var/..[composer]/drush/sites
[preflight] Commandfile search paths: /var/../vendor/drush/drush/src
[bootstrap] Bootstrap to site [0.2 sec, 10.19 MB]
[Exception]
Bootstrap failed.
Exception trace:
() at /var/..[composer]/vendor/drush/drush/src/Boot/BootstrapHook.php:31
Drush\Boot\BootstrapHook->initialize() at /var/..[composer]/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:34
Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook() at /var/..[composer]/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:27
Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at /var/..[composer]/vendor/consolidation/annotated-command/src/CommandProcessor.php:117
Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at /var/..[composer]/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:391
Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at /var/..[composer]/vendor/symfony/console/Command/Command.php:229
Symfony\Component\Console\Command\Command->run() at /var/..[composer]/vendor/symfony/console/Application.php:859
Symfony\Component\Console\Application->doRunCommand() at /var/..[composer]/vendor/symfony/console/Application.php:206
Symfony\Component\Console\Application->doRun() at /var/..[composer]/vendor/symfony/console/Application.php:125
Symfony\Component\Console\Application->run() at /var/..[composer]/vendor/drush/drush/src/Runtime/Runtime.php:112
Drush\Runtime\Runtime->doRun() at /var/..[composer]/vendor/drush/drush/src/Runtime/Runtime.php:41
Drush\Runtime\Runtime->run() at /var/..[composer]/vendor/drush/drush/drush.php:64
require() at /var/..[composer]/vendor/drush/drush/drush:4
drush list -d
[preflight] Config paths: /home/../.drush/drush.yml,/var/..[composer]/vendor/drush/drush/drush.yml
[preflight] Alias paths: /home/../.drush/sites,/var/..[build]/sites,/var/..[build]/drush/sites,/var/..[composer]/drush/sites
[preflight] Commandfile search paths: /var/..[composer]/vendor/drush/drush/src
[bootstrap] Bootstrap to max [0.22 sec, 10.14 MB]
[debug] Trying to bootstrap as far as we can [0.22 sec, 10.15 MB]
Drush Commandline Tool 9.1.0
! [NOTE] Drupal root not found. Pass --root or a @siteAlias in order to see Drupal-specific commands.
Also, additional info: this is the site reference in the default.site.yml
:
dev:
root: /var/..[build]/htdocs
uri: http://dev.our.internal.url.com
I verified that the root and URI were correct, and that the URI was accessible from the server (it is not a public URI).
EDIT: Adding Drush Status (per request)
drush status -d
[preflight] Config paths: /home/../.drush/drush.yml,/var/[composer]/vendor/drush/drush/drush.yml
[preflight] Alias paths: /home/../.drush/sites,/var/[build]/sites,/var/[build]/sites,/var/[composer]/drush/sites
[preflight] Commandfile search paths: /var/[composer[/vendor/drush/drush/src
[bootstrap] Bootstrap to max [0.19 sec, 10.14 MB]
[debug] Trying to bootstrap as far as we can [0.19 sec, 10.15 MB]
PHP binary : /usr/bin/php
PHP config : /etc/php.ini
PHP OS : Linux
Drush script : /var/[composer]/vendor/bin/drush
Drush version : 9.1.0
Drush temp : /tmp
Drush configs : /home/../.drush/drush.yml
/var/[composer]/vendor/drush/drush/drush.yml
drush status
give you? Have you tried running Drush from different directories - project root, site root and so on. Which OS?