-
Notifications
You must be signed in to change notification settings - Fork 647
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
AWS S3: Virtual host style requests fails witch custom endpoint (Minio) #2171
Comments
Hi @WojciechMazur. Can you provide some more context about what API you're calling and the configuration/parameters. There's a test in |
I've prepared spec which would fail in this example. it should "create checkIfExits bucket request with custom endpoint" in {
implicit val settings: S3Settings = getSettings().withEndpointUrl("http://custom.s3.storage:9000")
val request: HttpRequest = HttpRequests.bucketManagementRequest(location, method = HttpMethods.HEAD)
//Date is added by akka by default
request.uri.authority.host.toString should equal("bucket.custom.s3.storage")
request.uri.authority.port shouldEqual 9000
request.entity.contentLengthOption should equal(Some(0))
request.uri.queryString() should equal(None)
request.method should equal(HttpMethods.HEAD)
} |
Yes, when the endpoint URL is explicitly defined it will use it as-is. If you encode the bucket into the endpoint URL itself everything seems to ok.
|
You're right, when an endpoint URL is specified, the bucket name will not be encoded into it which currently makes virtual-host-style access incompatible with it. The endpoint URL should instead be given as some kind of format so that the bucket name could be added at the correct position. @WojciechMazur would you be in a position to suggest something like that in a pull request? This partly relates to #1558. |
I've looked into this, expect a PR today! |
Fixed with #2193, but I've seen reports on Gitter that there might be parts missing. |
Version 2.0.M3
When using virtual-host-style (which is now enabled by default) resulting endpoint does not include bucket name.
Expected request URI: http://some-bucket-name.minio-domain/some-key
Actual request URI: http://minio-domain/some-key
Bug is probably created in
akka.stream.alpakka.s3.impl.HttpRequests
requestAuthority
function.With current logic if endpoint is specified in config (when using minio it is always specified) then host is not enriched by bucket sub-domain.
Also it would be better if logging about deprecation would appear only 1 instead of logging in each usage.
The text was updated successfully, but these errors were encountered: