Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Since the addition of a the core drush command to run a site installation, drush no longer works correctly to install. Drush doesn't read existing database connection information. In fact it never reads the settings.php at all.
Ref: #2911319: Provide a single command to install & run Drupal - https://cgit.drupalcode.org/drupal/commit/?id=573702f
Using Drush 9.2.3
Comment | File | Size | Author |
---|---|---|---|
#13 | 2969715-13.patch | 1.99 KB | alexpott |
#13 | 10-13-interdiff.txt | 4.03 KB | alexpott |
#10 | 2969715-10.patch | 3.06 KB | alexpott |
#10 | 2969715-10.test-only.patch | 1.88 KB | alexpott |
#8 | 2969715-8.patch | 1.18 KB | alexpott |
Comments
Comment #2
pookmish CreditAttribution: pookmish commentedComment #3
cilefen CreditAttribution: cilefen at Institute for Advanced Study commentedThe core command is not Drush, correct? If Drush must adapt, that is important, however Drush’s issue queue is on Github. Please open an issue there https://github.com/drush-ops/drush/issues
If you did not already, post a comment on #2911319: Provide a single command to install & run Drupal about this.
Comment #4
pookmish CreditAttribution: pookmish commentedMoved to https://github.com/drush-ops/drush/issues/3552
I thought that since the bug was introduced from a change core, the bug report would belong here. thanks @cilefen
Comment #5
alexpottThis is being caused by \Drupal\Core\Installer\InstallerKernel::createFromRequest() which we added in #2911319: Provide a single command to install & run Drupal
Comment #6
alexpottThis fixes Drush 9 install with an existing settings.php and doesn't break the quick-start command or tests.
Not sure how to write a test yet. Making this major because we've regressed important functionality for drush users and probably drupal console user.
Comment #7
alexpottComment #8
alexpottFix wrong comma.
Comment #9
pookmish CreditAttribution: pookmish commentedPatch in #8 worked well for me. seem to be a pretty simple as well.
Comment #10
alexpottHere's an automated test. It's a bit close to the code but fails as expected if this fix is not there.
The test only patch is the interdiff.
Comment #12
dawehnerI'm curious, should we not override
initializeSettings
and check there instead whether settings are initialized already?Nitpick: This comment is wrong
Comment #13
alexpott@dawehner I don't get point 1. Do you mean move this into DrupalKernel? Or do you mean only call createFromRequest if we need to initialise settings and do the other parts in ... ah I see (I think). Great idea. Much simpler.
And solves point 2 because there is no test anymore because the InstallerKernel is no longer overriding createFromRequest() because we just don't need to do that.
Tested with Drush 9 and the installer works again with this smaller patch.
Comment #14
pookmish CreditAttribution: pookmish commentedAlso confirming #13 works with Drush 9.2.3.
Comment #15
thursday_bw CreditAttribution: thursday_bw at Catalyst IT commentedI just applied #13 using composer patches, it applied successfully but didn't resolve my issue.
```
[error] Failed to create database: sh: 1: psql: not found
```
Maybe it's a postgres issue?.. I DO NOT have psql command installed, and I shouldn't need it, as I should be needing to create a database, in this case the database already exists albeit it's empty.
Comment #16
alexpott@thursday_bw your issue is not related to this issue. Drupal core does not issue any commands to "psql" via the shell. Drush does however.
Comment #17
dawehnerThank you @alexpott for this great simplification.
Comment #18
singularoThis solved the drush site-install issue with 8.6.0 referenced here - https://github.com/drush-ops/drush/issues/3552
Comment #19
dawehnerI already tried to RTBC it last week.
Comment #20
catchCommitted f70f4f4 and pushed to 8.6.x. Thanks!