-
Notifications
You must be signed in to change notification settings - Fork 883
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
S3 HeadObject throws S3Exception: null instead of NoSuchKeyException when no object exists. #1941
Comments
@dhegberg I was not able to reproduce, I get Can you provide the full stacktrace with the error you're seeing? |
The s3 client is being created as part of a dagger module: @provides Stack Trace (This is being run in a Java8 lambda): Cause { |
This seems to be a problem with the execution environment rather than the client. Local runs were successful, the issue only occurred in a Lambda. |
I actually have this exact issue. I run in EKS and am seeing this happen regularly.
The client is built
|
I should clarify that this request fails very frequently (think thousands of times per week) but also succeeds frequently. There are random 8 hour periods where we dont see one of them and then other 8 hour periods where we see 500 an hour. |
For what it's worth, in my case at least, S3 seems to respond with these errors when specifying a non-existent versionId. |
My application create files on S3 if its not exist , which is dependent s3.headObject call , suddenly function started throwing error with null, any suggested solution ? we are running code through lambda |
happened to me when i used "us-east-1" instead of "us-east-2" where the bucket was located. |
…f2be0747a Pull request: release <- staging/9fd7d256-c1fd-492d-ad6f-9a5f2be0747a
In case anyone else finds it useful, I got this same error when I was updating a lambda to work with versioned objects. In my case, I needed to add the |
And I got it when I was using S3Proxy in a docker (out testing environment), was putting a file in S3 and the file key started with a slash / |
If it helps, I was having this issue with my Springboot v3 application when I tried to call
|
Was running into this, my fix was to add the ListBucket permission for the bucket I was trying to read from. |
Expected Behavior
Documentation states HeadObject will throw NoSuchKeyException if the object does not exist.
Current Behavior
HeadObject throws S3Exception: null instead.
Steps to Reproduce
For a key that does not exist.
Context
Documentation states HeadObject will throw NoSuchKeyException (https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/S3Client.html#headObject-software.amazon.awssdk.services.s3.model.HeadObjectRequest-) but a S3Exception: null is thrown instead.
This is stated to be fixed in #544
Your Environment
The text was updated successfully, but these errors were encountered: