alexmi256 / gofile-uploader

Gofile.io uploader supporting parallel uploads
MIT License
5 stars 0 forks source link

Uploading large files result in timeout #6

Closed mxrharem closed 4 months ago

mxrharem commented 4 months ago

I used this command gofile-upload -t redacted -z eu --public --no-use-config --no-save -f vods 2024-07-11_2195212115_potasticp_cleaning_up_through_dawntrailas_rem.mkv

Using config doesn't change the outcome. Smaller files work fine. Is there a way to increase the timeout duration?

2024-07-11_2195212115_potasticp_cleaning_up_through_dawntrailas_rem.mkv:  88%|█████████████████████████████▊    | 9.10G/10.4G [05:00<00:42, 32.6MB/s]
ERROR:gofile_uploader.gofile_uploader:Failed to upload 2024-07-11_2195212115_potasticp_cleaning_up_through_dawntrailas_rem.mkv due to:0:46, 29.8MB/s]
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/gofile_uploader/gofile_uploader.py", line 203, in upload_file
    async with session.post("/contents/uploadfile", data=data) as resp:
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/client.py", line 1197, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/client.py", line 608, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/client_reqrep.py", line 971, in start
    with self._timer:
  File "/usr/local/lib/python3.11/dist-packages/aiohttp/helpers.py", line 735, in __exit__
    raise asyncio.TimeoutError from None
TimeoutError
Files uploaded: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [05:00<00:00, 300.20s/it]
[{'fileNameMD5': '40ebd82c57d1fdfc4825d57bfbafe3cd',
  'filePath': '2024-07-11_2195212115_potasticp_cleaning_up_through_dawntrailas_rem.mkv',
  'filePathMD5': '40ebd82c57d1fdfc4825d57bfbafe3cd',
  'uploadSuccess': None}]
alexmi256 commented 4 months ago

How big was the file? I can try to replicate it by uploading a large file of similar size and improve the logging of errors.

I'll try with a 10gb file and see how I can improve the logging.

One thing I did notice was that requesting a server region doesn't guarantee that you will get servers in that region so you could end up uploading to na even though you wanted eu

mxrharem commented 4 months ago

It's 10.4 gb. I tried using more workers which did not help.

| 9.10G/10.4G [05:00<00:42, 32.6MB/s]

I didn't notice that the region was changed, but I doubt that matters much.

If there's any logs or extra info I can provide let me know how. Thanks for the quick response!

alexmi256 commented 4 months ago

I'm also able to reproduce the issue. With a 13gb file it failed at around 10gb upload size. I tried increasing the aiohttp timeout from from 300s to 600s and it worked the second time. I'll try this out a couple more times and if it works I'll add a param for it in the next release.

alexmi256 commented 4 months ago

Try the latest prelease version to see if this fixes the issue pip install GofileIOUploader==0.12.0.dev2

For uploading, only a single session is created per file upload. I have no idea if/how chunking uploads is possible with multipart forms, I probably won't venture into that because of complexity.

mxrharem commented 4 months ago

This fixed the issue, I was able to upload the 10GB file, thanks a bunch!