Error responses

更新时间:
复制 MD 格式

When an OSS request fails, the service returns an error response that includes an HTTP status code, a service-specific error code (EC), and an XML body describing the issue.

Self-troubleshooting process

Step 1: Locate key information

A typical error response contains the fields needed to diagnose the issue. Start with the Message field, then check the following fields. Example:

HTTP/1.1 400 Bad Request
Server: AliyunOSS
Date: Thu, 11 Aug 2019 01:44:54 GMT
Content-Type: application/xml
Content-Length: 322
Connection: keep-alive
x-oss-request-id: 57ABD896CCB80C366955****
x-oss-server-time: 0
<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>MissingArgument</Code>
  <Message>Missing Some Required Arguments.</Message>
  <RequestId>57ABD896CCB80C366955****</RequestId>
  <HostId>oss-example.oss-cn-hangzhou.aliyuncs.com</HostId> 
  <EC>0016-00000502</EC> 
  <RecommendDoc>https://api.aliyun.com/troubleshoot?q=0016-00000502</RecommendDoc>
</Error>
  • RecommendDoc (recommended): A direct link to the official troubleshooting guide for the specific error.

  • EC: A fine-grained error code that corresponds to a specific cause of the error.

  • HTTP status code (such as 400 Bad Request): Indicates whether the error is client-side or server-side.

  • RequestId (Required for support): The unique ID of the request. You must provide this ID when you contact technical support.

Step 2: Obtain the solution

Use one of the following methods to find a solution:

  1. Access the RecommendDoc link

    • Go to the RecommendDoc link provided in the error response.

  2. Check the EC error code list

    • If the response does not contain a RecommendDoc link, look up the EC in the error code list.

If the issue persists, contact technical support with the required information.

To expedite troubleshooting, always provide the full request ID when contacting support. For more information, see Obtain a request ID.

Error response structure

Error response headers

Response header

Description

x-oss-ec

A fine-grained error code unique to each error condition. More precise than the general-purpose Code element, helping you identify root causes faster.

Important

The EC field is for diagnostic purposes only. Its value may change without notice, and backward compatibility is not guaranteed. Do not build application logic that depends on specific EC values.

x-oss-request-id

The unique ID of the request. Provide this ID when contacting technical support.

Example of 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

For more information, see Common response headers.

Error response body

Element

Description

Code

A general-purpose error code defined by OSS.

Message

A detailed description of the error.

RequestId

The unique ID of the request. Provide this ID when contacting technical support.

HostId

The OSS cluster that handled the request, matching the host in your request.

EC

The fine-grained error code, which is the same as the x-oss-ec in the response header.

RecommendDoc

A link to the interactive troubleshooting guide in OpenAPI Explorer. Recommended as the first troubleshooting step.

Example of a 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>

References