Skip to content
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

XHRUpload upload stalled for 30s #2929

Closed
fildahui opened this issue Jun 14, 2021 · 13 comments · Fixed by #4247
Closed

XHRUpload upload stalled for 30s #2929

fildahui opened this issue Jun 14, 2021 · 13 comments · Fixed by #4247
Assignees

Comments

@fildahui
Copy link

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

@arturi
Copy link
Contributor

arturi commented Jun 15, 2021

@aduh95 could you try to reproduce this, please?

@aduh95
Copy link
Contributor

aduh95 commented Jun 16, 2021

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?

@arturi arturi added XHR Upload and removed Triage labels Jun 19, 2021
@wamesro
Copy link

wamesro commented Jun 22, 2021

I have the same problem

Did you change timeout to uppy or php?

@american-it
Copy link

Same here.

@aduh95
Copy link
Contributor

aduh95 commented Jul 21, 2021

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.

@Murderlon
Copy link
Member

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

@usmanrashid17
Copy link

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

@azinkey
Copy link

azinkey commented Feb 14, 2022

same here

@devenairevo
Copy link

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

@Leave-it-blank
Copy link

@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

@Murderlon Murderlon reopened this Jul 11, 2022
@chris72205
Copy link

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.

@kevalrathod
Copy link

kevalrathod commented Dec 2, 2022

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

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

@mifi
Copy link
Contributor

mifi commented Dec 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.