box / box-python-sdk

Box SDK for Python
http://opensource.box.com/box-python-sdk/
Apache License 2.0
419 stars 215 forks source link

Chunked uploader hangs for large files #870

Closed axatha closed 5 months ago

axatha commented 6 months ago

When I try to upload a file of size > 2GB or so, chunked uploader code hangs and upload never completes. I tried to add some debug logs and its seems to be hanging when the futures (trying to upload parts in parallel) are waiting to complete. Looks like some futures are just not completing.

Using python SDK version '3.9.2'

However, when I upload all parts sequentially uploads are successful.

axatha commented 6 months ago
folder = client.folder(folder_id).get()

uploader = folder.get_chunked_uploader(file_path, file_name)

try:
    file = uploader.start()
except BoxAPIException as err:
    if err.code == "upload_session_not_found":
        file = uploader.resume()
    else:
        raise err
mhagmajer commented 6 months ago

Hello @axatha. Thanks for posting! Can you clarify if the code you posted is the code causing errors? Also, please consider using https://github.com/box/box-python-sdk-gen/ which is our new generation of Python SDK. Upload related errors can sometimes be difficult to debug. Are you using a proxy? How long does the upload operation take before it hangs on your end with a large file?

axatha commented 6 months ago

Yes, I pasted the code I am using. I am not using a proxy and it usually hangs after a few mins.

congminh1254 commented 6 months ago

Hi @axatha

It seems like the uploader have some issue with the internet connection during upload. Can you try with lower upload thread by following this configuration and check if it can be upload successfully?

And just to confirm, the issue will happen all the time or only sometime or with some special files?

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

stale[bot] commented 5 months ago

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time.

axatha commented 4 months ago

I have an upload bandwidth of 700Mbps. So the failure was def not because of slow internet. Are you able to validate that you can upload a file > 10GB using chunked uploader?