- Newest
- Most votes
- Most comments
I tested both scenarios for both deleteMessage and changeMessageVisibility operations and I confirm both return 404 error codes which contradicts the documentation.
I would recommend to report this behavior to AWS Support and ask for clarification, as it represents an inconsistency between expected HTTP status code and the actual implementation.
2025-08-04 10:41:33,120 - MainThread - urllib3.connectionpool - DEBUG - https://sqs.eu-west-1.amazonaws.com:443 "POST / HTTP/1.1" 404 530
answered a year ago
Thank you for raising this question about Amazon SQS error codes.
You've identified an important discrepancy between documentation and actual service behavior. After investigating this issue with our AWS SQS specialists, I can confirm your observation is accurate.
While the AWS documentation for the DeleteMessage[1] and ChangeMessageVisibility[2] APIs specifies that ReceiptHandleIsInvalid errors should return a 400 status code, the service currently returns a 404 Not Found HTTP code in both scenarios:
- When the receipt handle is completely invalid
- When the receipt handle is valid but used with a different queue
According to our internal experts, this behavior exists because:
- Traditionally, 400 Bad Request is used for invalid parameters (as documented)
- However, 404 Not Found is used when the system cannot locate the referenced resource
In Amazon SQS specifically, both status codes can be returned for ReceiptHandleIsInvalid errors depending on the exact circumstances.
To ensure robust application behavior, we recommend implementing error handling that accounts for both 400 and 404 status codes when dealing with ReceiptHandleIsInvalid errors.
I've submitted a request to update our official documentation to accurately reflect both possible status codes. This should help prevent confusion for other customers in the future.
Thank you for bringing this to our attention.
=====
References:
[1] DeleteMessage API - https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessage.html
[2] ChangeMessageVisibility API - https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ChangeMessageVisibility.html
answered a year ago
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 6 months ago
