-
Notifications
You must be signed in to change notification settings - Fork 49
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
Missing Bucket in path when using "forcePathStyle" #1173
Comments
Hi @clementguillot, thanks for the bug report. I've been able to reproduce the issue locally. It appears to be related to presigning and not necessarily to using a custom endpoint (e.g., for MinIO). I'll root cause the issue and get a fix posted shortly. |
The fix for this issue has been merged to main and should be included in tomorrow's release. Closing this for now but please re-open if the issue still occurs on 1.0.32 or later. |
|
Thank you @ianbotsf for the fix! |
@ianbotsf unfortunatelly, using <?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>
<Key>65983dbe7ee2fa0039df4ff1/1689923702657342873</Key>
<BucketName>my-bucket</BucketName>
<Resource>/my-bucket/my-file/path</Resource>
<RequestId>17A93FCF1CFEE650</RequestId>
<HostId>dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8</HostId>
</Error> |
Hmm, that's unexpected. We added a new presigning E2E which uses |
Hi @ianbotsf, I tried a couple of scenarios as below:
Unfortunately, I can't say if the error is on Minio's side, but it seems that Node and Rust SDKs can tackle this. It would be definitely great if Kotlin SDK could too ;) Please let me know if there is anything I can do to help with this! EDIT: I remember that we had a "hack" in our Node codebase for a while due to that issue, when using a specific port ( |
@ianbotsf I confirm that Kotlin SDK works as expected when local Minio is on port 80 (or 443). Issue is no longer related to path style but is about using a port in the endpoint URL. Maybe should I open another issue? |
Yes this should be a new issue. I've opened #1177 and I'll re-close this one. |
|
Describe the bug
Using a local develoment environment with any S3-comptatible backend (e.g.
minio
), I try to configure a S3 Client withforcePathStyle = true
.When I call
.presignGetObject
, the result URL does not contain the bucket in the path. However, it works as expected when this parameter isfalse
ornull
.Expected behavior
When
forcePathStyle
isfalse
ornull
, presigned URL has patternhttp://{bucket}.{endpoint}/{key}
.But, once this parameter is
true
, presigned URL has patternhttp://{endpoint}/{key}
and bucket is missing, expected URL ishttp://{endpoint}/{bucket}/{key}
.Current behavior
Bucket is missing from built-URL. When accessing the generated URL, server throws a 403 error.
Steps to Reproduce
Let's consider the following sippnet:
url
looks like this:http://localhost:9000/my-file-path?x-id=GetObject&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...
Expected:
http://localhost:9000/my-bucket/my-file-path?x-id=GetObject&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...
Note that with the same local S3 backend, but using the following NodeJS snippet, it works as expected:
Print:
http://localhost:9000/my-bucket/my-file-path?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=...
Possible Solution
No response
Context
No response
AWS Kotlin SDK version used
1.0.30
Platform (JVM/JS/Native)
OpenJDK Runtime Environment GraalVM CE 17.0.7+7.1 and Kotlin 1.9.22
Operating System and version
Linux Ubuntu 22.04.3
The text was updated successfully, but these errors were encountered: