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

Default local settings using incorrect namespace [Drupal\Core\Installer\Exception\InstallerException] #4271

Closed
b-sharpe opened this issue Oct 29, 2020 · 3 comments · Fixed by #4287
Labels
Bug Something isn't working

Comments

@b-sharpe
Copy link
Contributor

Describe the bug
The current default.local.settings.php is using the incorrect namespace for the mysql driver, causing an error during installation.

To Reproduce
Steps to reproduce the behavior, ideally starting from a fresh install of BLT:

  1. Run composer create-project acquia/drupal-recommended-project --no-interaction
  2. Run blt setup

Detailed error output
[info] Undefined index: value install.core.inc:2300 [info] Array to string conversion install.core.inc:2300 In install.core.inc line 2304: [Drupal\Core\Installer\Exception\InstallerException] Database settings: Array

Additional context
If you comment out the DB settings and re-run blt setup, it will create the proper settings and work, in which you can see the different namespace.

Currently used in BLT:
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',

What it should be:
'namespace' => 'Drupal\\Driver\\Database\\mysql',

@b-sharpe b-sharpe added the Bug Something isn't working label Oct 29, 2020
@danepowell
Copy link
Contributor

Makes sense, although I'm curious at what point this broke. Presumably in Drupal 9.0, but I'd expect to have found this before now.

@danepowell
Copy link
Contributor

I see where the Drupal\\Driver namespace is defined, looks like it's been that way since D8.0: https://git.drupalcode.org/project/drupal/-/blob/9.1.x/core/composer.json#L173

But I can't reproduce the error you describe, and I've never heard of anyone having this problem before, which is a little puzzling given how long those namespaces have existed.

Regardless... I think the namespace is superfluous, so if it's causing anyone trouble perhaps we should just remove it: #4287

@loopy3025
Copy link

loopy3025 commented Jun 16, 2021

I had a note to add to this. I got this issue when I was upgrading from BLT 11 to BLT 12. I think maybe I chose to ignore the changes to the default local settings file when I did the upgrade. Changing my namespace as @b-sharpe suggested in the default local settings and re-running blt blt:init:settings allowed me to run blt drupal:install successfully.

Note I am running Docksal. This might also be a factor.

Adding exception trace so folks can find it with a search engine.

 [info] Undefined index: value install.core.inc:2289 [5.58 sec, 23.33 MB]
 [info] Array to string conversion install.core.inc:2289 [5.58 sec, 23.33 MB]

In install.core.inc line 2293:
                                                        
  [Drupal\Core\Installer\Exception\InstallerException]  
  Database settings:                                    
                                                        
  Array                                                 
                                                        
Exception trace:
  at /var/www/docroot/core/includes/install.core.inc:2293
 install_display_requirements() at /var/www/docroot/core/includes/install.core.inc:1080
 install_verify_requirements() at /var/www/docroot/core/includes/install.core.inc:694
 install_run_task() at /var/www/docroot/core/includes/install.core.inc:565
 install_run_tasks() at /var/www/docroot/core/includes/install.core.inc:118
 install_drupal() at /var/www/vendor/drush/drush/includes/drush.inc:213
 drush_call_user_func_array() at /var/www/vendor/drush/drush/includes/drush.inc:197
 drush_op() at /var/www/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php:149
 Drush\Commands\core\SiteInstallCommands->install() at n/a:n/a
 call_user_func_array() at /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
 Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
 Consolidation\AnnotatedCommand\CommandProcessor->process() at /var/www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:311
 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /var/www/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /var/www/vendor/symfony/console/Application.php:1027
 Symfony\Component\Console\Application->doRunCommand() at /var/www/vendor/symfony/console/Application.php:273
 Symfony\Component\Console\Application->doRun() at /var/www/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /var/www/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /var/www/vendor/drush/drush/src/Runtime/Runtime.php:49
 Drush\Runtime\Runtime->run() at /var/www/vendor/drush/drush/drush.php:72
 require() at /var/www/vendor/drush/drush/drush:4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants