OSS error response

Last Updated: Jul 29, 2017

If an error occurs when a user accesses the OSS, the OSS returns the error code and error message, so that the user can locate the problem and handle it properly.

OSS error response format

If an error occurs when the user accesses the OSS, the OSS returns an HTTP status code 3xx, 4xx, or 5xx and a message body in application/xml format.

Example of the message body for an error returned:

  1. <?xml version="1.0" ?>
  2. <Error xmlns=”http://doc.oss-cn-hangzhou.aliyuncs.com”>
  3. <Code>
  4. AccessDenied
  5. </Code>
  6. <Message>
  7. Query-string authentication requires the Signature, Expires and OSSAccessKeyId parameters
  8. </Message>
  9. <RequestId>
  10. 1D842BC5425544BB
  11. </RequestId>
  12. <HostId>
  13. oss-cn-hangzhou.aliyuncs.com
  14. </HostId>
  15. </Error>

All error message bodies include the following elements:

  • Code: the error code that OSS returns to the user.
  • Message: the detailed error message provided by OSS.
  • RequestId: the UUID that uniquely identifies a request. When you cannot solve the problem, you can seek help from OSS development engineers by providing the RequestId.
  • HostId: used to identify the accessed OSS cluster, which is consistent with the Host ID carried in the user request.

For special error information elements, see specific request descriptions.  

OSS error codes

The following table lists the OSS error codes:

Error Code Description HTTP Status Code Description
AccessDenied Access is denied. 403 To learn the cause and for troubleshooting, see Permission and Troubleshooting.
BucketAlreadyExists The bucket already exists. 409 The bucket name specified by the PutBucket operation has been used. Please select a new bucket name.
BucketNotEmpty The bucket is not empty. 409 Before you perform a DeleteBucket operation, first delete the files and unfinished multipart upload tasks in the bucket.
CallbackFailed Upload callback fails. 203 To learn the cause and troubleshooting, see Upload Callback Error and Troubleshooting.
EntityTooLarge The entity is too large. 400 The message length of the Post request exceeds 5GB. To learn the cause and for troubleshooting, see Post Object Error and Troubleshooting.
EntityTooSmall The entity is too small. 400 The message length of the Post request is too short. For troubleshooting, see Post Object Error and Troubleshooting.
FieldItemTooLong The form field in the Post request is too large 400 The size of all the form fields, except the ‘file’, should not exceed 4KB. For troubleshooting, see Post Object Error and Troubleshooting.
FilePartInterity The file part has changed. 400 The data and the checksum are not consistent during partition data reading.
FilePartNotExist The file part does not exist. 400 The partitions submitted by the Complete Multipart Upload operation are not uploaded.
FilePartStale The file part times out. 400 The data and the length are not consistent during partition data reading.
IncorrectNumberOfFilesInPOSTRequest The number of files in the Post request is invalid. 400 Only one ‘file’ field is allowed in the form fields of the Post request. For troubleshooting, see Post Object Error and Troubleshooting.
InvalidArgument The parameter format is incorrect. 400 The parameter format does not comply with the requirements. Please follow the instructions of corresponding API.
InvalidAccessKeyId The AccessKeyId does not exist. 403 The AccessKeyId is invalid or has timed out. For troubleshooting, see 403 Error and Troubleshooting.
InvalidBucketName Invalid bucket name. 400 For the bucket naming rules, see Developer Guide.
InvalidDigest Invalid digest. 400 The specified MD5 checksum is inconsistent with the file. For MD5 calculations, see Put Object.
InvalidEncryptionAlgorithmError The specified entropy encryption algorithm is incorrect. 400 Currently only the ‘AES256’ encryption algorithm is supported. For details, see Put Object.
InvalidObjectName Invalid object name. 400 For the object naming rules, see Developer Guide.
InvalidPart Invalid part. 400 The part submitted by the Complete Multipart Upload operation is invalid. The ‘PartNumber’ or the ‘ETag’ is incorrect.
InvalidPartOrder Invalid part sequence. 400 The parts submitted by the Complete Multipart Upload operation should be in an ascending sort order of the part number.
InvalidPolicyDocument Invalid policy document. 400 The ‘Policy’ in the Post request is invalid. For troubleshooting, see Post Object Error and Troubleshooting.
InvalidTargetBucketForLogging An invalid target bucket exists in the logging operation. 400 The target bucket for storing the Logging does not exist. Please change it.
InternalError An error occurs in OSS. 500 Please try again.
MalformedXML XML format is invalid. 400 The XML in the request is invalid. Please exclude DeleteObjects, CompleteMultipartUpload, PutBucketLogging, PutBucketWebsite, PutBucketLifecycle, PutBucketReferer, and PutBucketCORS according to specific requests.
MalformedPOSTRequest The body format of the Post request is invalid. 400 The form field format is invalid. For troubleshooting, see Post Object Error and Troubleshooting.
MaxPOSTPreDataLengthExceededError The size of the body outside the uploaded file content of the Post request is too large. 400 The size of all the form fields, except the file, should not exceed 4 KB. For troubleshooting, see Post Object Error and Troubleshooting.
MethodNotAllowed Unsupported method. 405 Access the resource with a method not supported by OSS.
MissingArgument Missing argument. 411 See the specific API for resolution.
MissingContentLength Missing content length. 411 The message is not of the chunked encoding and does not carry the ‘Content-Length’.
NoSuchBucket The bucket does not exist. 404
NoSuchKey The object does not exist. 404
NoSuchUpload The multipart upload ID does not exist. 404 No Initialize Multipart Upload or the initialized Multipart Upload Expires.
NotImplemented The method cannot be implemented. 400 Operation not supported by OSS.
ObjectNotAppendable Not an appendable file. 409 OSS has three files types: normal, appendable and multipart. Only the appendable type of file can execute the Append Object operation.
PositionNotEqualToLength The appending position does not match the file length. 409 For details, see Append Object.
PreconditionFailed Pre-processing error. 412 The downloading conditions are not met. For details, see Get Object.
RequestTimeTooSkewed The request initiation time exceeds the server time by 15 minutes. 403 For troubleshooting, see 403 Error and Troubleshooting.
RequestTimeout The request times out. 400 Please try again.
RequestIsNotMultiPartContent The content-type of the Post request is invalid. 400 For troubleshooting, see Post Object Error and Troubleshooting.
DownloadTrafficRateLimitExceeded The downloading traffic exceeds the limit. 503 The default ceiling is 5GB, including the intranet traffic and internet traffic. To adjust the ceiling, please open a ticket.
UploadTrafficRateLimitExceeded The uploading traffic exceeds the limit. 503 The default ceiling is 5GB, including the intranet traffic and internet traffic. To adjust the ceiling, please open a ticket.
SignatureDoesNotMatch Signature error. 403 For troubleshooting, see Signature in Header and Signature in URL.
TooManyBuckets The number of buckets exceeds the limit. 400 The default ceiling is 10. To adjust the ceiling, please open a ticket.

OSS common errors and troubleshooting

SDK/Tool common errors and troubleshooting

Operations not supported by OSS

If an operation not supported by the OSS is used to access a resource, the OSS returns error 405 Method Not Allowed.

Example of an invalid request:

  1. ABC /1.txt HTTP/1.1
  2. Host: bucketname.oss-cn-shanghai.aliyuncs.com
  3. Date: Thu, 11 Aug 2016 03:53:40 GMT
  4. Authorization: signatureValue

Response example:

  1. HTTP/1.1 405 Method Not Allowed
  2. Server: AliyunOSS
  3. Date: Thu, 11 Aug 2016 03:53:44 GMT
  4. Content-Type: application/xml
  5. Content-Length: 338
  6. Connection: keep-alive
  7. x-oss-request-id: 57ABF6C8BC4D25D86CBA5ADE
  8. Allow: GET DELETE HEAD PUT POST OPTIONS
  9. <?xml version="1.0" encoding="UTF-8"?>
  10. <Error>
  11. <Code>MethodNotAllowed</Code>
  12. <Message>The specified method is not allowed against this resource.</Message>
  13. <RequestId>57ABF6C8BC4D25D86CBA5ADE</RequestId>
  14. <HostId>bucketname.oss-cn-shanghai.aliyuncs.com</HostId>
  15. <Method>abc</Method>
  16. <ResourceType>Bucket</ResourceType>
  17. </Error>

Note: If the accessed resource is /bucket/, ResourceType should be set to bucket. If the accessed resource is /bucket/object, ResourceType should be set to object.  

Operations supported by the OSS but not supported by parameters

If parameters not supported by the OSS are added to an operation supported by the OSS (for example, an If-Modified-Since parameter is added to the PUT operation), the OSS returns error 400 Bad Request.

Example of an invalid request:

  1. PUT /abc.zip HTTP/1.1
  2. Host: bucketname.oss-cn-shanghai.aliyuncs.com
  3. Accept: */*
  4. Date: Thu, 11 Aug 2016 01:44:50 GMT
  5. If-Modified-Since: Thu, 11 Aug 2016 01:43:51 GMT
  6. Content-Length: 363

Response example:

  1. HTTP/1.1 400 Bad Request
  2. Server: AliyunOSS
  3. Date: Thu, 11 Aug 2016 01:44:54 GMT
  4. Content-Type: application/xml
  5. Content-Length: 322
  6. Connection: keep-alive
  7. x-oss-request-id: 57ABD896CCB80C366955187E
  8. x-oss-server-time: 0
  9. <?xml version="1.0" encoding="UTF-8"?>
  10. <Error>
  11. <Code>NotImplemented</Code>
  12. <Message>A header you provided implies functionality that is not implemented.</Message>
  13. <RequestId>57ABD896CCB80C366955187E</RequestId>
  14. <HostId>bucketname.oss-cn-shanghai.aliyuncs.com</HostId>
  15. <Header>If-Modified-Since</Header>
  16. </Error>
Thank you! We've received your feedback.