-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Unsigned Requests #1122
Comments
S3 default credential chain has anonymous access which doesn't require any credentials. So you shouldn't have got that exception. What SDK version are you using? Can you try with the latest? |
We were on Code snippet: val s3Client = AmazonS3ClientBuilder.standard().withRegion(Regions.AP_SOUTHEAST_2).build()
s3Client.getObject(bucketName, filename).getObjectContent Error:
Edited to remove stray information |
Just found a second stray set of credentials on my laptop 🤦♀️ (sorry this thing hasn't been wiped in 3 years 😬). Edited my last comment to remove the misleading information about access keys. |
So we did some detective work! 🔍 Because we're creating the S3 client using the We found that we can get around this by doing the following (excuse the hacky scala 🙈): val s3Client = AmazonS3ClientBuilder.standard()
.withRegion(Regions.AP_SOUTHEAST_2)
.withCredentials(new MyCreds)
.build()
class MyCreds extends DefaultAWSCredentialsProviderChain {
override def getCredentials = {
try
super.getCredentials
catch {
case ace: AmazonClientException => {
}
}
null
}
} Should I open a new issue for this or re-purpose the current one? (Sorry for not including the wire log. We haven't figure out how to get it working with our scala app) |
The SDK should be using S3CredentialsProviderChain instead of DefaultAWSCredentialsProviderChain for S3. This looks like a bug in the SDK. Thank you for the research. I will look into it and update you soon. |
The fix will be included in our next release |
@alyssaBiasi looking at this a bit more when I realize that the S3 builder is now inconsistent with the client constructor however, the builders represent how we intend the code to behave in the future. It doesn't really make sense for S3 to have it's own credential provider chain just to support this case that is easily configurable. The S3 client constructor method also behaves inconsistently with other clients making debugging more complicated - compounding the desire to move away from the custom chain. Thoughts about adding an |
I think calling out the fact that the request falls back to anonymous makes sense to me @kiiadi. We ended up calling our one |
@alyssaBiasi since we've already corrected the behaviour we won't change this for the current version of the SDK - however in the next major version we'll likely move to the approach I described above. Closing this for now since the change to make it the builder consistent with the constructor has already gone out in 1.11.123 of the SDK last wee. |
Hello, I want to access public datasets from Spark which relies on Sorry for being a noob, but could you please point out how I can have anonymous access ? Or it's simply not possible with current version ? |
From the issue it appears to be a bug in Spark, the SDK definitely allows anonymous access for S3 (default fallback behavior in both client constructors and per this issue the client builders). Can you move this issue to Apache Sparks repo? |
@shorea thank you for the timely reply ! I submitted an issue to Apache Spark too. But to me the issue seems to come from these lines in I am using P.S. I am commenting here rather than new issue because it fails with the same message |
Hi, Is there any AWS person to confirm or refute this is the case? I'm stuck so I'll figure out something else for now but it would be great to get to the bottom of this issue. Thx all. |
Currently the following error is thrown when trying to read objects from an S3 bucket with public ACLs:
Would it be possible to add the ability for the SDK to work without credentials?
The CLI does this through the
--no-sign-request
flag and it looks like something similar will be added to the Ruby SDK.It would be awesome if the SDK could just work ™️ when there are no credentials available without having to pass it some sort of configuration.
The text was updated successfully, but these errors were encountered: