Error codes for the HTTP client SDK

Updated at:

When a request to send, consume, or acknowledge messages fails, the ApsaraMQ for RocketMQ HTTP client SDK returns one of the following error codes. Use this reference to identify the cause and resolve the issue.

Error categories

The following table groups error codes by handling strategy:

CategoryError codesAction
Authentication and authorizationAccessDenied, InvalidAccessKeyId, SignatureDoesNotMatchVerify your AccessKey pair and signing method. Do not retry without fixing the issue.
Request validationInvalidArgument, InvalidAuthorizationHeader, InvalidDateHeader, InvalidDigest, InvalidRequestURL, InvalidQueryString, MalformedXML, MissingAuthorizationHeader, MissingDateHeader, MissingReceiptHandle, ReceiptHandleError, HTTPForbiddenFix the request parameters or headers. Do not retry without changes.
Server and transientInternalError, InternalServerError, MessageNotExist, TimeExpired, QpsLimitExceededRetry with exponential backoff, or reduce your request rate and retry.

Authentication and authorization errors

AccessDenied

AttributeValue
HTTP status code403
Error messageThe OwnerId that your Access Key Id associated to is forbidden for this operation.

Cause: The account associated with your AccessKey ID does not have permission for this operation.

Resolution:

  • Verify that the AccessKey ID and AccessKey secret are correct.

  • Confirm the account has the required permissions for this API action.

  • Make sure the AccessKey pair is active and not disabled.

InvalidAccessKeyId

AttributeValue
HTTP status code403
Error messageThe AccessKey Id you provided is not exist.

Cause: The specified AccessKey ID does not exist.

Resolution: Verify that the AccessKey ID is correct. To create or manage AccessKey pairs, see Create an AccessKey pair.

SignatureDoesNotMatch

AttributeValue
HTTP status code403
Error messageThe request signature we calculated does not match the signature you provided. Check your key and signing method.

Cause: The request signature calculated by the server does not match the signature in the request.

Resolution: Check your AccessKey secret and signing method. For the correct signing algorithm, see Request signatures.

Request validation errors

InvalidAuthorizationHeader

AttributeValue
HTTP status code400
Error messageThe Authorization header format is invalid.

Cause: The Authorization header is not in the expected format.

Resolution: Correct the header format. For details, see Request signatures.

MissingAuthorizationHeader

AttributeValue
HTTP status code400
Error messageAuthorization header is required.

Cause: The request does not include the Authorization header.

Resolution: Add the Authorization header to your request. For details, see Common parameters.

InvalidDateHeader

AttributeValue
HTTP status code400
Error messageThe Date header format is invalid.

Cause: The Date header is not in the expected format.

Resolution: Correct the header format. For details, see Common parameters.

MissingDateHeader

AttributeValue
HTTP status code400
Error messageDate header is required.

Cause: The request does not include the Date header.

Resolution: Add the Date header to your request. For details, see Common parameters.

InvalidArgument

This error code covers multiple validation failures. Match the error message to identify the specific issue.

XML schema validation failure

AttributeValue
HTTP status code400
Error messageThe XML you provided did not validate against our published schema, cause by Element *{parameter}*.

Cause: The XML request body contains an element that does not conform to the published schema. The *{parameter}* placeholder identifies the invalid element.

Resolution: Fix the XML element indicated in the error message. For valid XML structures, see:

Parameter value out of range

AttributeValue
HTTP status code400
Error messageThe value of Element *{parameter}* must be between Low *{min}* and High *{max}* seconds/bytes.

Cause: The specified parameter value falls outside the allowed range. The *{parameter}*, *{min}*, and *{max}* placeholders identify the parameter name and valid range.

Resolution: Set the parameter to a value within the range specified in the error message.

Message body too large

AttributeValue
HTTP status code400
Error messageThe length of message should not be larger than MaximumMessageSize.

Cause: The message body exceeds the maximum allowed size.

Resolution: Reduce the message body size to within the MaximumMessageSize limit. For details, see Operation for sending messages.

InvalidDigest

AttributeValue
HTTP status code400
Error messageThe Content-MD5 you specified is invalid.

Cause: The Content-MD5 header value does not match the request body content.

Resolution: Recalculate the MD5 digest of the request body and update the header, or omit the Content-MD5 header.

InvalidRequestURL

AttributeValue
HTTP status code400
Error messageHttp request URL format invalid.

Cause: The request URL format is incorrect.

Resolution: Correct the URL format. For valid URL structures, see:

InvalidQueryString

AttributeValue
HTTP status code400
Error messageHttp request URL contains invalid querystring item "*{parameter}*".

Cause: The request URL contains an unsupported query string parameter. The *{parameter}* placeholder identifies the invalid item.

Resolution: Remove the invalid query string parameter. For valid URL structures, see:

MalformedXML

AttributeValue
HTTP status code400
Error messageThe XML you provided was not well-formed.

Cause: The XML in the request body is not well-formed (for example, it has missing closing tags or incorrect nesting).

Resolution: Validate your XML before sending the request. For valid XML structures, see:

MissingReceiptHandle

AttributeValue
HTTP status code400
Error messageReceiptHandle is required.

Cause: The request does not include the required ReceiptHandle parameter.

Resolution: Include the ReceiptHandle obtained from a previous consume operation. For details, see:

ReceiptHandleError

AttributeValue
HTTP status code400
Error messageThe receipt handle you provide is not valid.

Cause: The ReceiptHandle value is malformed or corrupted.

Resolution: Use the exact ReceiptHandle value returned by a consume operation. Do not modify or truncate it. For details, see:

HTTPForbidden

AttributeValue
HTTP status code400
Error messageConsume message through HTTP and TCP at the same time is forbidden.

Cause: The same group ID is being used by both the TCP client SDK and the HTTP client SDK at the same time.

Resolution: Use separate group IDs for the TCP client SDK and the HTTP client SDK. A single group ID cannot be shared across both protocols concurrently.

Server and transient errors

InternalError

AttributeValue
HTTP status code500
Error messageInteral error.

Cause: An internal error occurred on the server.

Resolution: Retry the request with exponential backoff. If the error persists, submit a ticket to contact technical support.

InternalServerError

AttributeValue
HTTP status code500
Error messageInteral error.

Cause: An internal server error occurred.

Resolution: Retry the request with exponential backoff. If the error persists, submit a ticket to contact technical support.

MessageNotExist

This error code has two variants:

No messages available

AttributeValue
HTTP status code404
Error messageMessage not exist.

Cause: No messages are available in the topic.

Resolution: This is expected behavior when the topic has no pending messages. Retry after a short interval using a polling strategy.

Receipt handle expired

AttributeValue
HTTP status code404
Error messageThe receipt handle you provided has expired.

Cause: The consumer did not acknowledge the message within the visibility timeout, and the ReceiptHandle has expired.

Resolution: Consume the message again to get a new ReceiptHandle, then acknowledge it before the visibility timeout expires. To prevent this error, make sure message processing completes within the visibility timeout window.

TimeExpired

AttributeValue
HTTP status code408
Error messageThe http request you sent is expired.

Cause: More than 15 minutes elapsed between when the request was sent and when the ApsaraMQ for RocketMQ server received it.

Resolution: Check your local system clock for accuracy. Synchronize the system time with a reliable NTP server and verify that network latency is within acceptable limits.

QpsLimitExceeded

AttributeValue
HTTP status code400
Error messageThe QPS limit *{limit}* is exceeded.

Cause: The number of requests per second for a topic exceeds the queries-per-second (QPS) limit. The *{limit}* placeholder shows the current per-topic QPS limit.

Resolution:

  • Implement request throttling with exponential backoff.

  • Distribute requests across multiple topics if possible.

  • To raise the QPS limit, submit a ticket.

For current per-topic QPS limits, see Limits.

Related topics