Project

General

Profile

Bug #11639

Object copy bug

Added by Javier M. Mellid over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Target version:
-
Start date:
05/15/2015
Due date:
% Done:

0%

Source:
other
Tags:
Backport:
hammer, firefly
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

In a situation with 2 users A & B. There is a object copy bug when user B tries to copy one object created by A with FULL_CONTROL to user B.

With this bug report I am uploading one python script reproducing the bug (it uses boto)

The behaviour in aws' s3 and radosgw is different too.

In aws's s3 it dumps the following:

$ ./s3copyobject.py
Creating 'aws1-99999-transfer-bug-bucket
Press <Enter> to continue with copy object...
Copying object
Press <Enter> to continue with print results...
Content as per aws1
<Policy: aws1 (owner) = FULL_CONTROL, aws2 = FULL_CONTROL>
'aws1-99999-test-file' by 'aws1' ['meta1': 'None', 'meta2': 'None']
'aws1-99999-test-file' => <Policy: aws1 (owner) = FULL_CONTROL, aws2 = FULL_CONTROL>
Error reading aws1-99999-test-file-02
Content as per aws2
<Policy: aws1 (owner) = FULL_CONTROL, aws2 = FULL_CONTROL>
'aws1-99999-test-file' by 'aws1' ['meta1': 'None', 'meta2': 'None']
'aws1-99999-test-file' => <Policy: aws1 (owner) = FULL_CONTROL, aws2 = FULL_CONTROL>
'aws1-99999-test-file-02' by 'aws2' ['meta1': 'None', 'meta2': 'None']
'aws1-99999-test-file-02' => <Policy: aws2 (owner) = FULL_CONTROL>

In radosgw it dumps the following:

$ ./s3copyobject.py
Creating 'testuser1-99999-transfer-bug-bucket
Press <Enter> to continue with copy object...
Copying object
Traceback (most recent call last):
  File "./s3copyobject.py", line 66, in <module>
    copy_object()
  File "./s3copyobject.py", line 62, in copy_object
    bucket.copy_key(file_name + "-02", bucket_name, file_name)
  File "/usr/lib/python2.7/dist-packages/boto/s3/bucket.py", line 762, in copy_key
    response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
<Error><Code>AccessDenied</Code></Error>

s3copyobject.py View (2.73 KB) Javier M. Mellid, 05/15/2015 12:14 PM


Related issues

Related to rgw - Bug #11563: RadosGW regression: COPY doesn't preserve Content-Type Resolved 05/07/2015
Copied to rgw - Backport #11754: Object copy bug Resolved 05/15/2015
Copied to rgw - Backport #11755: Object copy bug Resolved 05/15/2015

Associated revisions

Revision 1dac80df (diff)
Added by Javier M. Mellid over 3 years ago

rgw: Use attrs from source bucket on copy

On copy objects, when bucket source is the same as the destination, use attrs
from source bucket.

Fixes: #11639

Signed-off-by: Javier M. Mellid <>

Revision 2d5d8da3 (diff)
Added by Javier M. Mellid over 3 years ago

rgw: Use attrs from source bucket on copy

On copy objects, when bucket source is the same as the destination, use attrs
from source bucket.

Fixes: #11639

Signed-off-by: Javier M. Mellid <>
(cherry picked from commit 1dac80df1d4a2364154ed8b404d13609936c257b)

Revision 54f4e7d4 (diff)
Added by Javier M. Mellid over 3 years ago

rgw: Use attrs from source bucket on copy

On copy objects, when bucket source is the same as the destination, use attrs
from source bucket.

Fixes: #11639

Signed-off-by: Javier M. Mellid <>
(cherry picked from commit 1dac80df1d4a2364154ed8b404d13609936c257b)

History

#1 Updated by Javier M. Mellid over 3 years ago

It looks on copy objects, when bucket source is the same as the destination we should use attrs from source bucket.

Created pull request here...

https://github.com/ceph/ceph/pull/4688

Testing the fix with s3copyobject.py aws' s3 and radosgw show the same behaviour/output now.

#2 Updated by Greg Farnum over 3 years ago

  • Project changed from Ceph to rgw

#3 Updated by Nathan Cutler over 3 years ago

  • Status changed from New to Need Review

#4 Updated by Yehuda Sadeh over 3 years ago

  • Status changed from Need Review to Pending Backport
  • Backport set to hammer, firefly

Note: we need to create a test for this in s3-tests. Opened issue #11753.

#5 Updated by Javier M. Mellid over 3 years ago

Test available in #11753 (pull request asked)

#6 Updated by Nathan Cutler over 3 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF