Bug #103959
closedTYPO3 fresh installation in DDEV routing context fails on Trusted Hosts Pattern Mismatch
100%
Description
When using the TYPO3 GIT Core repository via DDEV, and installing it web-based for the first time, the installation fails with the dreaded "Trusted Hosts Pattern Mismatch" error when using the https:// protocol.
This is documented in the TYPO3 Contribution Guide as a sidenote:
If you are getting a trustedHostsPattern error on initial access, try accessing the HTTP domain first.
The actual error message from TYPO3 reads:
The trusted hosts pattern will be configured to allow all header values.
This is because your $SERVER_NAME:$SERVER_PORT is
"test-installer.ddev.site:80" while your HTTP_HOST is "test-installer.ddev.site".
Check the pattern defined in Admin Tools -> Settings -> Configure
Installation-Wide Options -> System -> trustedHostsPattern and adapt it to expected host value(s).
When a developer like me reads this, they might be included to fix this with "AdditionalConfiguration.php" or "additional.php", but that fails, because both these files are NOT evaluated during installation in legacy mode.
The actual solution is to use "http://" for installation.
To improve the DX/UX for this kind of installation, the error message should be enhanced to point this out.
Note that issues https://forge.typo3.org/issues/88846 and https://forge.typo3.org/issues/86356 also stumbled on this; the solution in TYPO3 9.x at the time was to allow reading AdditionalConfiguration.php on the installation already, if it existed. In newer TYPO3 versions this seems to have been reverted though, as this is no longer the case.
Updated by Garvin Hicking 6 months ago
- Related to Bug #88846: Install tool (on FIRST_INSTALL) warns about "Trusted hosts pattern mismatch" although 'trustedHostsPattern' is set correctly (if no LocalConfiguration.php is present) added
- Related to Bug #86356: Checking $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] should be disabled when running initial setup wizard added
Updated by Gerrit Code Review 6 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84450
Updated by Gerrit Code Review 6 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84450
Updated by Gerrit Code Review 6 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84504
Updated by Garvin Hicking 6 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset a2d768375f50e56b41f455e00fa8baf8ad17bf15.