This topic describes the causes of errors returned with HTTP status code 400 and the solutions to these errors.

InvalidBucketName

  • Error message: The specified bucket is not valid.
  • Cause: The error message returned because the bucket name is invalid.
  • Solution: Check the bucket name and ensure that the name complies with naming conventions.
    A bucket name must comply with the following conventions:
    • The name can contain only lowercase letters, digits, and hyphens (-).
    • The name must start and end with a lowercase letter or digit.
    • The name must be 3 to 63 bytes in length.

InvalidObjectName

  • Error message:
    • The Object name can not be empty.
    • The Length of Object name must be less than 1024.
  • Cause: The error message returned because the object name is invalid.
  • Solution: Check the object name and ensure that the name complies with naming conventions.
    An object name must comply with the following conventions:
    • The name can contain only UTF-8 characters.
    • The name must be 1 to 1,023 bytes in length.
    • The name cannot start with a forward slash (/) or a backslash (\).

TooManyBuckets

  • Error message: You have attempted to create more buckets than allowed.
  • Cause: The error message returned because an Alibaba Cloud account can create up to 100 buckets within a region.
  • Solution: To adjust the maximum number of buckets that an Alibaba Cloud account can create within a region, submit a ticket.

RequestIsNotMultiPartContent

  • Error message: Bucket POST must be of the enclosure-type multipart/form-data.
  • Cause: The error message returned because the Content-Type header in the PostObject request is not multipart/form-data.
  • The form submitted by the PostObject operation must be encoded in multipart/form-data format. The Content-Type header must be in the multipart/form-data;boundary=xxxxxx format, where boundary is a boundary string. For more information, see PostObject.

RequestTimeout

  • Error message: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.
  • Cause: The error message returned because the request times out due to network environment or configurations.
  • Solution: See Network connection timeout troubleshooting to handle the problem.

NotImplemented

  • Error message: A header you provided implies functionality that is not implemented.
  • Cause: The error message returned because the API operation request that you sent contains invalid parameters.
  • Solution: See API overview to specify valid parameters when you call the API operation.

InvalidArgument

  • Error message: Invalid Argument. Parameter is invalid.
  • Cause: The error message returned because the parameter format is invalid.
  • Solution: See API overview to specify valid parameters when you call the API operation.

MaxPOSTPreDataLengthExceededError

  • Error message: Your POST request fields preceding the upload file were too large.
  • Cause: The error message returned because the size of the object that you want to upload by using PostObject is larger than 5 GB.
  • Solution: See PostObject errors and troubleshooting to handle the problem.

FieldItemTooLong

  • Error message: Your name of form field is too long.
  • Cause: The error message returned because the total length of the form fields in the POST request exceeds the limit. Only the file form field can be larger than 4 KB in size.
  • Solution: See PostObject errors and troubleshooting to handle the problem.

MalformedPOSTRequest

  • Error message: The body of your POST request is not well-formed multipart/form-data.
  • Cause: The error message returned because the format of the form field is invalid.
  • Solution: Ensure that the format of the form field is valid.
    A form field must be in the following format:
    Content-Disposition: form-data;
            name="{key}"\r\n\r\n{value}\r\n--{boundary}

    A PostObject request must be in the following format:

    POST / HTTP/1.1
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.6)
    Content-Type: multipart/form-data; boundary=9431149156168
    Host: xxxx-hz.oss-cn-hangzhou.aliyuncs.com
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alive
    Content-Length: 5052
    --9431149156168
    Content-Disposition: form-data; name="key"
    test-key
    --9431149156168
    Content-Disposition: form-data; name="Content-Disposition"
    attachment;filename=D:\img\example.png
    --9431149156168
    Content-Disposition: form-data; name="OSSAccessKeyId"
    2NeL********j2Eb
    A PostObject request must meet the following requirements:
    • The request must contain the Content-Type: multipart/form-data; boundary={boundary} header.
    • The request header and body are separated by \r\n--{boundary}, in which \r\n is displayed as a line feed.
    • The names of form fields are case-sensitive, such as policy, key, file, OSSAccessKeyId, OSSAccessKeyId, and Content-Disposition.
    • The last form field must be file.
    • When the ACL of the bucket is public-read-write, you do not have to specify the following form fields: OSSAccessKeyId, policy, and Signature. If you specify one of these three fields, you must specify the other two fields regardless of whether the ACL of the bucket is public-read-write.
    Note The preceding example is a part of a PostObject request. For the complete request sample, see PostObject.

    For more information about the PostObject request, see the sample code used by OSS SDKs for the following programming languages:

InvalidPolicyDocument

  • Invalid Simple-Condition
    • Error message: Invalid Policy: Invalid Simple-Condition: Simple-Conditions must have exactly one property specified.
    • Cause: The error message returned because the policy header in the request does not contain the conditions field.
    • Solution: Ensure that the policy field contains at least one conditions field.
  • Invalid JSON: unknown char e
    • Error message: Invalid Policy: Invalid JSON: unknown char e.
    • Cause: The error message returned because the format of the policy header in the request is invalid.
    • Solution: Check whether double quotation marks (") are missing in the policy header and whether a backslash (\) is added before each escape character.
  • Invalid JSON: , or ] expected
    • Error message: Invalid Policy: Invalid JSON: , or ] expected.
    • Cause: The error message returned because the format of the policy header in the request is invalid.
    • Solution: Check whether commas (,) or right brackets (]) are missing in the policy header.

IncorrectNumberOfFilesInPOSTRequest

  • Error message: POST requires exactly one file upload per request.
  • Cause: The error message returned because the number of files in the PostObject request is invalid. A PostObject request can only contain a single file form field.
  • Solution: Ensure that the PostObject request only contains a single file form field.

EntityTooSmall

  • Error message: Your proposed upload smaller than the minimum allowed size.
  • Cause: The error message returned because the size of the object to upload is smaller than minimum value.
  • Solution: When you call PostObject to upload files, configure the Post policy to specify the valid values of form fields. You can configure the content-length-range condition to specify the maximum and minimum size of the object to upload.

EntityTooLarge

  • Error message:
    • Your proposed upload exceeds the maximum allowed size.
    • Source object Length exceeds the maximum allowed size.
  • Cause: The error message returned because the size of the object to upload is larger than minimum value.
  • Solution: When you call PostObject to upload files, configure the Post policy to specify the valid values of form fields. You can configure the content-length-range condition to specify the maximum and minimum size of the object to upload.

MalformedXML

InvalidTargetBucketForLogging

  • Error message: Put bucket log requester is not target bucket owner.
  • Cause: The error message returned because the destination bucket specified to store logs does not exist.
  • Solution: Specify a valid destination bucket.

InvalidPart

  • Error message: One or more of the specified parts could not be found or the specified entity tag might not have matched the part's entity tag.
  • The error message returned because a part uploaded by CompleteMultipartUpload has an invalid PartNumber or ETag.
  • Solution: See CompleteMultipartUpload to handle the problem.

FilePartNotExist

  • Error message: The Part you read had been deleted.
  • The error message returned because a part submitted by CompleteMultipartUpload has been deleted.
  • Solution: See CompleteMultipartUpload to handle the problem.

InvalidPartOrder

  • Invalid part order
    • Error message: The list of parts was not in ascending order.
    • Cause: The error message returned because the partNumbers of the parts submitted by CompleteMultipartUpload are not in ascending order.
    • Solution: See CompleteMultipartUpload to handle the problem.
  • Invalid partNumber value
    • Error message: Part number must be an integer between 1 and 10000, inclusive.
    • Cause: The error message returned because the value of partNumber is invalid. The range of valid values of partNumber is 1 to 10000.
    • Solution: See CompleteMultipartUpload to handle the problem.

InvalidEncryptionAlgorithmError

  • Error message: The encryption algorithm specified is not valid.
  • Cause: The error message returned because the specified value of x-oss-server-side-encryption is invalid. Valid values of x-oss-server-side-encryption: AES256 and KMS.
  • Solution: See PutObject to handle the problem.

InvalidDigest

  • Error message: The Content-MD5 you specified was invalid.
  • Cause: The error message returned because the value of Content-MD5 in the request is not consistent with the MD5 hash of the uploaded data.
  • Solution: See PutObject to handle the problem.

InvalidTargetType

  • Error message: The symbolic's target file type is invalid.
  • Cause: The error message returned because the object is a symbolic link and the object that the link points to is also a symbolic link.
  • Solution: Ensure that the object that the link points to is not a symbolic link.