Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect use of 503 status code #11512

Closed
andrewhowdencom opened this issue Oct 17, 2017 · 7 comments
Closed

Incorrect use of 503 status code #11512

andrewhowdencom opened this issue Oct 17, 2017 · 7 comments
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed

Comments

@andrewhowdencom
Copy link
Contributor

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

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Oct 17, 2017
@orlangur
Copy link
Contributor

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.

@andrewhowdencom
Copy link
Contributor Author

dirty UI change implemented

@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed feature request labels Oct 23, 2017
@andrewhowdencom
Copy link
Contributor Author

andrewhowdencom commented Mar 1, 2018

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.

@ishakhsuvarov
Copy link
Contributor

Hi @andrewhowdencom,
The issue has been closed by mistake, we are reopening it now.
Sorry for the inconvenience.

@ishakhsuvarov ishakhsuvarov reopened this Mar 1, 2018
@ishakhsuvarov ishakhsuvarov added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed non-issue labels Mar 1, 2018
@magento-engcom-team
Copy link
Contributor

Hi @andrewhowdencom. Thank you for your report.
The issue has been fixed in #11513 by @andrewhowdencom in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.4 release.

@magento-engcom-team
Copy link
Contributor

Hi @andrewhowdencom. Thank you for your report.
The issue has been fixed in #14190 by @AlexWorking in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Mar 21, 2018
@sidolov
Copy link
Contributor

sidolov commented Jul 30, 2018

Hi @andrewhowdencom. Thank you for your report.
The issue has been fixed in #17241 by @mageprince in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.15 release.

@sidolov sidolov added the Fixed in 2.1.x The issue has been fixed in 2.1 release line label Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed
Projects
None yet
Development

No branches or pull requests

6 participants