Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
install system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Mar 2014 at 14:46 UTC
Updated:
29 Jul 2014 at 23:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
yesct commentedComment #2
nyirocsaba commentedYou are on MAC, right? PDO will use unix socket when connecting to localhost. Try to replace the database host from "localhost" to "127.0.0.1".
Comment #3
ianthomas_ukNo, that was on Windows. I'm not sure why that's relevant anyway - whatever ADD added to the settings file (which gets included in settings.php) should be the default values when you get to the database stage of the install process. If it had put the wrong values into settings.php then that would clearly be an ADD bug.
Comment #4
yesct commentedI suspect we might be able to provide steps to reproduce that dont involve ADD.
Maybe just changing the port in settings and then seeing if the installer picks up that different port.
tagging novice for trying that.
https://drupal.org/contributor-tasks/add-steps-to-reproduce
Comment #5
dmitry_bezer commentedAcquia Dev Desktop is not needed to reproduce this - just edit settings.php before you start installing Drupal 8 and you will see it. Suggested patch is attached.
Comment #6
pwolanin commentedI just wrote this exact same patch. setting to CNR, since the patch it not getting tested.
Comment #7
pwolanin commentedSame problem for the postgres diver. This should address both.
Comment #8
pwolanin commentedComment #9
pwolanin commentedI tested my patch with mysql and it found the pre-existing port setting correctly.
Comment #10
Anonymous (not verified) commentedseems like a simple fix to me.
Comment #11
webchickFix looks great, but it'd be wonderful if we could add a test for this. I see some stuff in core/modules/system/lib/Drupal/system/Tests/Installer but not sure. We don't want to go all the way through with the install, since it'll obviously break, but being able to make the assertion that these form values should be pre-populated by existing settings.php settings seems like a really good idea, so we don't inadvertently break this in the future.
Comment #12
pwolanin commentedI just spent an hour trying to write such a test. I think it's currently impossible.
Drupal throws a AlreadyInstalledException if there are existing but invalid DB credentials, there seems no way to test the non-standard port bug default value we're fixing here.
Comment #13
pwolanin commentedOMG, beating my head on a test that would just test pre-filled DB credentials (though it won't actually test that the port is picked up on testbot, though it does for me locally with DevDesktop) and I found ANOTHER bug, in that the existing prefix is not used (as well as some small bugs in the base classes).
This non-prefixing was very ugly - actually broke the parent site by running the test without the fix, don't try it at home.
Note that the majority of the new test setUp() is just copy/paste from InstallerTestBase so that we can change the step of the DB settings form and send an empty POST instead of posting the parameters.
Comment #15
pwolanin commentedthis passes locally both CLI and UI, so this is annoying
Comment #16
pwolanin commentedMaybe has something to do with file perms? Adding a couple extra chmod calls.
Comment #18
pwolanin commentedArgh - the form doesn't actually populate the password value, which causes this failure. I didn't see it locally because I had no password for my local dev database. According to sun, this is by design, so working around by posting just the password.
Comment #19
pwolanin commentedComment #20
Anonymous (not verified) commentedyay, green with a new test, RTBC.
Comment #21
sunProperly extend InstallerTestBase.
Verbose browser debug output reveals that the default port of the pre-configured database connection from settings.php is taken over for all database drivers. → In the edge-case that a user switches to a different driver (despite pre-configured settings.php), the default value for the different driver has a wrong/faulty default value for the port.
Comment #22
sunUse translatePostValues().
Comment #23
pwolanin commentedThanks for simplifying the code to use more of the parent class. I think this can be back to RTBC.
Comment #24
webchickAwesome, thanks for that. It's good to get this expected behaviour documented explicitly.
Committed and pushed to 8.x. Thanks!
Comment #26
sunThe follow-up for that @todo is essentially:
#2156401: Write install_profile value to configuration and only to settings.php if it is writeable
Slightly different symptom, but identical root cause.