Actions
Bug #48554
closedWhen copying an encrypted object, the result object is empty.
Status:
Resolved
Priority:
Normal
Assignee:
Or Friedmann
Target version:
-
% Done:
0%
Source:
Tags:
Backport:
octopus nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Description
When I use UploadPartCopyRequest to copy an encrypted object without a key, the request succeeds, but the result object is empty.
However, AWS S3 returns the 400 error with the message "The object was stored using server-side encryption format. You must provide the correct parameters to retrieve the object."
bucket = get_new_bucket()
content = 'fooz'
srcobj = 'testobj_enc'
content_type = 'text/plain'
encrypt_headers = {
'x-amz-server-side-encryption-customer-algorithm': 'AES256',
'x-amz-server-side-encryption-customer-key': 'pO3upElrwuEXSoFwCfnZPdSsmt/xWeFa0N9KgDijwVs=',
'x-amz-server-side-encryption-customer-key-md5': 'DWygnHRtgiJ77HCm+1rvHw==',
}
srckey = bucket.new_key(srcobj)
srckey.set_contents_from_string(content, headers=encrypt_headers)
key = "multipart"
init_headers = {
'Content-Type': content_type
}
upload = bucket.initiate_multipart_upload(key)
mp = boto.s3.multipart.MultiPartUpload(bucket)
mp.key_name = upload.key_name
mp.id = upload.id
part = mp.copy_part_from_key(bucket.name, srcobj, 1)
xml = "<Part><PartNumber>{0}</PartNumber><ETag>{1}</ETag></Part>".format(1, part.etag)
xml = "<CompleteMultipartUpload>{0}</CompleteMultipartUpload>".format(xml)
bucket.complete_multipart_upload(key, upload.id, xml)
key = bucket.get_key(key)
print(key.size) # No error and its size is 0!
Updated by Casey Bodley over 3 years ago
- Status changed from New to Fix Under Review
Updated by Casey Bodley about 3 years ago
- Status changed from Fix Under Review to Pending Backport
- Backport set to octopus nautilus
Updated by Backport Bot about 3 years ago
- Copied to Backport #50095: nautilus: When copying an encrypted object, the result object is empty. added
Updated by Backport Bot about 3 years ago
- Copied to Backport #50096: octopus: When copying an encrypted object, the result object is empty. added
Updated by Nathan Cutler about 3 years ago
- Pull request ID changed from 48554 to 38537
Updated by Loïc Dachary about 3 years ago
- Status changed from Pending Backport to Resolved
While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".
Actions