If an error occurs when you access Object Storage Service (OSS), OSS returns an error code, an error message, and a request ID in the message body of an error response. You can identify and resolve the issue based on the response.
Response message body
The following code provides an example of the message body of an error response:
<?xml version="1.0" ?>
<Error xmlns="http://doc.oss-cn-hangzhou.aliyuncs.com">
<Code>
AccessDenied
</Code>
<Message>
Query-string authentication requires the Signature, Expires and OSSAccessKeyId parameters
</Message>
<RequestId>
1D842BC54255****
</RequestId>
<HostId>
oss-cn-hangzhou.aliyuncs.com
</HostId>
</Error>
The message body of an error response contains the following elements:
Code
: the error code returned by OSS.Message
: the detailed error message returned by OSS.RequestId
: the UUID that uniquely identifies the request. You can provide the request ID to contact technical support to identify and resolve the issue. For more information about how to obtain the ID of a request, see Obtain request IDs.HostId
: the ID of the host in the accessed OSS cluster, which is the same as the host ID specified in the request.
Sample invalid requests and responses
If parameters that are not supported by OSS are added to requests to call operations supported by OSS, for example, the If-Modified-Since parameter is added to a PUT request, OSS returns 400 Bad Request
.
Sample invalid requests:
PUT /abc.zip HTTP/1.1
Host: bucketname.oss-cn-shanghai.aliyuncs.com
Accept: */*
Date: Thu, 11 Aug 2019 01:44:50 GMT
If-Modified-Since: Thu, 11 Aug 2019 01:43:51 GMT
Content-Length: 363
Sample responses:
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>NotImplemented</Code>
<Message>A header you provided implies functionality that is not implemented.</Message>
<RequestId>57ABD896CCB80C366955****</RequestId>
<HostId>bucketname.oss-cn-shanghai.aliyuncs.com</HostId>
<Header>If-Modified-Since</Header>
</Error>
For more information about error codes, see Object Storage Service - Error code.