3 ms·
503 service unavailable?
by eurasiantiger 4y ago
503 service unavailable?
- dheera 4y agoUsing HTTP error codes for non-REST things is cringe. 503 would mean the IaaS API calls themselves are unavailable. Very different from the API working perfectly fine but the instances not being available.
- devmunchies 4y agoWhat? REST is just some API philosophy, its doesn't even have to be on top of HTTP. Why would you think HTTP status codes are made for REST? They are made for HTTP to describe the response of the resource you are requesting, and the AWS API uses HTTP so it makes sense to use HTTP status codes.
- eurasiantiger 4y ago
- sn0wf1re 4y agoThat would be confusing. The HTTP response code should not be conflated with the application's state.
- eurasiantiger 4y agoThere will come a moment in time when you realize exactly what you have stated here and why it is not a good mental palace to live in.
- yjftsjthsd-h 4y agoYeah, 4xx is client error, 5xx is server error.
- pdpi 4y agoYes, and trying to create duplicate resources is a client error.
- eurasiantiger 4y agoStill, 409 seems inappropriate, as it is meant to signal a version conflict, i.e. someone else changed something, and user tried to uplod a stale version. ”10.4.10 409 Conflict The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough information for the user to recognize the source of the conflict. Ideally, the response entity would include enough information for the user or user agent to fix the problem; however, that might not be possible and is not required. Conflicts are most likely to occur in response to a PUT request. For example, if versioning were being used and the entity being PUT included changes to a resource which conflict with those made by an earlier (third-party) request, the server might use the 409 response to indicate that it can't complete the request. In this case, the response entity would likely contain a list of the differences between the two versions in a format defined by the response Content-Type.” Then again, perhaps it is the service itself making that state change.
- danielmarkbruce 4y agoIt's not the service that's unavailable. The resource isn't available. The service is running just fine.
- verdverm 4y agoGCP error messages will indicate if resources were not available, if you reached your quota, or if it was some other error. Tests like OP can differentiate these situations