-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
HttpError 400 on uploading 0 bytes files, 416 on downloading 0 bytes files #638
Comments
Hi @9kmmr, could you let us know which version of the API (V2 or V3) you are using? |
@busunkim96 The error states Drive V2. (It's generally recommended to use V3) @9kmmr It looks like the API request is bad. Here are more samples for uploading files: |
@busunkim96 It is V2 |
@9kmmr Is using Drive V3 API possible in your environment? |
@9kmmr Please re-open this bug if it's still an issue for you. |
same error, using python. V3 of the drives, python 3.8 and windows 64 bit |
I'm still seeing this issue with google-api-python-client 1.7.10. Example code can be found here in the Forseti repo. A |
Well, in fact I didn't had to deal with that. For my concrete example, I've decided to avoid zero size files and that's all.
El mar., ene. 14, 2020 a 23:27, Gregg Kowalski<notifications@github.com> escribió:
I'm still seeing this issue with google-api-python-client 1.7.10. Example code can be found here in the Forseti repo. A googleapiclient.errors.HttpError 416 exception is raised on the call to next_chunk() when downloading a 0 byte file. I see several closed issues related to this issue. What's the best way to fix this?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Unfortunately there are cases when we are exporting data from GCP to GCS, and some times those files are 0 bytes in size so it's not something we can avoid. |
We are running into this as well. Ignoring 416 does the job, but looks like a hack. We are using v2 though (google-api-python-client-1.11.0), as we can't migrate easily to v3. @SurferJeffAtGoogle Looks like other people are having this issue as well, should we reopen this issue? Or is it fixed in v3 and older ones won't be fixed? |
We confirmed that other clients fetch 0-bytes files without error, so this must be an issue with the python client. |
The initial content_range = "bytes %d-%d/%s" % (self.resumable_progress, chunk_end, size)
|
The empty upload succeeds once the |
Thank you so much @busunkim96 ! 🙏 |
@busunkim96 @SurferJeffAtGoogle Upload works flawlessly now, but downloading still fails with 416 as discussed in this ticket, so looks like it shouldn't be closed. Or am I missing something? EDIT: here is the exc https://travis-ci.com/github/iterative/PyDrive2/jobs/403036538#L557 |
Ah, I missed the download part of this. Re-opening. |
Thank you so much for a quick ⚡ ⚡ ⚡ fix @busunkim96 ! 🙏 |
It seems like the bug #241 and @Aran-Fey's problem happened again when i trying to download and upload 0 bytes file using google drive api.
throws
The text was updated successfully, but these errors were encountered: