Project

General

Profile

Actions

Bug #48554

closed

When copying an encrypted object, the result object is empty.

Added by Ilsoo Byun over 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Or Friedmann
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
octopus nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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!

Related issues 2 (0 open2 closed)

Copied to rgw - Backport #50095: nautilus: When copying an encrypted object, the result object is empty.ResolvedNathan CutlerActions
Copied to rgw - Backport #50096: octopus: When copying an encrypted object, the result object is empty.ResolvedNathan CutlerActions
Actions #2

Updated by Casey Bodley over 3 years ago

  • Assignee set to Or Friedmann
Actions #3

Updated by Casey Bodley over 3 years ago

  • Status changed from New to Fix Under Review
Actions #4

Updated by Casey Bodley about 3 years ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport set to octopus nautilus
Actions #5

Updated by Backport Bot about 3 years ago

  • Copied to Backport #50095: nautilus: When copying an encrypted object, the result object is empty. added
Actions #6

Updated by Backport Bot about 3 years ago

  • Copied to Backport #50096: octopus: When copying an encrypted object, the result object is empty. added
Actions #7

Updated by Nathan Cutler about 3 years ago

  • Pull request ID set to 48554
Actions #8

Updated by Nathan Cutler about 3 years ago

  • Pull request ID changed from 48554 to 38537
Actions #9

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

Also available in: Atom PDF