Review main Work in progress Stale

94645[BUGFIX] Report readonly settings.php on ext_conf_template config sync

Maike Kiebele CR 0 V 0 Easy +16 −1 updated 07/08/26, 14:42

Commit message

The maintenance module crashes with an uncaught exception
when config/system/settings.php is not writable.

This change transforms this into the
descriptive `SilentConfigurationUpgradeReadonlyException`
exception that is also thrown by
`executeSilentConfigurationUpdateAction` for a similar case.

Additionally the information is logged, in order for users
with displayErrors disabled to be able to analyze the issue.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 5
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/45/94645/5 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/45/94645/5 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Relation chain 2

  1. 94645 [BUGFIX] Report readonly settings.php on ext_conf_template config sync This change

  2. main 94706[BUGFIX] Allow to expand ajax error panels in maintenance tool This change is based on it Merged Benjamin Franzke CR +2 V +2 → 14.3 Easy +2 −1

    The chain has patch set 1 of 2, the changes above it need a rebase.

Merge conflicts 9

Issues 1

Files 2

Review log 1015

  1. Maike Kiebele uploaded patch set 1 07/01/26, 09:35

  2. core-ci voted on patch set 1 V +1 07/01/26, 09:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104143

  3. Garvin Hicking commented on patch set 1 07/01/26, 10:49

    ExtensionConfiguration.php:212 Unresolved

    What about the local `$skipWriteIfLocalConfigurationDoesNotExist` variable here, should that be factored into the if condition and early return? I think we might want to also log an error/notice when this happens for skipWriteIfLocalConfigurationDoesNotExist=false. Or we might need to emit a message somehow like "Configuration not persisted, file not writable". If we just silently fail I'm afraid a user might not get the important feedback about the configuration requiring changes that cannot be persisted and are different from what's "locked" in the config.
  4. Maike Kiebele marked it work in progress 07/01/26, 11:17

  5. Maike Kiebele uploaded patch set 2 V +1 07/06/26, 06:54

  6. Maike Kiebele uploaded patch set 3 07/06/26, 07:02

  7. core-ci voted on patch set 2 V +1 07/06/26, 07:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104380

  8. core-ci voted on patch set 3 V -1 07/06/26, 07:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104383

  9. Maike Kiebele uploaded patch set 4 V -1 07/06/26, 08:10

  10. core-ci voted on patch set 4 V +1 07/06/26, 08:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104391

  11. Benjamin Franzke commented on patch set 4 07/08/26, 10:29

    ExtensionConfiguration.php:183 Unresolved

    Hm, the argument instructs to skip if local configuration does not exist. This now implicitly also skips if it is not readable. (Though, for the scope of this patch it is actually unused, since this method is invoked with the default `false` value of `$skipWriteIfLocalConfigurationDoesNotExist`) Since it is not needed to change this, I have the feeling we should keep it as-is for the sake of a backport.

    LayoutController.php:133

    This is a similar case where settings can not be updated (not based on ext_conf_template here, but based on other silent upgrades), in which case the exception is transformed into another specific *readonly* exception in order to provide as much information for the user as possible. Justification is basically is: The system is not operable without these silent updates (I personally do not 100% agree, since the frontend is still allowed to run, so why should we block the install tool, but that's what we have right now and we should try to keep the behaviour in here in sync) This exception has the advantage that it is intended to inform the user what do to by printing: > The SilentConfigurationUpgradeService needs to make changes to the settings.php but that file is read-only. Please (temporarily) clear the read-only status and open the install tool or run the UpgradeWizards command on CLI (typo3 upgrade:run). Once the SilentConfigurationUpgrade has been run, you may restrict writing to the settings.php again. *but* I see that currently the "ajax error" is not even uncollapsible and therefore no one is able to see this error, despite by inspecting fetch requests via network inspector. I think we should fix the display of those ajax errors and problably throw the same `SilentConfigurationUpgradeReadonlyException` within `executeSilentExtensionConfigurationSynchronizationAction()` afterwards. I still like the idea to log this (we could combine both approaches). So let's try to fix the "Ajax error" uncollapse bug first and then this one.
  12. Benjamin Franzke uploaded patch set 5 V +1 07/08/26, 11:29

  13. Benjamin Franzke commented on patch set 5 07/08/26, 11:29

    LayoutController.php:133 Reply

    94706: [BUGFIX] Allow to expand ajax error panels in maintenance tool | https://review.typo3.org/c/Packages/TYPO3.CMS/+/94706
  14. core-ci voted on patch set 5 V +1 07/08/26, 11:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104515

  15. Garvin Hicking commented on patch set 5 07/08/26, 14:42

    LayoutController.php:133 Reply Unresolved

    Sounds good to me. Maybe the note should also keep deployment-scenarios in mind (in which the 'readonly' will most likely occur): > The SilentConfigurationUpgradeService needs to persist runtime (migration) changes to the settings.php but that file is read-only. Please (temporarily) clear the read-only status and open the install tool or run the UpgradeWizards command on CLI (typo3 upgrade:run). Once the SilentConfigurationUpgrade has been run, you may restrict writing to the settings.php again. If the settings.php file is version-controlled in another place, be sure to reflect these changes in your source of truth. wdyt?