If an error occurs when you access Simple Message Queue (SMQ, 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 an SMQ instance.
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.
HTTP status code | Error code | Error message | Recommended solution |
400 | InvalidAuthorizationHeader | The Authorization header format is invalid. | The error message returned because the signature format is invalid. For more information, see Sign requests. |
InvalidDateHeader | The Date header format is invalid. | The error message returned because the format of the Date header is invalid. For more information, see Common parameters. | |
InvalidDegist | The Content-MD5 you specified is invalid. | The error message returned because the value of the Content-MD5 header is invalid. | |
InvalidRequestURL | Http request URL format invalid. | 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⑤”. | 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. | The error message returned because the specified XML format is invalid. For more information, see API Reference. | |
MissingAuthorizationHeader | Authorization header is required. | 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. | 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. | The error message returned because one or more request parameters are not specified. For more information, see API Reference. | |
MissingVisibilityTimeout | VisibilityTimeout is required. | The error message returned because one or more request parameters are not specified. For more information, see API Reference. | |
InvalidQueueName | The queue name you provided is invalid. QueueName should start with alpha and contain only alpha, digit or - . | 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. | The error message returned because the specified queue name is invalid. For more information, see API Reference. | |
ReceiptHandleError | The receipt handle you provide is not valid. | The error message returned because one or more request parameters are invalid. For more information, see API Reference. | |
QpsLimitExceeded | The qps limit of the queue is exceeded. | The error message returned because the number of requests per second exceeds the QPS limit. To increase the QPS limit, contact SMQ technical support. | |
TopicNameInvalid | The topic name you provided is invalid. TopicName should start with alpha or digit and contain only alpha, digit or -. | 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. | The error message returned because the specified topic name is invalid. For more information, see API Reference. | |
SubscriptionNameInvalid | The subscription name you provided is invalid. SubscriptionName should start with alpha or digit and contain only alpha, digit or -. | 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. | The error message returned because the specified subscription name is invalid. For more information, see API Reference. | |
EndpointInvalid | The format of endpoint you provided is invalid. | 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. | The error message returned because the message body is oversized. For more information, see API Reference. | |
A subscription's MaximumMessageSize should be greater than the topic's MaximumMessageSize! | The error message returned because the message body in a queue is oversized. You must modify the size of queue messages. The size shall be greater than or equal to the topic's message size. | ||
The XML you provided did not validate against our published schema, cause by Element①. | The error message returned because the specified XML format is invalid. For more information, see API Reference. | ||
The value of Element②should between Low③ and High④ seconds/bytes. | The error message returned because one or more parameters are specified with invalid values. You must specify valid values as prompted. | ||
403 | AccessDenied | The OwnerId that your Access Key Id associated to is forbidden for this operation. | 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. | The error message returned because the AccessKey ID is invalid. Check the AccessKey ID. | |
SignatureDoesNotMatch | The request signature we calculated does not match the signature you provided. Check your key and signing method. | The error message returned because the request signature is invalid. For more information, see Sign requests. | |
404 | MessageNotExist | Message not exist. | The error message returned because no visible message exists in the queue. |
The receipt handle you provided has expired. | 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. | ||
TopicNotExist | The Topic you provided does not exist. | The error message returned because the topic does not exist. You must create a topic. | |
SubscriptionNotExist | The subscription you provided does not exist. | The error message returned because the specified subscription does not exist. You must create a subscription. | |
QueueNotExist | The queue name you provided is not exist. | The error message returned because the specified queue does not exist. You must create a queue. | |
408 | TimeExpired | The http request you sent is expired. | 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. |
409 | SubscriptionAlreadyExist | The subscription you want to create already exists. | The error message returned because the specified subscription has the same name as an existing subscription, but has different parameters from the existing subscription. |
TopicAlreadyExist | The topic you want to create already exists. | The error message returned because the specified topic has the same name as an existing topic, but has different parameters from the existing topic. | |
QueueAlreadyExist | The queue you want to create is already exist. | The error message returned because the specified queue has the same name as an existing queue, but has different parameters from the existing queue. | |
429 | TooManyRequests | The request is denied by cluster flow limiter for too many requests. | If the number of requests exceeds the throttling threshold, the throttling rule is triggered. For more information, see Throttling policy. |
500 | InternalError | Interal error. | The error message returned because a system error occurred. Contact SMQ technical support. |
InternalServerError | Interal error. | The error message returned because a system error occurred. Contact SMQ technical support. |
①②: a parameter in the request body. The content of the request body is in the XML format.
③: the minimum value of a parameter in SMQ.
④: the maximum value of a parameter in SMQ.
⑤: the QueryString parameter in the requested URL.