Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion error when running drush site:install #6093

Open
ericmorand opened this issue Aug 19, 2024 · 1 comment
Open

Assertion error when running drush site:install #6093

ericmorand opened this issue Aug 19, 2024 · 1 comment

Comments

@ericmorand
Copy link

We are using drush to install a Drupal 11 instance from a profile. When running drush site:install following the documentation, we get the following error:

Fatal error: Uncaught Assertion error: assert($this->bootstrap instance of DrupalBoot8)

After some investigation, it seems like drush expect that an autoloader.php file exists in vendor/drupal in order for vendor/drupal/core to be recognized as a proper core location.

Moving vendor/drupal/core to the root of the application during our deployment process doesn't solve the issue: drush seems to search for the location of drupal/core using the composer provided installed.php file, which of course mention vendor/drupal/core.

It is not clear why drush is making such assumptions as:

  • The core is located alongside an autoload file
  • The installation location of the core is provided by composer

Can you point us to the specification of Drupal core that establishes such a requirement?

Can you point us to the documentation of drush that explains where Drupal core must be installed?

And can you please explain how we can make drush works without having to put an autoload file in vendor/drupal?

@weitzman
Copy link
Member

weitzman commented Sep 6, 2024

I think you are focusing in on the call at

$core = InstalledVersions::getInstallPath('drupal/core');
. That is a call to the Composer Runtime API, not a Drush API. That API is responsible for telling us where drupal/core has been installed. Drush just honors whatever composer says, so you can put drupal/core anywhere AFAIK. Drush has no requirement for a vendor/drupal/autoload.php file.

The installation location of the Drupal core is provided by composer ... Can you point us to the specification of Drupal core that establishes such a requirement?

Its is Drush's assumption that you build your project with Composer. When you do that, Composer knows where everything has been installed and the line I linked to above works.

Apologies if I am focusing on the wrong part of the code. If I did, please show what you code you mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants