All Products
Search
Document Center

:How do I fix the InvalidPart error for a multipart upload to OSS?

Last Updated:Aug 05, 2024

Problem description

A multipart upload of a file smaller than 100 KB to Object Storage Service (OSS) succeeded, but a multipart upload of a file larger than 100 KB failed with an InvalidPart code and the following 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

Cause

A part is found invalid during the CompleteMultipartUpload operation due to an invalid part number (PartNumber) or entity tag (ETag) specified in the request.

Solution

After all parts of an object are uploaded, you must call the CompleteMultipartUpload operation to complete the multipart upload. OSS checks whether the specified part numbers and ETags meet the following conditions when you call the CompleteMultipartUpload operation:

  • The value of the PartNumber parameter must be within the range of 1 to 10000. Part numbers must appear in ascending order. Part numbers do not have to be consecutive numbers. For example, the first part can have a part number of 1 and the second part can have a part number of 5.

  • The ETag of an object that is created by the CompleteMultipartUpload operation is a unique value that is generated based on specific rules, not the MD5 value of the object content. The ETag can be used to check for changes in object content. We recommend that you do not use the ETag as the MD5 value of the object for integrity verification.

    Note
    • The ETag of an object that is created by the PutObject operation is the MD5 value of the object content.

    • The ETag of an object that is created by using other methods is a unique value that is generated based on specific rules.

For more information, see CompleteMultipartUpload.