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

com.amazonaws.regions.EndpointToRegion#guessRegionNameForEndpoint Broken for Endpoint String without Schema #2274

Closed
original-brownbear opened this issue Mar 23, 2020 · 1 comment
Labels
duplicate This issue is a duplicate.

Comments

@original-brownbear
Copy link

After upgrading to 1.11.749, I see this failure when constructing an S3 client that uses e.g. endpoint string 127.0.0.1:5021 or any other string that doesn't contain a schema.

  Caused by: java.lang.IllegalArgumentException: Illegal character in scheme name at index 0: 127.0.0.1:5
  1>    at java.base/java.net.URI.create(URI.java:906)
  1>    at com.amazonaws.regions.EndpointToRegion.guessRegionOrRegionNameForEndpoint(EndpointToRegion.java:71)
  1>    at com.amazonaws.regions.EndpointToRegion.guessRegionNameForEndpoint(EndpointToRegion.java:41)
  1>    at com.amazonaws.AmazonWebServiceClient.setEndpoint(AmazonWebServiceClient.java:323)
  1>    at com.amazonaws.services.s3.AmazonS3Client.setEndpoint(AmazonS3Client.java:725)
  1>    at com.amazonaws.client.builder.AwsClientBuilder.setRegion(AwsClientBuilder.java:453)
  1>    at com.amazonaws.client.builder.AwsClientBuilder.configureMutableProperties(AwsClientBuilder.java:424)
  1>    at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46)

The JavaDocs explicitly state that an endpoint string without a schema should work and it used to work in 1.11.636 so this is new it seems.
I think this can easily be fixed by using e.g. com.amazonaws.AmazonWebServiceClient#toURI which is used in other places to handle this kind of string to URI conversion.

@debora-ito debora-ito added the duplicate This issue is a duplicate. label Mar 24, 2020
@debora-ito
Copy link
Member

Hi @original-brownbear, thank you for reaching out. This is a duplicate of #2255, let's track this issue over there.

TommyWind added a commit to TommyWind/aws-sdk-java that referenced this issue Mar 25, 2020
TommyWind added a commit to TommyWind/aws-sdk-java that referenced this issue Mar 25, 2020
fixmebot bot referenced this issue in VectorXz/elasticsearch Apr 22, 2021
fixmebot bot referenced this issue in VectorXz/elasticsearch May 28, 2021
fixmebot bot referenced this issue in VectorXz/elasticsearch Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

2 participants