You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I got a strange exception trying to connect s3 client to local minio.
software.amazon.awssdk.core.exception.SdkClientException: Unable to marshall request to JSON: baseUri must not be null.
at software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:98) ~[software.amazon.awssdk.sdk-core-2.17.61.jar:?]
at software.amazon.awssdk.services.s3.transform.HeadObjectRequestMarshaller.marshall(HeadObjectRequestMarshaller.java:53) ~[software.amazon.awssdk.s3-2.17.61.jar:?]
...
at io.github.vigoo.zioaws.s3.package$S3Impl.$anonfun$headObject$1(package.scala:2392) ~[io.github.vigoo.zio-aws-s3_2.13-3.17.61.1.jar:3.17.61.1]
Caused by: java.lang.NullPointerException: baseUri must not be null.
at software.amazon.awssdk.utils.Validate.paramNotNull(Validate.java:156) ~[software.amazon.awssdk.utils-2.17.61.jar:?]
...
What if you are accessing another service deployed on your Kubernetes cluster that acts as a proxy to an AWS service? Would you not want to retain the ability to use a URI?
The Java SdkClientBuilder interface expects a URI as well: B endpointOverride(URI endpointOverride);. Easy enough to widen it again in AwsConfig.configured() before invoking, but it does make you wonder about the intent.
@etherline
I'm not sure if I can recall the details exactly 😅
I was under impression that java SDK indeed expects URI. But there is a code that parses the URI, and if it can't convert it to URL, the it throws an exception as displayed above.
After filling out this issue I did a little more digging and found out that java URL is badly designed (because of DNS queries) and that's why people prefer to use URIs instead.
But the problem here (as I see it) is that this specific java design choice led to URI usage, where developer expects it to be URL.
Hi!
I got a strange exception trying to connect s3 client to local minio.
After some experiments, I found that the type of
endpointOverride
defined here: https://github.com/vigoo/zio-aws/blob/master/zio-aws-core/src/main/scala/io/github/vigoo/zioaws/core/config/package.scala#L237-L239 allows for incorrect URIs to be passed to underlying aws sdk.In my case it was
minio:9000
instead of correcthttp://minio:9000
In my semi-educated guess, it would be better to change
endpointOverride
descriptor tourl
to enforce type safety.The text was updated successfully, but these errors were encountered: