-
Notifications
You must be signed in to change notification settings - Fork 50
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 Invalid Range 416 error when trying to read empty directory #1145
Comments
Since we don't know if the key is not present in advance, the way to fix this is to check the exception and return an empty stream if the exception indicates a non-existing key. Looking at this exception, it needs to be made clear how to identify that this key does not exist. I want to avoid parsing the exception message to figure it out. |
According to AWS docs, a 416 should be accompanied with We could catch it like:
|
I am not convinced that InvalidRange ALWAYS means no key to read. |
I don't see any other status codes/ error messages in S3 docs that return |
@semenodm do you have any updates here? |
The
readFileMultipart
API is unable to read files from an empty directory and errors out with an S3 exception.Steps to reproduce:
Let's say we have a bucket
localbucket
has folder calleddirectory
but there is no files inside it.Output:
Actual:
Expected:
Empty Stream with
new Array[Byte](0)
The text was updated successfully, but these errors were encountered: