Error handling
When PDS cannot process an API request, it returns an error response that identifies the failure. This topic describes the formats that PDS uses for error responses and lists the common error codes that the PDS service returns.
To troubleshoot a failed request, first determine which layer reported the error, and then look up the error code:
A JSON response body that contains
CodeandMessageindicates that the PDS service reported the error. Look up the value ofCodein Common error codes.A response that has no JSON error body but carries the
x-ca-error-codeandx-ca-error-messageheaders indicates that the gateway layer reported the error. For the meaning of each header, see Gateway error response. Thex-ca-request-idheader is returned for both kinds of error response, so you cannot use it to tell the two apart.
Error response format
Service error response
If an error occurs while PDS processes a request, PDS returns an error response in the following format:
{
"Message": "The input parameter file_id is not valid.",
"RequestId": "772328B2-E5F4-453C-9C23-CCCCCCCC",
"Code": "InvalidParameter"
}The HTTP status code of the response varies with the error. The response body contains the following fields:
Code— The error code, which indicates the type of the error.Message— The error message, which indicates the cause of the error and how to resolve it.RequestId— The unique ID of the request. When you call an API operation, this value is returned in thex-ca-request-idresponse header.
Gateway error response
In a small number of scenarios, the gateway layer reports the error. In this case, the error code and the error message are returned in response headers instead of a JSON response body:
x-ca-error-code: D504TO
x-ca-error-message: timeout
x-ca-request-id: 772328B1-E5F4-453C-9C23-CCCCCCCCThe response contains the following headers:
x-ca-error-code— The error code, which indicates the type of the error.x-ca-error-message— The error message, which indicates the cause of the error and how to resolve it.x-ca-request-id— The unique ID of the request.
Common error codes
The following tables list the common error codes that the PDS service returns in the Code field of an error response body, grouped by the kind of problem that they report. These error codes cover most of the errors that may occur. Error codes that the gateway layer returns in the x-ca-error-code header are not listed in this topic. When you read the tables, note the following points:
In an actual response, PDS replaces each placeholder in braces with a specific value.
{parameter_name}corresponds to the field name, and{resource_name}corresponds to the resource type.The HTTP status code column shows the HTTP status code of the response.
The information in the Message column may differ slightly from the actual response, usually to indicate more specific error information.
Parameter and request errors
The following table lists the PDS error codes that indicate a problem with the parameters, headers, body, or HTTP method of the request.
HTTP status code | Code | Message |
400 |
| The input parameter {parameter_name} is not valid. |
400 |
| The input parameter {parameter_name} is empty. |
400 |
| The input parameter {parameter_name} has an invalid format. |
400 |
| The input parameter {parameter_name} is not in a valid JSON format. |
400 |
| The input parameter {parameter_name} is not supported. |
400 |
| The input parameter {parameter_name} is missing. |
400 |
| The input parameter {parameter_name} does not match. |
400 |
| The input parameter {parameter_name} does not match the limitation. |
400 |
| The input parameter {parameter_name} is expired. |
400 |
| The header {header_name} is not valid. |
400 |
| The input parameter relative_path is nested inside another relative_path: {path}. |
400 |
| Failed to read the request body. |
405 |
| The HTTP method of the request is not supported for this resource. See the API documentation for the supported methods. |
Resource and state errors
The following table lists the PDS error codes that indicate a problem with the target resource or with the current state of the resource.
HTTP status code | Code | Message |
400 |
| The resource {resource_name} has exceeded the limit. |
400 |
| The resource {resource_name} is not valid. |
400 |
| The resource {resource_name} is not supported. |
400 |
| The resource {resource_name} is not empty. |
400 |
| The resource {resource_name} already exists. |
400 |
| Multiple objects with the same sha1 value were found. |
400 |
| The current status does not support this operation. |
400 |
| The user operation is not valid. Try again later. |
404 |
| The resource {resource_name} is empty. |
404 |
| The resource {resource_name} cannot be found. |
Authentication, permission, and account errors
The following table lists the PDS error codes that indicate that the request was rejected because of a credential, permission, or account problem.
HTTP status code | Code | Message |
400 |
| SignatureDoesNotMatch. |
403 |
| The user is not authorized to operate on the specified API operations. |
403 |
| No permission to access the resource {resource_name}. |
403 |
| The specified account does not exist. |
403 |
| The specified account is in debt. |
403 |
| Cannot access the specified service role. |
403 |
| This operation is forbidden by the Alibaba Cloud RiskControl system. |
403 |
| This operation is forbidden for a file in the recycle bin. |
Throttling and server errors
The following table lists the PDS error codes that indicate that PDS throttled the request or could not complete it.
HTTP status code | Code | Message |
400 |
| The operation is blocked due to throttling control. |
500 |
| The request failed due to an unknown error. Try again later. |
503 |
| The request failed due to a temporary failure of the server. Try again later. |
Contact us
Every PDS error response identifies the request that failed: both kinds of error response return the ID in the x-ca-request-id header, and a service error response also exposes the ID in the RequestId field of the response body. Record this ID before you report an error that you cannot resolve.
If you have any questions, feel free to contact us.