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
Spliting into multiple chunks causing upload to get an 503 error #7
Comments
Digging into the src code, I see that chunkSize must be multiples of 1024 in order to take effect (Might be a good idea to document that requirement somewhere), so I updated my code to do this:
And successfully to get the file to split into 6 chunks. However, after doing this, the code just hangs for a long time in the first chunk, and errors out on the second chunk:
This seem to have something to do with having too many requests... when I split into 2 chunks things are fine, but fails if split into 6 chunks. |
Thank you for your comment. When I tested a sample file (the size is 12,081,664 bytes) using my library, the number of chunks is 10. And I confirmed that the file could be correctly uploaded. Unfortunately, I cannot replicate your situation. I apologize for this. But, I would like to try to correctly replicate your situation. When I could correctly replicate your situation, I would like to think of a solution. I deeply apologize that when I tested my library, no error occurs. |
Thank you for your response. Below is the callstack for your appraisal, I will do more testing too, and when I find more clues that may help you, I will let you know.
This error doesn't occur if I set the chunkSize statically to 5,242,880 with a file size 33,587,748 bytes, uploading in 7 chunks, it succeeds. When I switched to using the |
I thnk I figured out the issue. Google API document on resumable upload states:
So this means the chunkSize must be a multiple of 262,144 bytes instead of 1024. Updating my
You might want to update the logic below on the condition to apply
|
Thank you for replying. In my this answer, I clearly wrote about the specification of a chunk. https://stackoverflow.com/a/61133144 But, I noticed that I didn't add it in this library. So, I added it in README.md. |
Now, I updated this library by reflecting on the discussion here. |
Thank you very much for your fix! |
Welcome. And, I appreciate your contribution. |
@tanaikech
Hi,
Can you to see if there's a bug in your library, because in the response:
The res.progressNumber.end is always just 1. Is there a lower limit as to we can set the chunkSize to be?
My logic in spliting the chunk size is as follows:
It should be spliting the file uploads by 5 chunks, but it's not. Below shows my debug output:
The upload only happened once, not 5 times.
The text was updated successfully, but these errors were encountered: