0005-00000416

更新时间:
复制 MD 格式

Problem description

The x-oss-meta-client-side-encryption-magic-number-hmac request header has an unexpected value in an UploadPart request for client-side encryption.

Cause

For client-side encryption, if you set the x-oss-meta-client-side-encryption-wrap-alg request header to rsa in an InitiateMultipartUpload request, you must also include the x-oss-meta-client-side-encryption-magic-number-hmac request header. Subsequent UploadPart requests must include this header with the same value. This error occurs if the header value in the UploadPart request is different from the value specified in the InitiateMultipartUpload request.

Example problem

For example, you send an InitiateMultipartUpload request:

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-wrap-alg: rsa
x-oss-meta-client-side-encryption-magic-number-hmac: value1

Then, you send an UploadPart request:

PUT /multipart.data?partNumber=1&uploadId=0004B9895DBBB6EC9****  HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Length: 6291456
Date: Wed, 22 Feb 2012 08:32:21 GMT
Authorization: OSS qn6q**************:77Dv****************
x-oss-meta-client-side-encryption-wrap-alg: rsa
x-oss-meta-client-side-encryption-magic-number-hmac: value2
[6291456 bytes data]

The request failed because the value of the x-oss-meta-client-side-encryption-magic-number-hmac request header is invalid.

Solution

Make sure that the value of the x-oss-meta-client-side-encryption-magic-number-hmac header in the UploadPart request is the same as the value specified in the InitiateMultipartUpload request.

References