Project

General

Profile

Actions

Bug #103959

closed

TYPO3 fresh installation in DDEV routing context fails on Trusted Hosts Pattern Mismatch

Added by Garvin Hicking about 1 month ago. Updated 27 days ago.

Status:
Resolved
Priority:
Should have
Category:
-
Target version:
-
Start date:
2024-05-31
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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:

https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/Appendix/SettingUpTypo3Ddev.html#setting-up-typo3-with-ddev

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #88846: Install tool (on FIRST_INSTALL) warns about "Trusted hosts pattern mismatch" although 'trustedHostsPattern' is set correctly (if no LocalConfiguration.php is present)Closed2019-07-26

Actions
Related to TYPO3 Core - Bug #86356: Checking $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] should be disabled when running initial setup wizardClosed2018-09-23

Actions
Actions #1

Updated by Garvin Hicking about 1 month 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
Actions #2

Updated by Gerrit Code Review about 1 month 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

Actions #3

Updated by Gerrit Code Review 29 days 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

Actions #4

Updated by Garvin Hicking 29 days ago

  • Assignee set to Garvin Hicking
Actions #5

Updated by Gerrit Code Review 27 days 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

Actions #6

Updated by Garvin Hicking 27 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF