0005-00000411

更新时间:
复制 MD 格式

Problem description

The number of parts specified in a CompleteMultipartUpload request does not match the expected number of parts during client-side encryption.

Causes

In a client-side encryption scenario, you must specify the expected data size and part size in the InitiateMultipartUpload request. The server uses these values to calculate the expected number of parts. This error occurs if the number of parts in the CompleteMultipartUpload request exceeds the calculated number.

Example problems

For example, you send an InitiateMultipartUpload request where the expected data size is 1,000,000 B and the expected part size is 500,000 B:

POST /multipart.data?uploads HTTP/1.1 
Host: oss-example.oss-cn-hangzhou.aliyuncs.com 
Date: Wed, 22 Feb 2012 08:32:21 GMT 
x-oss-storage-class: Archive
Authorization: OSS qn6q**************:77Dv****************
x-oss-meta-client-side-encryption-data-size: 1000000
x-oss-meta-client-side-encryption-part-size: 500000

A simple calculation shows that the expected number of parts is 2. You then send a CompleteMultipartUpload request that specifies 3 parts:

POST /multipart.data?uploadId=0004B9B2D2F7815C432C9057C031****&encoding-type=url HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Length: 1056
Date: Fri, 24 Feb 2012 10:19:18 GMT
Authorization: OSS qn6q**************:77Dv****************
<CompleteMultipartUpload> 
    <Part> 
        <PartNumber>1</PartNumber>  
        <ETag>"3349DC700140D7F86A0784842780****"</ETag> 
    </Part>  
    <Part> 
        <PartNumber>5</PartNumber>  
        <ETag>"8EFDA8BE206636A695359836FE0A****"</ETag> 
    </Part>  
    <Part> 
        <PartNumber>8</PartNumber>  
        <ETag>"8C315065167132444177411FDA14****"</ETag> 
    </Part> 
</CompleteMultipartUpload>

The request fails because the number of parts specified exceeds the expected number.

Solutions

  1. Adjust the number of parts in the CompleteMultipartUpload request to match or be less than the expected number.

  2. Adjust the data size and part size in the InitiateMultipartUpload request to allow for a larger number of parts.

References