If an error occurs when you access Simple Message Queue (formerly MNS), SMQ returns an HTTP status code, such as 3xx, 4xx, or 5xx, and a message body of the TEXT or XML format. This topic describes the message body and error codes of SMQ.
Error codes
The following example shows the message body of an error response:
<?xml version="1.0" encoding="UTF-8"?>
<Error xmlns="http://mns.aliyuncs.com/doc/v1/">
<Code>InvalidArgument</Code>
<Message>Authorization header is invalid or missing.</Message>
<RequestId>04bb60e3-28aa-4706-99b0-9345d834****</RequestId>
<HostId>mns.cn-hangzhou.aliyuncs.com</HostId>
</Error>
The message body of an error response includes the following parameters:
Code: the error code.
Message: the error message.
RequestId: the unique ID that is used to identify the request.
If you cannot resolve an issue, you can provide the request ID to seek help from technical support.
HostId: the endpoint that is used to access SMQ. The endpoint varies based on different regions.
For more information about operation-specific errors, see the corresponding API operation.
Error codes
The following table describes the error codes and error messages in error responses and provides the recommended solutions.
Error code | Error message | HTTP status code | Recommended solution |
AccessDenied | The OwnerId that your Access Key Id associated to is forbidden for this operation. | 403 | The error message returned because the AccessKey ID and AccessKey secret are invalid. Check the AccessKey ID and AccessKey secret. |
InvalidAccessKeyId | The AccessKey Id you provided is not exist. | 403 | The error message returned because the AccessKey ID is invalid. Check the AccessKey ID. |
InternalError | Interal error. | 500 | The error message returned because a system error occurred. Contact SMQ technical support. |
InternalServerError | Interal error. | 500 | The error message returned because a system error occurred. Contact SMQ technical support. |
InvalidAuthorizationHeader | The Authorization header format is invalid. | 400 | The error message returned because the signature format is invalid. For more information, see Sign requests. |
InvalidDateHeader | The Date header format is invalid. | 400 | The error message returned because the format of the Date header is invalid. For more information, see Common parameters. |
InvalidArgument | The XML you provided did not validate against our published schema, cause by Element①. | 400 | The error message returned because the specified XML format is invalid. For more information, see API Reference. |
InvalidArgument | The value of Element② should between Low③ and High④ seconds/bytes. | 400 | The error message returned because one or more parameters are specified with invalid values. You must specify valid values as prompted. |
InvalidDegist | The Content-MD5 you specified is invalid. | 400 | The error message returned because the value of the Content-MD5 header is invalid. |
InvalidRequestURL | Http request URL format invalid. | 400 | The error message returned because the format of the requested URL is invalid. For more information, see API Reference. |
InvalidQueryString | Http request URL contains invalid querystring item “Element⑤”. | 400 | The error message returned because the format of the requested URL is invalid. For more information, see API Reference. |
MalformedXML | The XML you provided was not well-formed. | 400 | The error message returned because the specified XML format is invalid. For more information, see API Reference. |
MissingAuthorizationHeader | Authorization header is required. | 400 | The error message returned because one or more fields are not specified in the request header. For more information, see Common parameters. |
MissingDateHeader | Date header is required. | 400 | The error message returned because one or more fields are not specified in the request header. For more information, see Common parameters. |
MissingReceiptHandle | ReceiptHandle is required. | 400 | The error message returned because one or more request parameters are not specified. For more information, see API Reference. |
MissingVisibilityTimeout | VisibilityTimeout is required. | 400 | The error message returned because one or more request parameters are not specified. For more information, see API Reference. |
MessageNotExist | Message not exist. | 404 | The error message returned because no visible message exists in the queue. |
The receipt handle you provided has expired. | 404 | The error message returned because you have not consumed a message within the invisibility period and the receipt handle of the message has expired. Consume messages within the invisibility period or specify a longer invisibility period. | |
QueueAlreadyExist | The queue you want to create is already exist. | 409 | The error message returned because the specified queue has the same name as an existing queue, but has different parameters from the existing queue. |
InvalidQueueName | The queue name you provided is invalid. QueueName should start with alpha and contain only alpha, digit or - . | 400 | The error message returned because the specified queue name is invalid. For more information, see API Reference. |
QueueNameLengthError | Queue name length should between 1 and 255. | 400 | The error message returned because the specified queue name is invalid. For more information, see API Reference. |
QueueNotExist | The queue name you provided is not exist. | 404 | The error message returned because the specified queue does not exist. You must create a queue. |
ReceiptHandleError | The receipt handle you provide is not valid. | 400 | The error message returned because one or more request parameters are invalid. For more information, see API Reference. |
SignatureDoesNotMatch | The request signature we calculated does not match the signature you provided. Check your key and signing method. | 403 | The error message returned because the request signature is invalid. For more information, see Sign requests. |
TimeExpired | The http request you sent is expired. | 408 | The error message returned because the interval between the time when the request is sent and the time when the SMQ server receives the request exceeds 15 minutes. Check the local system time. |
QpsLimitExceeded | The qps limit of the queue is exceeded ⑥. | 400 | The error message returned because the number of requests per second exceeds the QPS limit. To increase the QPS limit, contact SMQ technical support. |
TopicAlreadyExist | The topic you want to create already exists. | 409 | The error message returned because the specified topic has the same name as an existing topic, but has different parameters from the existing topic. |
TopicNameInvalid | The topic name you provided is invalid. TopicName should start with alpha or digit and contain only alpha, digit or -. | 400 | The error message returned because the specified topic name is invalid. For more information, see API Reference. |
TopicNameLengthError | Topic name length is out of range, should be between 1 and 255. | 400 | The error message returned because the specified topic name is invalid. For more information, see API Reference. |
TopicNotExist | The Topic you provided does not exist. | 404 | The error message returned because the topic does not exist. You must create a topic. |
SubscriptionNameInvalid | The subscription name you provided is invalid. SubscriptionName should start with alpha or digit and contain only alpha, digit or -. | 400 | The error message returned because the specified subscription name is invalid. For more information, see API Reference. |
SubscriptionNameLengthError | Subscription name length is out of range, should be between 1 and 255. | 400 | The error message returned because the specified subscription name is invalid. For more information, see API Reference. |
SubscriptionNotExist | The subscription you provided does not exist. | 404 | The error message returned because the specified subscription does not exist. You must create a subscription. |
SubscriptionAlreadyExist | The subscription you want to create already exists. | 409 | The error message returned because the specified subscription has the same name as an existing subscription, but has different parameters from the existing subscription. |
EndpointInvalid | The format of endpoint you provided is invalid. | 400 | The error message returned because the specified endpoint is invalid. For more information, see Endpoint. |
InvalidArgument | The length of message should not be larger than MaximumMessageSize. | 400 | The error message returned because the message body is oversized. For more information, see API Reference. |
①②: a parameter in the request body. The content of the request body is in the XML format.
③: the minimun value of a parameter in SMQ.
④: the maximum value of a parameter in SMQ.
⑤: the QueryString parameter in the requested URL.
⑥: The maximum QPS of a SMQ queue is 3000.