If the response that is returned by Log Service contains error information after you call an API operation, the call fails. This topic describes the error codes that are returned when API calls fail. You can handle errors based on the error codes.

Overview

If an error occurs when you send an API request to Log Service, Log Service returns error information that consists of an HTTP status code and error details. The error details are included in the HTTP response body in the following format:

{
"errorCode" : <ErrorCode>,
"errorMessage" : <ErrorMessage>
}

You can handle errors based on the descriptions in this topic. You can also go to the API Error Center to view the details of error codes. For more information about the error codes of Log Service, visit the API Error Center.

Operation-specific error codes

Each API operation has a set of operation-specific error codes. The operation-specific error codes of API operations are described in the corresponding API reference topic.

Common error codes

The common error codes that are returned by Log Service are applicable to most API operations. The following table describes the common error codes that are returned when API calls fail.

Note Log Service provides the common error messages that are returned when you query and analyze logs and the corresponding solutions. For more information, see How do I resolve common errors that occur when I query and analyze log data?.
HTTP status codeError codeError messageDescriptionSolution
400RequestTimeExpiredRequest time requestTime has been expired while server time is server time.The error message returned because the request is initiated more than 15 minutes before or after the Log Service time. Check the requester time and try again later.
400InvalidRequestTimeRequest time requestTime not follow RFC822 spec.The error message returned because the value of the Date header in the request does not comply with RFC 822. Check the request headers and make sure that the value of the Date header complies with RFC 822.
400InvalidHostHost header Host is invalid.The error message returned because the value of the Host header in the request is invalid. Check the request headers and make sure that the value of the Host header is valid.
400ProjectAlreadyExistProject ProjectName already exist.The error message returned because the specified project already exists. The name of the project must be unique in a region. Specify a new project and try again.
400PostBodyInvalidThe request body is not valid JSON object.The error message returned because the body of the request is not in the JSON format. Adjust the request body and initiate the request again.
400InvalidContentTypeContent-Type type is unsupported.The error message returned because the value of the Content-Type header is invalid. Make sure that the value of the Content-Type header is valid.
400ParameterInvalidHttp extend authorization : authorization pair is invalid.The error message returned because the value of the Authorization header is invalid. Make sure that the value of the Authorization header is valid.
Http extend x-log-bodyrawsize : x-log-bodyrawsize pair is invalid.The error message returned because the value of the x-log-bodyrawsize header is invalid. Make sure that the value of the x-log-bodyrawsize header is valid.
Http extend x-log-compresstype : x-log-compresstype pair is invalid.The error message returned because the value of the x-log-compresstype header is invalid. Make sure that the value of the x-log-compresstype header is valid.
x-log-signaturemethod: x-log-signaturemethod pair is invalid.The error message returned because the value of the x-log-signaturemethod header is invalid. Make sure that the value of the x-log-signaturemethod header is valid.
400MissingParameterMissing query key : parameter.The error message returned because the required request parameters are missing. Specify the required request parameters and try again. For information about the signature structure and the process of calculating a signature, see Request signatures.
Missing http extend header key : authorization.The error message returned because the Authorization header is missing in the request. Specify the Authorization header in the request and try again. For information about the signature structure and the process of calculating a signature, see Request signatures.
Missing http extend header key : x-log-bodyrawsize.The error message returned because the x-log-bodyrawsize header is missing in the request. Specify the x-log-bodyrawsize header in the request and try again. For information about the signature structure and the process of calculating a signature, see Request signatures.
Missing http extend header key : x-log-date.The error message returned because the x-log-date header is missing in the request. Specify the x-log-date header in the request and try again. For information about the signature structure and the process of calculating a signature, see Request signatures.
Missing http extend header key : x-log-signaturemethod.The error message returned because the x-log-signaturemethod header is missing in the request. Specify the x-log-signaturemethod header in the request and try again. For information about the signature structure and the process of calculating a signature, see Request signatures.
401SignatureNotMatchSignature signature not matched.The error message returned because the digital signature that is calculated by the client does not match the signature that is calculated by Log Service. Try again, or replace the AccessKey pair and try again. Possible causes:
  • The AccessKey pair or Security Token Service (STS) token has expired. In this case, you must check whether the AccessKey pair or STS token is valid.
  • The version of Log Service SDK that is deployed is earlier than required. In this case, you can log on to GitHub to obtain open source code and references. For more information, see Overview of Log Service SDKs.
401UnauthorizedThe AccessKeyId is unauthorized.The error message returned because the specified AccessKey ID does not have the required permissions. Make sure that the AccessKey ID has access permissions on Log Service. For information about how to grant a RAM user the permissions to manage Log Service resources, see Create a RAM user and authorize the RAM user to access Log Service.
The security token you provided is invalid.The error message returned because the STS token is invalid. Check the STS request and make sure that the STS token is valid.
The security token you provided has expired.The error message returned because the STS token has expired. Apply for a new STS token and initiate the request again.
AccessKeyId not found: AccessKey IDThe error message returned because the AccessKey ID does not exist. Replace your AccessKey ID and initiate the request again.
AccessKeyId is disabled: AccessKey IDThe error message returned because the AccessKey ID is disabled. Make sure that your AccessKey ID is enabled and initiate the request again.
Your SLS service has been forbidden.The error message returned because Log Service is suspended for your Alibaba Cloud account. Make sure that your Alibaba Cloud account has no overdue payments.
The project does not belong to you.The error message returned because the project does not belong to the current user. Change the project or user and try again.
401InvalidAccessKeyIdThe access key id you provided is invalid: AccessKey ID.The error message returned because the AccessKey ID is invalid. Check your AccessKey ID and make sure that the AccessKey ID is valid.
Your SLS service has not opened. The error message returned because Log Service is not activated. Log on to the Log Service console or call the Log Service API to activate Log Service. Then, initiate the request again. For more information, see Activate Log Service.
403WriteQuotaExceedWrite quota is exceeded.The error message returned because the number of logs that are written to Log Service exceeds the quota. Optimize the settings for the request to reduce the number of logs to write. For more information, see Limits.
403ReadQuotaExceedRead quota is exceeded.The error message returned because the number of logs that are read from Log Service exceeds the quota. Optimize the settings for the request to reduce the number of logs to read. For more information, see Limits.
403MetaOperationQpsLimitExceededQps limit for the meta operation is exceeded.The error message returned because the default QPS limit is exceeded. Optimize the settings for the request to reduce the number of operations. We recommend that you try again after a few seconds.
Log Service limits the QPS for the following management API operations:
  • Project-related API operations
  • Logstore-related API operations
  • Index-related API operations
  • Other API operations that do not read or write data
For more information, see Limits.
403ProjectForbiddenProject ProjectName has been forbidden.The error message returned because the specified project is disabled. Check the project status. The account to which the project belongs may have overdue payments.
404ProjectNotExistThe Project does not exist : nameThe error message returned because the specified project does not exist. Check the project name and make sure that the project exists.
405InvalidMethodInvalid request method : request URIThe error message returned because the HTTP request method is invalid. Check the HTTP request method and try again.
413PostBodyTooLargeBody size bodysize must little than 10485760.The error message returned because the size of the request body exceeds 10 MB. Make sure that the size of the request body is less than or equal to 10 MB and try again.
500InternalServerErrorInternal server error message.The error message returned because an internal server error has occurred. Try again later.
500RequestTimeoutThe request is timeout. Please try again later.The error message returned because the request timed out. Try again later.
503ServerBusyThe server is busy, please try again later.The error message returned because the server is busy. Try again later.
Note The italic part in an error message indicates specific error objects. For example, name in the ProjectNotExist error message is replaced by a specific project name.