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

Do not override database settings #4310

Closed
marvil07-adapt opened this issue Dec 31, 2020 · 0 comments · Fixed by #4311
Closed

Do not override database settings #4310

marvil07-adapt opened this issue Dec 31, 2020 · 0 comments · Fixed by #4311
Labels
Bug Something isn't working

Comments

@marvil07-adapt
Copy link
Contributor

Describe the bug
Extra drupal database key added on include file gets removed via override.
The default local settings file is setting the full $databases array instead of setting only the relevant key, default, which causes the problem.
PR to be added soon.

To Reproduce

  1. Add a new database key 'extra' at docroot/sites/settings/local.settings.php.
  2. blt setup
  3. drush sqlc --database="extra"

Expected behavior
The database could be used.

Detailed error output

<em class="placeholder">Notice</em>: Undefined index: extra in <em class="placeholder">require()</em> (line <em class="placeholder">174</em> of <em class="placeholder">/app/docroot/sites/default/settings/local.settings.php</em>). <pre class="backtrace">require(&#039;/app/docroot/sites/default/settings/local.settings.php&#039;) (Line: 152)
require(&#039;/app/vendor/acquia/blt/settings/blt.settings.php&#039;) (Line: 804)
require(&#039;/app/docroot/sites/default/settings.php&#039;) (Line: 122)
Drupal\Core\Site\Settings::initialize(&#039;/app/docroot&#039;, &#039;sites/default&#039;, Object) (Line: 1064)
Drupal\Core\DrupalKernel-&gt;initializeSettings(Object) (Line: 269)
Drupal\Core\DrupalKernel::createFromRequest(Object, Object, &#039;prod&#039;, 1) (Line: 223)
Drush\Boot\DrupalBoot8-&gt;bootstrapDrupalConfiguration(Object, NULL) (Line: 293)
Drush\Boot\BootstrapManager-&gt;doBootstrap(3, 3, NULL) (Line: 493)
Drush\Boot\BootstrapManager-&gt;bootstrapMax(3) (Line: 427)
Drush\Boot\BootstrapManager-&gt;bootstrapToPhaseIndex(-2, Object) (Line: 396)
Drush\Boot\BootstrapManager-&gt;bootstrapToPhase(&#039;max&#039;, Object) (Line: 28)
Drush\Boot\BootstrapHook-&gt;initialize(Object, Object) (Line: 34)
Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher-&gt;callInitializeHook(Object, Object, Object) (Line: 27)
Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher-&gt;initialize(Object, Object) (Line: 145)
Consolidation\AnnotatedCommand\CommandProcessor-&gt;initializeHook(Object, Array, Object) (Line: 289)
Consolidation\AnnotatedCommand\AnnotatedCommand-&gt;initialize(Object, Object) (Line: 221)
Symfony\Component\Console\Command\Command-&gt;run(Object, Object) (Line: 1018)
Symfony\Component\Console\Application-&gt;doRunCommand(Object, Object, Object) (Line: 271)
Symfony\Component\Console\Application-&gt;doRun(Object, Object) (Line: 147)
Symfony\Component\Console\Application-&gt;run(Object, Object) (Line: 118)
Drush\Runtime\Runtime-&gt;doRun(Array, Object) (Line: 49)
Drush\Runtime\Runtime-&gt;run(Array) (Line: 72)
require(&#039;/app/vendor/drush/drush/drush.php&#039;) (Line: 4)
</pre>
In SqlBase.php line 106:

  Unable to load Drupal settings. Check your --root, --uri, etc.


sql:cli [--extra EXTRA] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--database [DATABASE]] [--target [TARGET]] [--db-url DB-URL] [--show-passwords] [--notify [NOTIFY]] [--xh-link XH-LINK] [--druplicon] [--] <command>
@marvil07-adapt marvil07-adapt added the Bug Something isn't working label Dec 31, 2020
marvil07-adapt pushed a commit to marvil07-adapt/blt that referenced this issue Dec 31, 2020
… file

Instead set only the default database key, to prevent removing any added
database key from other include files.
marvil07-adapt added a commit to marvil07-adapt/blt that referenced this issue Dec 31, 2020
… file

Instead set only the default database key, to prevent removing any added
database key from other include files.
danepowell pushed a commit that referenced this issue Jan 4, 2021
…4311)

Instead set only the default database key, to prevent removing any added
database key from other include files.
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.

1 participant