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

storage: HTTP 416 on GET request of 0 length file #242

Closed
kjlubick opened this issue Apr 13, 2016 · 2 comments
Closed

storage: HTTP 416 on GET request of 0 length file #242

kjlubick opened this issue Apr 13, 2016 · 2 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@kjlubick
Copy link

I have a gs bucket with several 0 length files in it. When I try to use the storage api, I get
Get https://storage.googleapis.com/bucket/zero-length-file: HTTP request failed inspite of exponential backoff: Got non server error statuscode 416 while making the HTTP GET request to https://storage.googleapis.com/bucket/zero-length-file

This has started happening recently. It works fine on any other file I try.

@dsymonds dsymonds added the api: storage Issues related to the Cloud Storage API. label Apr 15, 2016
@okdave okdave self-assigned this Apr 19, 2016
@okdave
Copy link
Contributor

okdave commented Apr 19, 2016

416 is http.StatusRequestedRangeNotSatisfiable so that makes a bit of sense.

I'll take a look.

@okdave
Copy link
Contributor

okdave commented Apr 19, 2016

OK, so GCS is doing the right thing. We're asking for the range 0- which is valid, but since there isn't at least 1 byte that satisfies it, GCS is obliged to respond with a 416.

If a syntactically valid byte-range-set includes at least one byte- range-spec whose first-byte-pos is less than the current length of the entity-body, or at least one suffix-byte-range-spec with a non- zero suffix-length, then the byte-range-set is satisfiable. Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set is unsatisfiable, the server SHOULD return a response with a status of 416 (Requested range not satisfiable). Otherwise, the server SHOULD return a response with a status of 206 (Partial Content) containing the satisfiable ranges of the entity-body.

This should be easy enough to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants