Project

General

Profile

Actions

Bug #18355

open

when call the multiparts upload API TransferManager.upload() by s3 java API , i got a excepiton 'AmazonS3Exception'

Added by Qi Yu over 7 years ago. Updated over 6 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
rgw
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

I fount that when the parameter in the URL incloudes characters '-,_.~', got excepiton 'AmazonS3Exception' , I looked at the s3 doc and thought the rgw's implement might be wrong.

the example code : http://docs.aws.amazon.com/AmazonS3/latest/dev/HLuploadFileJava.html

the s3 doc:

http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
URI-encode each parameter name and value according to the following rules:

Do not URI-encode any of the unreserved characters that RFC 3986 defines: A-Z, a-z, 0-9, hyphen ( - ), underscore ( _ ), period ( . ), and tilde ( ~ ).
Percent-encode all other characters with %XY, where X and Y are hexadecimal characters (0-9 and uppercase A-F). For example, the space character must be encoded as %20 (not using '+', as some encoding schemes do) and extended UTF-8 characters must be in the form %XY%ZA%BC.


Files

exception.png (651 KB) exception.png exception Qi Yu, 12/26/2016 03:42 AM
rgw debug.png (582 KB) rgw debug.png rgw debug Qi Yu, 12/26/2016 03:42 AM
s3 java sdk debug.png (273 KB) s3 java sdk debug.png s3 java s3 sdk debug Qi Yu, 12/26/2016 03:42 AM
Actions #1

Updated by Greg Farnum almost 7 years ago

  • Project changed from Ceph to rgw
Actions #2

Updated by Matt Benjamin almost 7 years ago

  • Status changed from New to In Progress
  • Assignee set to Matt Benjamin
Actions #3

Updated by PL Garnier over 6 years ago

I ran into this today with a key containing '='.

I believe a simple call to url decoding is missing from multipart upload code: using boto3 in Python to duplicate a file fails, while using s3cmd works.

  • boto3 uses multipart uploads to duplicate the file:
    PUT /bucket/dst?uploadId=2~yhtGWWp2xEGmZCUoCVH5THPrNJKaRMp&partNumber=1 HTTP/1.1
    Host: ceph-storage.example.com
    ...
    x-amz-copy-source: bucket/src-%3D
    

    Response is a 404: NoSuchKey.
  • s3cmd sends a PUT request:
    PUT /dst HTTP/1.1
    Host: bucket.ceph-storage.example.com
    ...
    x-amz-copy-source: /bucket/src-%3D
    

    Response is 200 OK.
Actions

Also available in: Atom PDF