Review main Merged

67080[BUGFIX] Streamline frontend 5xx error handling

Benjamin Franzke CR +2 V +2 Normal +172 −31 updated 01/06/21, 11:48

Commit message

* Fix 500 vs 503 error for configuration vs maintenance errors
 * Fix maintenance mode middleware ordering to get access to site
   related error handlers
 * Fix ErrorController unit tests to actually test
   for 503 and 500 error responses (contained duplicate
   code that didn't actually test for the non-configured
   state, but the devIPMask state)

For 5xx status code we have two different cases right now:
 * configuration errors, which need to respond with 500
 * maintenance mode, which is a 503 response

Therefore TSFE now uses internalErrorAction()
to respond with "500 Internal Server Error" when
the page configuration is broken.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Martin Kutschker +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Martin Kutschker +1
    • TYPO3com +1 CI

Issues 2

Files 6

Review log 1825

  1. Benjamin Franzke uploaded patch set 1 12/10/20, 08:22

  2. TYPO3com voted on patch set 1 V +1 12/10/20, 08:32 Completed build in 09m 22s on Thu, 10 Dec, 08:32 AM Test Summary: 32407 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8014

  3. Alexander Schnitzler commented on patch set 1 12/11/20, 16:01

    ErrorController.php:57

    Don't we have constants for the error codes and messages? Would be great to have that unified instead of using those strings and integers here and there.
  4. Benjamin Franzke commented on patch set 1 12/13/20, 20:48

    ErrorController.php:57 Reply

    We have HttpUtility::HTTP_STATUS_500 and HttpUtility::HTTP_STATUS_503, but they contain the response code and are really suited for the plain header. This message is a user message and therefore I wouldn't want to mix it actually. Usage of HTTP_STATUS_500 would imply that the parameter is protocol relevant. Hope you're ok with that?
  5. Martin Kutschker commented on patch set 1 12/28/20, 11:23

    ErrorController.php:57 Reply

    I'm more concerned with the missing RST. The fix introduces a new feature and breaks instances that have a 503 handler that isn't called any more after the change.
  6. Benjamin Franzke commented on patch set 1 12/28/20, 11:45

    ErrorController.php:57 Reply

    Please see the related issue #93032 where we just fixed to actually take these handlers into account, but changed too many 500 errors to 503. But previously these handlers where never respected: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67074 So, yes, in 10.4.2 it is possible that someone added a 503 listener, but not in <= 10.4.1. So risk is very low (and this change was of course intended to go into 10.4.2 as well, but reviews where missing, as it is a followup/counterpart of #93032.)
  7. Martin Kutschker commented on patch set 1 12/28/20, 14:56

    ErrorController.php:57 Reply

    Ok I see. So actually the predecssor is the breaking change. Interesting that neither Lolly nor Benni cared.
  8. Martin Kutschker uploaded patch set 2 12/28/20, 16:34

  9. TYPO3com voted on patch set 2 V -1 12/28/20, 16:44 Completed build in 09m 42s on Mon, 28 Dec, 04:44 PM Test Summary: 3 of 32789 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8473

  10. Martin Kutschker uploaded patch set 3 12/28/20, 21:50

  11. TYPO3com voted on patch set 3 V -1 12/28/20, 21:59 Completed build in 09m 37s on Mon, 28 Dec, 09:59 PM Test Summary: 32548 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8483

  12. Martin Kutschker uploaded patch set 4 12/29/20, 09:38

  13. TYPO3com voted on patch set 4 V +1 12/29/20, 09:47 Completed build in 09m 47s on Tue, 29 Dec, 09:47 AM Test Summary: 32548 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8487

  14. Andreas Kienast commented on patch set 4 12/29/20, 10:24

    ErrorController.php:57 Reply

    "Interesting that neither Lolly nor Benni cared." - A bit harsh to assume they introduced and hid a breaking change on full intention.
  15. Martin Kutschker commented on patch set 4 12/29/20, 10:34

    ErrorController.php:57 Reply

    Sorry, I didn't wanted to be rude. Perhaps "did not care" was not a good choice for phrasing. My intent was to comment on the fact that in a comment possiblity of a breaking change has been stated, but there was no reply on that.
  16. Benjamin Franzke commented on patch set 4 01/04/21, 21:22

    ErrorController.php:57 Reply

    Yea, well, I somewhere commented that I would support 500 + 503 handlers for 10.4, but then noticed during the backport that the handler wasn't actually called when invoked within a middleware. I don't even find that comment anymore, maybe it was offtrack, dunno.. Therefore this patch resulted to both fix/streamline master and v10. Marking this therefore as resolved.
  17. Martin Kutschker voted on patch set 4 V +1 CR +1 01/05/21, 16:36

  18. Christian Kuhn uploaded patch set 5 01/06/21, 11:08

  19. Christian Kuhn voted on patch set 5 V +1 CR +1 01/06/21, 11:13

  20. TYPO3com voted on patch set 5 V -1 01/06/21, 11:19 Completed build in 10m 47s on Wed, 6 Jan, 11:19 AM Test Summary: 1 of 32806 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8675

  21. TYPO3com commented on patch set 5 01/06/21, 11:24 Completed build in 27m 13s on Wed, 6 Jan, 11:24 AM Test Summary: 1 of 32806 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8675

  22. Martin Kutschker voted on patch set 5 V +1 CR +1 01/06/21, 11:26

  23. TYPO3com voted on patch set 5 V +1 01/06/21, 11:36 Completed build in 55m 05s on Wed, 6 Jan, 11:36 AM Test Summary: 32565 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8675

  24. Christian Kuhn voted on patch set 5 V +2 CR +2 01/06/21, 11:48

  25. Christian Kuhn merged patch set 6 01/06/21, 11:48