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

Also available in: Atom PDF