Skip to content

Incorrect use of 503 status code #11512

@andrewhowdencom

Description

@andrewhowdencom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.1.xThe issue has been fixed in 2.1 release lineFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions