Opened 6 years ago
Closed 4 years ago
#42466 closed defect (bug) (fixed)
HTTP status code is wrong on setup error
Reported by: | linyows | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Upgrade/Install | Keywords: | 2nd-opinion has-patch |
Focuses: | administration | Cc: |
Description
Since setup error and http status are not matched, it is necessary to correct it.
Attachments (1)
Change History (7)
#3
@
6 years ago
- Keywords has-patch added
- Version trunk deleted
The 409 (Conflict) status code indicates that the request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request. The server SHOULD generate a payload that includes enough information for a user to recognize the source of the conflict.
— https://tools.ietf.org/html/rfc7231#section-6.5.8
Based on the definition I think it's actually an appropriate code.
#4
@
6 years ago
I think the server side detects client duplication as it detects file duplication. If the user runs the installer again it is obviously a client error. Also, I think that it is more programmable to match these errors with the message being returned than to put them together as a 500 error.
A 409 doesn't seem like the correct code here - The 4xx series of codes are a "Client error" (ie. incorrect data sent) which isn't the case here.
A 500 error seems to fit best when looking through the various codes, although a 200 is possibly also the correct response here. The error is a "Sorry, but this isn't usable right now, it looks like your server is already configured" (which makes it sound like a 403 would be correct, but that would also be incorrect as it's not a client error)