If an error occurs when you access Object Storage Service (OSS), OSS returns error information, such as the HTTP status code, error message, request ID, and error code. You can identify and resolve the issue based on the returned information.
Error response headers
HTTP/1.1 403 Forbidden
Server: AliyunOSS
Date: Wed, 09 Nov 2022 08:45:46 GMT
Content-Type: application/xml
Content-Length: 471
Connection: keep-alive
x-oss-request-id: 636B68BA80DA8539399F****
x-oss-server-time: 0
x-oss-ec: 0003-00000001
The following table describes the error response headers.
Response header | Description |
x-oss-ec | A fine-grained error code in OSS. Each error cause corresponds to a unique error code. Compared with Code in the XML error response body, the error code can more accurately reflect the cause of the request error and facilitate retrieval of the corresponding solution. If a request error occurs, an error code is included in the response header x-oss-ec and the XML response body (in the EC child element of the Error element). You can use the x-oss-ec header to find the cause and solution of the error. Important You can use an error code only to identify issues. An error code does not ensure forward compatibility because the error code may change. Therefore, do not develop business logic that relies on error codes. |
For more information about common error response headers such as Content-Length, Connection, and x-oss-request-id, see Common response headers.
Error response body
<?xml version="1.0" ?>
<Error xmlns="http://doc.oss-cn-hangzhou.aliyuncs.com">
<Code>MalformedXML</Code>
<Message>The XML you provided was not well-formed or did not validate against our published schema.</Message>
<RequestId>57ABD896CCB80C366955****</RequestId>
<HostId>oss-cn-hangzhou.aliyuncs.com</HostId>
<EC>0031-00000001</EC>
<RecommendDoc>https://api.aliyun.com/troubleshoot?q=0031-00000001</RecommendDoc>
</Error>
The following table describes the response elements that are included in the preceding error response body.
Response element | Description |
Code | The error code that is returned in the error response body. |
Message | The error message that is returned in the error response body. |
RequestId | The UUID that is used to identify the request. If an issue occurs, provide the request ID when you contact technical support to identify and resolve the issue. |
HostId | The ID of a host in the accessed OSS cluster. The ID is the same as the host ID specified in the request. |
EC | A fine-grained error code in OSS. Each error cause corresponds to a unique error code. Compared with Code in the XML error response body, the error code can more accurately reflect the cause of the request error and facilitate retrieval of the corresponding solution. If a request error occurs, an error code is included in the response header x-oss-ec and the XML response body (in the EC child element of the Error element). You can use the x-oss-ec header to find the cause and solution of the error. Important You can use an error code only to identify issues. An error code does not ensure forward compatibility because the error code may change. Therefore, do not develop business logic that relies on error codes. |
RecommendDoc | The link to the troubleshooting topic specific to the error code in OpenAPI Explorer. You can click the link to troubleshoot the error on the page. |