More generally, Magento appears to use the "503 (service unavailable)" status code when an "unexpected error" happens. This ranges, but a good example of such an event is anything that generates the "report" format pages.
The problem is, this status code is generally reserved for cases in which the server is suffering a temporary problem[1][2]. When the server is in an error case, I would have expected something such as a 500 (internal server error) to be expressed, clearly indicating an "abnormal" event, or one that is not an expected failure mode.
This has implications for monitoring. When setting up alerting rules, it's unclear how to express that a problem is temporary in nature. For example, if during a period of high traffic there are several 503s, this does not warrant immediate resolution. However, if there is a spike in 503s as a result of an SQL constraint issue, this requires immediate attention, and will not self-resolve.
I would suggest modifying the report page to return a 500, rather than a 503. Additionally, some guidelines as to what status code was used when would be useful.
[1] - https://stackoverflow.com/questions/2786595/what-is-the-correct-http-status-code-to-send-when-a-site-is-down-for-maintenance
[2] - https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
Your suggestion seems perfectly valid to me, I didn't even know it was not 500.
Would you mind to prepare a PR maybe? https://github.com/magento/magento2/blob/2.2-develop/pub/errors/processor.php#L218 It can be done directly via GitHub Web UI.
dirty UI change implemented
Hola @magento-engcom-team;
Can you explain more behind the "non-issue" tag? As well as why this is closed. I'd argue this is an issue, as it makes it difficult to determine when the application is failing due to load (a fine, transient condition) and critically broken though the status code analysis.
Hi @andrewhowdencom,
The issue has been closed by mistake, we are reopening it now.
Sorry for the inconvenience.
Hi @andrewhowdencom. Thank you for your report.
The issue has been fixed in magento/magento2#11513 by @andrewhowdencom in 2.2-develop branch
Related commit(s):
The fix will be available with the upcoming 2.2.4 release.
Hi @andrewhowdencom. Thank you for your report.
The issue has been fixed in magento/magento2#14190 by @AlexWorking in 2.3-develop branch
Related commit(s):
The fix will be available with the upcoming 2.3.0 release.
Hi @andrewhowdencom. Thank you for your report.
The issue has been fixed in magento/magento2#17241 by @mageprince in 2.1-develop branch
Related commit(s):
The fix will be available with the upcoming 2.1.15 release.
Most helpful comment
dirty UI change implemented