-
Notifications
You must be signed in to change notification settings - Fork 39
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
Publishing to S3 URL fails with java.lang.IllegalArgumentException: No region provided #5
Comments
We try 3 different methods: 1. Parsing directly out of the URL that is being used (this seemed broken for s3:// URLs) 2. Doing a DNS lookup of <bucket>.s3.amazonaws.com and then reversing the resulting IP to see if it has a region in it. I think this was working at one point but they seem to be using different hostnames now so I'm now trying to regex extract the region. 3. Using the AmazonS3Client.getBucketLocation call to determine the region. This only works if the AWS credentials have access to the getBucketLocation call which is why it's last.
I've attempted to fix this. Looks like there were multiple issues with the region detection code. The resulting code is a little messy and could use some simplification but it appears to be working now. I've published the fix under the 0.4.0-SNAPSHOT version. Can you try with that version and see if it works? In your
|
I successfully tested the fix with the following URL formats: s3://repo.munchii.com/snapshots |
Great! I'll get that published to Maven Central as 0.4.0 |
0.4.0 is up on Central: http://repo1.maven.org/maven2/com/frugalmechanic/fm-sbt-s3-resolver_2.10_0.13/0.4.0/ |
Thanks - I was able to successfully upgrade to 0.4.0. |
This is the URL I'm using (I've tried the variations listed in the README.md):
s3://s3-us-west-2.amazonaws.com/repo.munchii.com/snapshots
And this is the exception I see:
java.lang.IllegalArgumentException: No region provided
at com.amazonaws.AmazonWebServiceClient.setRegion(AmazonWebServiceClient.java:356)
at com.amazonaws.services.s3.AmazonS3Client.setRegion(AmazonS3Client.java:503)
at fm.sbt.S3URLHandler$$anonfun$getClientBucketAndKey$1.apply(S3URLHandler.scala:118)
at fm.sbt.S3URLHandler$$anonfun$getClientBucketAndKey$1.apply(S3URLHandler.scala:118)
at scala.Option.foreach(Option.scala:236)
at fm.sbt.S3URLHandler.getClientBucketAndKey(S3URLHandler.scala:118)
at fm.sbt.S3URLHandler.getURLInfo(S3URLHandler.scala:126)
at fm.sbt.S3URLHandler.getURLInfo(S3URLHandler.scala:80)
I haven't had a chance to dig too deep, but I wonder if it might be related to this commit where AmazonS3URI now treats URLs that begin with s3:// differently:
aws/aws-sdk-java@1d8722f#diff-53c1eb1cf3afbc306872e09dbd33ec7f
The text was updated successfully, but these errors were encountered: