uppy icon indicating copy to clipboard operation
uppy copied to clipboard

XHRUpload upload stalled for 30s

Open fildahui opened this issue 3 years ago • 10 comments

I am using the XHRUpload plugin with uppy with mostly its default configuration. I noticed that for all the files that are greater than 50MB the upload progress gets close to 100% (by looking at the callback data of the upload-progress handler) but then the upload fails with the error Upload stalled for 30 seconds, aborting.

That was happening on different servers and since I am not configuring the timeout option (30s by default) I tried to increase it (and actually setting it to 60s kind of solved the issue, at least for files < 100MB). At first I though at some issue with the servers but I got the same error also when using a fake upload server (just an endpoint that accepts a post request and returns OK, nothing else).

I had a look and tried your XHRUpload sample to (https://uppy.io/examples/xhrupload/) and it failed in the same way with files greater than 50MB (succeeded for smaller files).

I did not find any particular warnings about the files size so I am not sure it is something that only depends on the server... could it be an issue with the plugin? or is it the intended way it should work? Because it doesn't seem to be doing anything after it uploads all the data, just waiting for something

image

fildahui avatar Jun 14 '21 12:06 fildahui

@aduh95 could you try to reproduce this, please?

arturi avatar Jun 15 '21 09:06 arturi

I can reproduce:

[Uppy] [14:50:46] [FileInput] Something selected through input...
[Uppy] [14:50:46] Added file: compare.bmp
 id: uppy-compare/bmp-1e-image/bmp-63766666-1623744082417
 type: image/bmp
[Uppy] [14:50:46] [XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0
[Uppy] [14:50:46] [XHRUpload] Uploading...
[Uppy] [14:50:46] uploading 1 of 1
[Uppy] [14:50:46] [XHRUpload] ckpzh2xcr00013e5slagppx5i started
[Uppy] [14:50:47] [XHRUpload] ckpzh2xcr00013e5slagppx5i progress: 163840 / 63767055
…
[Uppy] [14:51:47] [XHRUpload] ckpzh2xcr00013e5slagppx5i progress: 12402688 / 63767055
[Uppy] [14:52:17] Failed to upload compare.bmp Upload stalled for 30 seconds, aborting.

If I force the timeout to Infinity, I end up the following error:

Access to XMLHttpRequest at 'https://xhr-server.herokuapp.com/upload' from origin 'https://uppy.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

For completeness sake, I've tried disabling CORS on my browser, and I was now getting 503 errors. Maybe it's a bug or limitation on Heroku side?

aduh95 avatar Jun 16 '21 13:06 aduh95

I have the same problem

Did you change timeout to uppy or php?

wamesro avatar Jun 22 '21 13:06 wamesro

Same here.

american-it avatar Jun 24 '21 01:06 american-it

I'm not able to reproduce locally, I was able to upload a 6 GiB file over 15 minutes, without hitting this limitation. IMHO it is indeed a limitation (bug?) of the Heroku demo.

aduh95 avatar Jul 21 '21 14:07 aduh95

Agreeing with @aduh95's outcome, we can reopen this if it occurs on other providers than Heroku as well.

Murderlon avatar Dec 02 '21 13:12 Murderlon

I am facing the same issue on video upload. Please guide me: XHRUpload upload stalled for 30s

usmanrashid17 avatar Jan 14 '22 10:01 usmanrashid17

same here

azinkey avatar Feb 14 '22 11:02 azinkey

Guys, do you have any solution for this issue? I am last version of Uppy

inajaf avatar Apr 22 '22 13:04 inajaf

@Murderlon I am facing same error on laravel vue installation, it seems to just stall out on some images but works on some. image

image

Leave-it-blank avatar Jul 08 '22 22:07 Leave-it-blank

We are seeing this issue as well in an app and are not on Heroku. We show upload requests as completing successfully in the server logs (returning 2xx) but with no obvious pattern, users receive this error in the browser.

chris72205 avatar Nov 21 '22 21:11 chris72205

Yes, Even I am facing the same issue while uploading a large video file (8GB+).

Screenshot from 2022-12-02 15-40-28

kevalrathod avatar Dec 02 '22 11:12 kevalrathod

Managed to reproduce on MacOS by starting an upload and then setting Network Link Conditioner to 100% loss.

Screenshot 2022-12-05 at 22 17 10
[Uppy] [22:16:41] Failed to upload lofoten.mp4 Upload stalled for 30 seconds, aborting.
Error: Upload stalled for 30 seconds, aborting.

But I would say this is working as intented. We might want to increase default progress timeout past 30 seconds, because sometimes connections will have hiccups that last more than 30 sec, or for some reason XHR progress events get delayed by 30+sec. However XHR is simply not suited for uploading large files over unreliable connections. We might want to add a retry option too, but again for large files, retry is not very good because it will start all over from the beginning. It's recommended to use a different protocol like TUS which is better suited for retries and batched uploading of large files.

mifi avatar Dec 05 '22 14:12 mifi