Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RClone and LakeFS integration breaks without v2_auth #2445

Closed
tvanderwal-lmco opened this issue Sep 3, 2021 · 17 comments
Closed

RClone and LakeFS integration breaks without v2_auth #2445

tvanderwal-lmco opened this issue Sep 3, 2021 · 17 comments
Assignees
Labels
area/auth IAM, authorization, authentication, audit, AAA, and integrations with all those contributor next Target for next release

Comments

@tvanderwal-lmco
Copy link
Contributor

tvanderwal-lmco commented Sep 3, 2021

This might be intended and just needs an update on your website but I ran into a hard to debug issue trying to sync data into LakeFS with RClone. Note, I've followed the instructions previously on the site and this worked so not sure what LakeFS version it broke in. The behavior seems to point towards the client side however I haven't updated RClone at all since it did previously work.

LakeFS Version: 0.48.0 (Also reproduced on 0.47.0)
RClone Version:

rclone v1.56.0
- os/version: darwin 11.5.2 (64 bit)
- os/kernel: 20.6.0 (x86_64)
- os/type: darwin
- os/arch: amd64
- go/version: go1.16.6
- go/linking: dynamic
- go/tags: none

Error trying to copy local data into LakeFS using the suggested configuration:


.... removed ...

2021/09/02 21:07:25 INFO  :
Transferred:   	   14.481Ki / 14.481 KiByte, 100%, 0 Byte/s, ETA -
Errors:                 2 (retrying may help)
Elapsed time:         1.2s

2021/09/02 21:07:25 Failed to sync with 2 errors: last error was: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-gov-west-1</Region><RequestId>5d580752-d488-4f4f-976b-358729075279</RequestId><HostId>D071307137586F18</HostId></Error>

To test that the credentials were correct I went the other way and used LakeFS as a source after adding a file via the UI

❯ rclone ls lakefs:aif-xxxx/main/ -vv

2021/09/02 21:10:46 DEBUG : Setting --ca-cert "/Users/e379822/certs/lm_ca.pem" from environment variable RCLONE_CA_CERT="/Users/e379822/certs/lm_ca.pem"
2021/09/02 21:10:46 DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "ls" "lakefs:aif-xxxx/main/" "-vv"]
2021/09/02 21:10:46 DEBUG : Creating backend with remote "lakefs:aif-xxxx/main/"
2021/09/02 21:10:46 DEBUG : Using config file from "/Users/e379822/.config/rclone/rclone.conf"
2021/09/02 21:10:46 DEBUG : fs cache: renaming cache item "lakefs:aif-xxxx/main/" to be canonical "lakefs:aif-xxxx/main"
        4 test.txt
2021/09/02 21:10:47 DEBUG : 6 go routines active

What put me onto it was the signature signing is this log line in the LakeFS stating it was using SigV4. time="2021-09-03T01:51:31Z" level=warning msg="error verifying credentials for key" func=pkg/gateway.AuthenticationHandler.func1 file="build/pkg/gateway/middleware.go:54" authenticator=sigv4 error=SignatureDoesNotMatch key=AKIAJ6UDLXIPOISF7LKQ

Also verified by dumping the RClone headers that it was using SigV4 authentication by dumping the headers.

2021/09/02 20:56:06 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/02 20:56:06 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/02 20:56:06 DEBUG : HTTP REQUEST (req 0xc000ad0100)
2021/09/02 20:56:06 DEBUG : PUT /aif-xxxx/main/test/test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ6UDLXIPOISF7LKQ%2F20210903%2Fus-gov-west-1%2Fs3%2Faws4_request&X-Amz-Date=20210903T025606Z&X-Amz-Expires=900&X-Amz-SignedHeaders=content-md5%3Bcontent-type%3Bhost%3Bx-amz-acl%3Bx-amz-meta-mtime&X-Amz-Signature=c3b12b3bb96069f6102df42eb22b4a64d7bc728800e53fee1b6372547710fdeb HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com:443
User-Agent: rclone/v1.56.0
Content-Length: 4
content-md5: uh8lEfwwQjvbsYP+M/PdDw==
content-type: text/plain; charset=utf-8
x-amz-acl: private
x-amz-meta-mtime: 1630636753.967220656
Accept-Encoding: gzip

Setting the V2 auth in rclone does fix this issue:

❯ rclone sync -v test lakefs:aif-xxxx/main/test/ --s3-v2-auth --dump headers

....

2021/09/02 21:16:33 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/02 21:16:33 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/02 21:16:33 DEBUG : HTTP REQUEST (req 0xc0005a4200)
2021/09/02 21:16:33 DEBUG : PUT /aif-xxxxx/main/test/test.txt HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com:443
User-Agent: rclone/v1.56.0
Content-Length: 4
Authorization: XXXX
Content-Md5: uh8lEfwwQjvbsYP+M/PdDw==
Content-Type: text/plain; charset=utf-8
Date: Fri, 03 Sep 2021 03:16:33 UTC
X-Amz-Acl: private
X-Amz-Meta-Mtime: 1630636753.967220656
Accept-Encoding: gzip

.... 
 
2021/09/02 21:16:34 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/02 21:16:34 DEBUG : test.txt: md5 = ba1f2511fc30423bdbb183fe33f3dd0f OK
2021/09/02 21:16:34 INFO  : test.txt: Copied (new)
2021/09/02 21:16:34 DEBUG : Waiting for deletions to finish
2021/09/02 21:16:34 INFO  :
Transferred:   	    4.827Ki / 4.827 KiByte, 100%, 0 Byte/s, ETA -
Transferred:            2 / 2, 100%
Elapsed time:         1.5s

2021/09/02 21:16:34 DEBUG : 9 go routines active

It's an easy enough work around to add v2_auth = true, however I wanted to report it in case it is a bug since you have SigV4 listed as supported here

@arielshaqed arielshaqed self-assigned this Sep 3, 2021
@arielshaqed
Copy link
Contributor

arielshaqed commented Sep 3, 2021

Thanks for the detailedreport! This should work.

Edited to add: ...so I shall reproduce and attempt to diagnose.

@arielshaqed
Copy link
Contributor

I'm sorry, I am unable to reproduce this with 1.56.0 and lakeFS 0.48.0. I am able to upload (and download) files, using SigV4, onto lakeFS. I verified sigV4 using --dump auth on the rclone side.

My only issues were operator error (I don't really know how to use rclone...), I was unable to use it to create a new file, only to overwrite an existing file. I do not believe that this is related to your issue.

Would appreciate more info, e.g. (redacted) lakeFS and rclone configuration files, the rclone ... commandline that you used, etc.

@tvanderwal-lmco
Copy link
Contributor Author

tvanderwal-lmco commented Sep 5, 2021

No problem.
command rclone copy -v --ignore-existing aif-datalake:aif-xxxxx-dldev/datasets/ lakefs:aif-xxxxx/main/datasets/

Rclone Config:

❯ cat ~/.config/rclone/rclone.conf
[lakefs]
type = s3
force_path_style = true
provider = other
env_auth = false
no_check_bucket = true
access_key_id = xxxx
secret_access_key = xxxx
endpoint = https://s3.lakefs.ai.us.lmco.com:443
region = us-gov-west-1
server_side_encryption =
acl =
v2_auth = true

[aif-datalake]
type = s3
provider = AWS
env_auth = false
access_key_id = xxxx
secret_access_key = xxxx
region = us-gov-west-1
acl = private
server_side_encryption = aws:kms

LakeFS Config:

❯ cat custom-values/lakefs-values-secrets.yaml
secrets:
  databaseConnectionString: postgres://user:passowrd@cluster:5432/lakefs?sslmode=disable
  authEncryptSecretKey: xxxx
extraVolumes:
  - name: data-dir
    emptyDir: {}
  - name: ssl-cert
    secret:
      secretName: lmca
      defaultMode: 432
extraVolumeMounts:
  - name: data-dir
    mountPath: /data/
  - name: ssl-cert
    mountPath: /etc/ssl/certs/
lakefsConfig: |
 stats.enabled: false
 logging.level: DEBUG
 blockstore:
   type: s3
   s3:
     region: us-gov-west-1
     force_path_style: true
     credentials:
       access_key_id: xxxxx
       secret_access_key: xxxxx

 gateways:
   s3:
     domain_name: s3.lakefs.ai.us.lmco.com
     region: us-gov-west-1

@tvanderwal-lmco
Copy link
Contributor Author

Just to add I've also found some more odd behavior trying to copy data into LakeFS. If the filename has unicode characters it fails with the same message however works with files without the characters.

<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-gov-west-1</Region><RequestId>9760a81d-1e42-4dcb-afa8-087e2d0855bc</RequestId><HostId>CA50EAF106FD77F8</HostId></Error>
2021/09/04 21:37:17 ERROR : xxxx/classification/ts19_tasknet_v2/train/vehicle/color/gray/snap_201202221052579440_蒙BAN306_蓝_20120222105302_2.jpg: Failed to copy: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>

Dumping the logs it seems RClone sends a HEAD request in to see if the file exists already and that's what LakeFS returns the 403 on. Oddly enough it sends that same HEAD requests for all the files which authorizes fine when those characters don't exist. The UI doesn't seem to mind them manually adding it nor does it have an issue with the PUT command which I tested with awscli

@arielshaqed
Copy link
Contributor

arielshaqed commented Sep 5, 2021

I remain unable to reproduce. Hmmm... perhaps MacOS? Will try to hunt down a Mac and try there.

Update: Still works on MacOS.

I configured a repo, hooked up rclone using:

[local-lake]
type = s3
provider = AWS
env_auth = false
access_key_id = AKIA...
secret_access_key = ...
region = eu-central-1
endpoint = http://s3.local.lakefs.io:8000/
location_constraint = eu-central-1
v2_auth = false

and copied a file to the name snap_201202221052579440_蒙BAN306_蓝_20120222105302_2.jpg. This performs a HEAD, then a PUT, then a HEAD; all succeed.

I am sorry, I am repeatedly drawing a blank on this. We know this is a big request, but having full debug logs (from both or either sides) might be helpful. E.g. if you can capture the output from -vvv --dump requests,responses,bodies,auth on a failing request (obviously eliding whatever you must), that might help me understand what is different on my systems.

@tvanderwal-lmco
Copy link
Contributor Author

tvanderwal-lmco commented Sep 5, 2021

Hmm interesting. Maybe then it's an issue with how my backend bucket is configured? Here is the dump of all those sections on the same requests I've been trying.

❯ rclone sync -vv  snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg lakefs:aif-xxxxx/main/test --dump headers,requests,responses,bodies,auth
2021/09/05 10:05:34 DEBUG : Setting --ca-cert "/Users/e379822/certs/lm_ca.pem" from environment variable RCLONE_CA_CERT="/Users/e379822/certs/lm_ca.pem"
2021/09/05 10:05:34 DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "sync" "-vv" "snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg" "lakefs:aif-xxxxx/main/test" "--dump" "headers,requests,responses,bodies,auth"]
2021/09/05 10:05:34 DEBUG : Creating backend with remote "snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg"
2021/09/05 10:05:34 DEBUG : Using config file from "/Users/e379822/.config/rclone/rclone.conf"
2021/09/05 10:05:34 DEBUG : fs cache: adding new entry for parent of "snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg", "/Users/e379822/AIF"
2021/09/05 10:05:34 DEBUG : Creating backend with remote "lakefs:aif-xxxxx/main/test"
2021/09/05 10:05:34 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2021/09/05 10:05:34 DEBUG : Using v2 auth
2021/09/05 10:05:34 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:05:34 DEBUG : HTTP REQUEST (req 0xc000795e00)
2021/09/05 10:05:34 DEBUG : HEAD /aif-xxxxx/main/test HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com
User-Agent: rclone/v1.56.0
Authorization: AWS AKIAJ6UDLXIPOISF7LKQ:3wBlagPCheWg7dur7p6DrVBa5rA=
Date: Sun, 05 Sep 2021 16:05:34 UTC

2021/09/05 10:05:34 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:05:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:05:35 DEBUG : HTTP RESPONSE (req 0xc000795e00)
2021/09/05 10:05:35 DEBUG : HTTP/1.1 404 Not Found
Content-Length: 336
Cache-Control: private
Content-Type: application/xml
Date: Sun, 05 Sep 2021 16:05:35 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly
X-Amz-Request-Id: 2b20dd63-a28c-40e1-ad06-8346b59a6c07

2021/09/05 10:05:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:05:35 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:05:35 DEBUG : HTTP REQUEST (req 0xc0009cc200)
2021/09/05 10:05:35 DEBUG : HEAD /aif-xxxxx/main/test/snap_201202221221077860_%E8%92%99AH7593_%E8%93%9D_20120222122120_1.jpg HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com
User-Agent: rclone/v1.56.0
Authorization: AWS access:secret
Date: Sun, 05 Sep 2021 16:05:35 UTC

2021/09/05 10:05:35 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:05:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:05:35 DEBUG : HTTP RESPONSE (req 0xc0009cc200)
2021/09/05 10:05:35 DEBUG : HTTP/1.1 403 Forbidden
Content-Length: 359
Content-Type: text/xml; charset=utf-8
Date: Sun, 05 Sep 2021 16:05:35 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly

2021/09/05 10:05:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:05:35 ERROR : Attempt 1/3 failed with 1 errors and: Forbidden: Forbidden
	status code: 403, request id: , host id:
2021/09/05 10:05:35 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:05:35 DEBUG : HTTP REQUEST (req 0xc000aa4200)
2021/09/05 10:05:35 DEBUG : HEAD /aif-xxxxx/main/test/snap_201202221221077860_%E8%92%99AH7593_%E8%93%9D_20120222122120_1.jpg HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com
User-Agent: rclone/v1.56.0
Authorization: AWS access:secret
Date: Sun, 05 Sep 2021 16:05:35 UTC

2021/09/05 10:05:35 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:05:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:05:35 DEBUG : HTTP RESPONSE (req 0xc000aa4200)
2021/09/05 10:05:35 DEBUG : HTTP/1.1 403 Forbidden
Content-Length: 359
Content-Type: text/xml; charset=utf-8
Date: Sun, 05 Sep 2021 16:05:35 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly

2021/09/05 10:05:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:05:35 ERROR : Attempt 2/3 failed with 1 errors and: Forbidden: Forbidden
	status code: 403, request id: , host id:
2021/09/05 10:05:35 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:05:35 DEBUG : HTTP REQUEST (req 0xc0004a6e00)
2021/09/05 10:05:35 DEBUG : HEAD /aif-xxxxx/main/test/snap_201202221221077860_%E8%92%99AH7593_%E8%93%9D_20120222122120_1.jpg HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com
User-Agent: rclone/v1.56.0
Authorization: AWS access:secret
Date: Sun, 05 Sep 2021 16:05:35 UTC

2021/09/05 10:05:35 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:05:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:05:35 DEBUG : HTTP RESPONSE (req 0xc0004a6e00)
2021/09/05 10:05:35 DEBUG : HTTP/1.1 403 Forbidden
Content-Length: 359
Content-Type: text/xml; charset=utf-8
Date: Sun, 05 Sep 2021 16:05:35 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly

2021/09/05 10:05:35 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:05:35 ERROR : Attempt 3/3 failed with 1 errors and: Forbidden: Forbidden
	status code: 403, request id: , host id:
2021/09/05 10:05:35 INFO  :
Transferred:   	          0 / 0 Byte, -, 0 Byte/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         0.9s

2021/09/05 10:05:35 DEBUG : 6 go routines active
2021/09/05 10:05:35 Failed to sync: Forbidden: Forbidden
	status code: 403, request id: , host id:

With the other auth method. This one seems to fail on the put and not head.

❯ rclone sync -vv  snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg lakefs:aif-xxxxx/main/test --dump headers,requests,responses,bodies,auth --s3-v2-auth=false
2021/09/05 10:08:40 DEBUG : Setting --ca-cert "/Users/e379822/certs/lm_ca.pem" from environment variable RCLONE_CA_CERT="/Users/e379822/certs/lm_ca.pem"
2021/09/05 10:08:40 DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "sync" "-vv" "snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg" "lakefs:aif-xxxxx/main/test" "--dump" "headers,requests,responses,bodies,auth" "--s3-v2-auth=false"]
2021/09/05 10:08:40 DEBUG : Creating backend with remote "snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg"
2021/09/05 10:08:40 DEBUG : Using config file from "/Users/e379822/.config/rclone/rclone.conf"
2021/09/05 10:08:40 DEBUG : fs cache: adding new entry for parent of "snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg", "/Users/e379822/AIF"
2021/09/05 10:08:40 DEBUG : Creating backend with remote "lakefs:aif-xxxxx/main/test"
2021/09/05 10:08:40 DEBUG : lakefs: detected overridden config - adding "{PNDwJ}" suffix to name
2021/09/05 10:08:40 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2021/09/05 10:08:40 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:40 DEBUG : HTTP REQUEST (req 0xc000a10500)
2021/09/05 10:08:40 DEBUG : HEAD /aif-xxxxx/main/test HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com
User-Agent: rclone/v1.56.0
Authorization: AWS4-HMAC-SHA256 Credential=AKIAJ6UDLXIPOISF7LKQ/20210905/us-west-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=<Redacted>
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20210905T160840Z

2021/09/05 10:08:40 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:41 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:41 DEBUG : HTTP RESPONSE (req 0xc000a10500)
2021/09/05 10:08:41 DEBUG : HTTP/1.1 404 Not Found
Content-Length: 336
Cache-Control: private
Content-Type: application/xml
Date: Sun, 05 Sep 2021 16:08:41 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly
X-Amz-Request-Id: 06b8ba6e-4ad2-45ae-b223-304e676e5cc6

2021/09/05 10:08:41 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:41 DEBUG : fs cache: renaming cache item "lakefs:aif-xxxxx/main/test" to be canonical "lakefs{PNDwJ}:aif-xxxxx/main/test"
2021/09/05 10:08:41 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:41 DEBUG : HTTP REQUEST (req 0xc000664400)
2021/09/05 10:08:41 DEBUG : HEAD /aif-xxxxx/main/test/snap_201202221221077860_%E8%92%99AH7593_%E8%93%9D_20120222122120_1.jpg HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com
User-Agent: rclone/v1.56.0
Authorization: AWS4-HMAC-SHA256 Credential=AKIAJ6UDLXIPOISF7LKQ/20210905/us-west-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=<Redacted>
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20210905T160841Z

2021/09/05 10:08:41 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:41 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:41 DEBUG : HTTP RESPONSE (req 0xc000664400)
2021/09/05 10:08:41 DEBUG : HTTP/1.1 404 Not Found
Content-Length: 395
Cache-Control: private
Content-Type: application/xml
Date: Sun, 05 Sep 2021 16:08:41 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly
X-Amz-Request-Id: 877e7797-8e21-47ce-bd67-d4ac50c36ebd

2021/09/05 10:08:41 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:41 DEBUG : snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg: Need to transfer - File not found at Destination
2021/09/05 10:08:41 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:41 DEBUG : HTTP REQUEST (req 0xc000a8a400)
2021/09/05 10:08:41 DEBUG : PUT /aif-xxxxx/main/test/snap_201202221221077860_%E8%92%99AH7593_%E8%93%9D_20120222122120_1.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ6UDLXIPOISF7LKQ%2F20210905%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20210905T160841Z&X-Amz-Expires=900&X-Amz-SignedHeaders=content-md5%3Bcontent-type%3Bhost%3Bx-amz-acl%3Bx-amz-meta-mtime&X-Amz-Signature=<Redacted> HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com:443
User-Agent: rclone/v1.56.0
Content-Length: 5
content-md5: 2Oj8otwPiW/Xy0ywAxuiSQ==
content-type: image/jpeg
x-amz-acl: private
x-amz-meta-mtime: 1630813651.05287666
Accept-Encoding: gzip

test
2021/09/05 10:08:41 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:41 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:41 DEBUG : HTTP RESPONSE (req 0xc000a8a400)
2021/09/05 10:08:41 DEBUG : HTTP/1.1 403 Forbidden
Content-Length: 359
Content-Type: text/xml; charset=utf-8
Date: Sun, 05 Sep 2021 16:08:42 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>c2b078ad-232b-4a54-891d-a8bf1a104bef</RequestId><HostId>C6FB104A53846DDD</HostId></Error>
2021/09/05 10:08:41 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:41 ERROR : snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg: Failed to copy: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>c2b078ad-232b-4a54-891d-a8bf1a104bef</RequestId><HostId>C6FB104A53846DDD</HostId></Error>
2021/09/05 10:08:41 ERROR : Attempt 1/3 failed with 1 errors and: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>c2b078ad-232b-4a54-891d-a8bf1a104bef</RequestId><HostId>C6FB104A53846DDD</HostId></Error>
2021/09/05 10:08:41 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:41 DEBUG : HTTP REQUEST (req 0xc000a10a00)
2021/09/05 10:08:41 DEBUG : HEAD /aif-xxxxx/main/test/snap_201202221221077860_%E8%92%99AH7593_%E8%93%9D_20120222122120_1.jpg HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com
User-Agent: rclone/v1.56.0
Authorization: AWS4-HMAC-SHA256 Credential=AKIAJ6UDLXIPOISF7LKQ/20210905/us-west-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=<Redacted> 
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20210905T160841Z

2021/09/05 10:08:41 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:42 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:42 DEBUG : HTTP RESPONSE (req 0xc000a10a00)
2021/09/05 10:08:42 DEBUG : HTTP/1.1 404 Not Found
Content-Length: 395
Cache-Control: private
Content-Type: application/xml
Date: Sun, 05 Sep 2021 16:08:42 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly
X-Amz-Request-Id: 6f6356a0-9846-4e71-90b7-05a28373e739

2021/09/05 10:08:42 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:42 DEBUG : snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg: Need to transfer - File not found at Destination
2021/09/05 10:08:42 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:42 DEBUG : HTTP REQUEST (req 0xc000664800)
2021/09/05 10:08:42 DEBUG : PUT /aif-xxxxx/main/test/snap_201202221221077860_%E8%92%99AH7593_%E8%93%9D_20120222122120_1.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ6UDLXIPOISF7LKQ%2F20210905%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20210905T160842Z&X-Amz-Expires=900&X-Amz-SignedHeaders=content-md5%3Bcontent-type%3Bhost%3Bx-amz-acl%3Bx-amz-meta-mtime&X-Amz-Signature=<Redacted>  HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com:443
User-Agent: rclone/v1.56.0
Content-Length: 5
content-md5: 2Oj8otwPiW/Xy0ywAxuiSQ==
content-type: image/jpeg
x-amz-acl: private
x-amz-meta-mtime: 1630813651.05287666
Accept-Encoding: gzip

test
2021/09/05 10:08:42 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:42 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:42 DEBUG : HTTP RESPONSE (req 0xc000664800)
2021/09/05 10:08:42 DEBUG : HTTP/1.1 403 Forbidden
Content-Length: 359
Content-Type: text/xml; charset=utf-8
Date: Sun, 05 Sep 2021 16:08:42 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>84a49944-5718-46bb-a3e9-bb99ffb80998</RequestId><HostId>4AE3F269E60E6D9A</HostId></Error>
2021/09/05 10:08:42 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:42 ERROR : snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg: Failed to copy: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>84a49944-5718-46bb-a3e9-bb99ffb80998</RequestId><HostId>4AE3F269E60E6D9A</HostId></Error>
2021/09/05 10:08:42 ERROR : Attempt 2/3 failed with 1 errors and: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>84a49944-5718-46bb-a3e9-bb99ffb80998</RequestId><HostId>4AE3F269E60E6D9A</HostId></Error>
2021/09/05 10:08:42 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:42 DEBUG : HTTP REQUEST (req 0xc000a8ab00)
2021/09/05 10:08:42 DEBUG : HEAD /aif-xxxxx/main/test/snap_201202221221077860_%E8%92%99AH7593_%E8%93%9D_20120222122120_1.jpg HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com
User-Agent: rclone/v1.56.0
Authorization: AWS4-HMAC-SHA256 Credential=AKIAJ6UDLXIPOISF7LKQ/20210905/us-west-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=<Redacted> 
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20210905T160842Z

2021/09/05 10:08:42 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:42 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:42 DEBUG : HTTP RESPONSE (req 0xc000a8ab00)
2021/09/05 10:08:42 DEBUG : HTTP/1.1 404 Not Found
Content-Length: 395
Cache-Control: private
Content-Type: application/xml
Date: Sun, 05 Sep 2021 16:08:42 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly
X-Amz-Request-Id: 0a3db6d0-1c81-4696-9549-7826c28634d1

2021/09/05 10:08:42 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:42 DEBUG : snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg: Need to transfer - File not found at Destination
2021/09/05 10:08:42 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:42 DEBUG : HTTP REQUEST (req 0xc000a10e00)
2021/09/05 10:08:42 DEBUG : PUT /aif-xxxxx/main/test/snap_201202221221077860_%E8%92%99AH7593_%E8%93%9D_20120222122120_1.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ6UDLXIPOISF7LKQ%2F20210905%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20210905T160842Z&X-Amz-Expires=900&X-Amz-SignedHeaders=content-md5%3Bcontent-type%3Bhost%3Bx-amz-acl%3Bx-amz-meta-mtime&X-Amz-Signature=<Redacted>  HTTP/1.1
Host: s3.lakefs.ai.us.lmco.com:443
User-Agent: rclone/v1.56.0
Content-Length: 5
content-md5: 2Oj8otwPiW/Xy0ywAxuiSQ==
content-type: image/jpeg
x-amz-acl: private
x-amz-meta-mtime: 1630813651.05287666
Accept-Encoding: gzip

test
2021/09/05 10:08:42 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/09/05 10:08:42 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:42 DEBUG : HTTP RESPONSE (req 0xc000a10e00)
2021/09/05 10:08:42 DEBUG : HTTP/1.1 403 Forbidden
Content-Length: 359
Content-Type: text/xml; charset=utf-8
Date: Sun, 05 Sep 2021 16:08:42 GMT
Set-Cookie: 62db8fe8d2497e9b0a0aa142e7835f49=6700d015ef3ef7048dca8e47faf9e917; path=/; HttpOnly

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>84ac4c37-4306-43b3-837e-d018f85f847d</RequestId><HostId>4032E89522106F77</HostId></Error>
2021/09/05 10:08:42 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/09/05 10:08:42 ERROR : snap_201202221221077860_蒙AH7593_蓝_20120222122120_1.jpg: Failed to copy: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>84ac4c37-4306-43b3-837e-d018f85f847d</RequestId><HostId>4032E89522106F77</HostId></Error>
2021/09/05 10:08:42 ERROR : Attempt 3/3 failed with 1 errors and: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>84ac4c37-4306-43b3-837e-d018f85f847d</RequestId><HostId>4032E89522106F77</HostId></Error>
2021/09/05 10:08:42 INFO  :
Transferred:   	         15 / 15 Byte, 100%, 0 Byte/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         1.6s

2021/09/05 10:08:42 DEBUG : 7 go routines active
2021/09/05 10:08:42 Failed to sync: s3 upload: 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><Resource></Resource><Region>us-west-1</Region><RequestId>84ac4c37-4306-43b3-837e-d018f85f847d</RequestId><HostId>4032E89522106F77</HostId></Error>

c3b12b3bb96069f6102df42eb22b4a64d7bc728800e53fee1b6372547710fdeb

@tvanderwal-lmco
Copy link
Contributor Author

Did also reverify that I can upload files without those characters which it seems like RClone is doing the same commands and that the user for the lakefs backing buckets has all S3 operations.

@arielshaqed
Copy link
Contributor

Reproduction of SigV2 failure using the AWS CLI

Requirements

An aws v1 CLI. v2 of the CLI has already dropped support for SigV2.

Configure your profile to use SigV2: Put this stanza in $HOME/.aws/config:

[profile name-of-profile]
s3 =
   signature_version = s3

Now attempt to copy a file to something with a non-ASCII name:

ariels@redqueen:~/dev/lakeFS$ AWS_PROFILE=nessie aws s3 cp --endpoint-url=http://localhost:8000 /tmp/x s3://moo/main/ש
upload failed: ../../../../tmp/x to s3://moo/main/ש An error occurred (SignatureDoesNotMatch) when calling the PutObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.

@arielshaqed
Copy link
Contributor

The value of authPath is incorrect for sigV2 signing. At

return authPath + foundResourcesStr
it has the decoded value ""/moo/main/ש" when the original encoded value "/moo/main/%D7%A9" is needed.

@arielshaqed
Copy link
Contributor

So this diff appears to work. I will do some historical research to see why we had that code in the first place.

diff --git a/pkg/gateway/sig/v2.go b/pkg/gateway/sig/v2.go
index 9e3c238c5..299666150 100644
--- a/pkg/gateway/sig/v2.go
+++ b/pkg/gateway/sig/v2.go
@@ -238,17 +238,11 @@ func (a *V2SigAuthenticator) Verify(creds *model.Credential, bareDomain string)
                        - QSA(Query String Arguments) - query arguments are searched for "interesting Resources".
        */
 
-       /*
-               URI encoding requirements for aws signature are different from what GO does.
-               This logic is taken from https://docs.aws.amazon.com/AWSECommerceService/latest/DG/Query_QueryAuth.html
-               These replacements are necessary for Java. There is no description about GO, but I found the '=' needs treatment as well
-       */
+       // Prefer the raw path if it exists -- *this* is what SigV2 signs
+       url := a.r.URL
+       rawPath := url.EscapedPath()
 
-       patchedPath := strings.ReplaceAll(a.r.URL.Path, "=", "%3D")
-       patchedPath = strings.ReplaceAll(patchedPath, "+", "%20")
-       patchedPath = strings.ReplaceAll(patchedPath, "*", "%2A")
-       patchedPath = strings.ReplaceAll(patchedPath, "%7E", "~")
-       path := buildPath(a.r.Host, bareDomain, patchedPath)
+       path := buildPath(a.r.Host, bareDomain, rawPath)
        stringToSign := canonicalString(a.r.Method, a.r.URL.Query(), path, a.r.Header)
        digest := signCanonicalString(stringToSign, []byte(creds.SecretAccessKey))
        if !Equal(digest, a.ctx.signature) {

@arielshaqed
Copy link
Contributor

Update

#2464 in draft, based on the above, makes SigV2 handle these Unicode characters correctly. I am currently adding a gateway signature component test so as to have more confidence that this is indeed correct.

It turns out that SigV2 is not only deprecated-but-in-use, it is also documented in subtly different terms for S3 and for (most of) the rest of AWS. Fun times!

@tvanderwal-lmco
Copy link
Contributor Author

Thanks for running this down @arielshaqed!

@arielshaqed
Copy link
Contributor

Thanks for running this down @arielshaqed!

Thanks for finding these bugs and providing all needed information, and to @talSofer for reproducing (most Linux terminal emulators manage to strip Unicode before it ever hits the command-line programs...)!

Please note that #2464 should fix SigV2. I do not expect any change to SigV4 authentication; indeed, I do not believe that we have managed to reproduce the SigV4 issue yet. So I am not closing the bug yet.

I hope to release next week. We are not many few hours away from a fairly large holiday; releasing today would be a bit too adventurous even for me. 🤷‍♂️

@tvanderwal-lmco
Copy link
Contributor Author

Sounds good! I think the SigV4 issue might get fixed with #2447 since it was only failing on new files and not existing ones. I'll test them both out when the new release is ready.

@arielshaqed arielshaqed added area/auth IAM, authorization, authentication, audit, AAA, and integrations with all those next Target for next release labels Sep 15, 2021
@tvanderwal-lmco
Copy link
Contributor Author

@arielshaqed I was able to upgrade to the latest release and the unicode error is indeed fixed for SigV2. You were right about the SigV4 issue still persists.

@tvanderwal-lmco
Copy link
Contributor Author

Interestingly is even though the unicode characters work I get the same signature mistmatch when it tries to do a multipart upload..

I set the --s3-upload-cutoff 5G which is the max to get around it for now but anything larger than that will still fail.

@arielshaqed
Copy link
Contributor

Interestingly is even though the unicode characters work I get the same signature mistmatch when it tries to do a multipart upload..

I set the --s3-upload-cutoff 5G which is the max to get around it for now but anything larger than that will still fail.

Thanks for another great analysis!

I can see an ETag mismatch but not a signature mismatch:

Attempt 3/3 failed with 1 errors and: corrupted on transfer: md5 hash differ "..." vs "..."

This is some very odd behaviour, I am not sure that rclone has any right to expect this behaviour from an S3 gateway. As such I am closing this one and opening a new bug, #2486.

If you still see specifically signature failures and not the ETag MD5 difference that I see, please open another one (or just re-open this bug).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/auth IAM, authorization, authentication, audit, AAA, and integrations with all those contributor next Target for next release
Projects
None yet
Development

No branches or pull requests

4 participants