Replies: 9 comments 2 replies
|
Hey
Do you have a suggestion/idea/principle on how to establish that some assets "are clearly impossible to upload"? (Not a code suggestion, just algorithm/concept) Re: Cloudflare. There is a section in FAQ https://docs.immich.app/FAQ/#why-are-only-photos-and-not-videos-being-uploaded-to-immich
Also, you can search GH Issues and Discussions for "cloudflare large". A couple of recent threads: |
|
I understand that the inability to upload large files is not an issue on Immich's side. The main issue here is not the inability to upload large files, but rather that when uploads get stuck on a few specific files for some reason, the queue becomes occupy by the stuck files, making it extremely long to complete (or even impossible to complete) the upload of other files. This is particularly problematic when uploading a directory containing many files, as you'll have to remove the video files and start the upload again. Regardless of whether or not Cloudflare is used on the Immich server, reverse proxies (such as nginx) typically have some limit on the size of uploadable files. This is recommended from a security perspective. Modern high-resolution video files often far exceed these sizes.
If the administrator is aware of the reverse proxy's limitations (which is likely the case in most cases), they can set them in the control panel and have Immich's client-side processing skip uploading files that exceed the limit. Alternatively, I would suggest implementing a workaround, such as a button to abort individual files during upload. This would allow users to skip over large files if they've accidentally added them to the upload queue. |
|
Thank you for the explanation. Currently Immich server and web UI properly handles explicit connection state changes such as HTTP 4XX and connection resets. It marks the asset upload attempt as failed: So your suggestions above sound like a feature request(s). Broadly speaking: more sophisticated asset upload mechanism. In particular:
I suggest searching through the existing feature requests / discussions, issues, PRs (someone might already tried to implement one of your suggestions) and either comment there or create a new FR as you see fit. For now I'm going to convert this topic into a Q-and-A discussion. If you can reproduce the bug (stalled upload queue due to max body size limit) using a reverse proxy such as Nginx/etc instead of Cloudflare then please post the repro steps. I did a quick test but wasn't able to reproduce it with a basic Caddy config (below), Firefox, uploading 10 large video files. :8080 {
request_body {
max_size 1MB
}
reverse_proxy http://localhost:2283
} |
|
I am testing as well. I do use cloudflare. I decided to use Automatic URL switching and point to the local server address when on my home WiFi. I did confirm i am connecting thru the local ip, but the bug described in this discussion persists. So this should not be a Cloudflare error, I am not sure what else could be causing the bug. hmmm |
|
I do have the exact same issue. Using Cloudflare (but not Cloudflare Tunnel) No matter if i'm connecting through HTTPS ou through my local network (192.168.x.x) I cannot upload large MP4 file... get stuck at 0% (on my PC) . But on my phone, it seems to try to upload something since I see the phone wifi bandwith speed on the upper right saying i'm uploading at 54 mbps... The file never finally upload and try to upload for ever.` |
|
When I tried to reproduce this issue in Safari (macOS 26), I found that the request seemed to get stuck even though the browser's developer console showed a 413 error. The following error was also output to the browser console: In cases where the upload would immediately fail with a 413 error (which is normal), a This might not be a Cloudflare or reverse proxy issue, but rather a bug in Immich where it doesn't handle errors properly when hash calculation fails. |
|
I tried it in Google Chrome and it's stuck with the same error. The request doesn't fail with 413, but the upload doesn't progress past 0%. |
|
To investigate the problem, I wrote a simple HTTP server in Go that discards the content POSTed from XMLHttpRequest to In Google Chrome, it got stuck similarly to Immich. While Safari sometimes produced different results, it mostly got stuck in the same way. Based on this, it's likely not a bug in Immich's program but rather a network problem caused by large POSTs. It's possibly related to Cloudflare's DDoS mitigation features, but we have limited knowledge about Cloudflare, so it's unclear. There are also comments that the same problem occurs in environments not using Cloudflare, which suggests it might not be a Cloudflare issue. I believe that implementing Chunked Uploads (#1674) is probably the only fundamental solution. Not using Cloudflare Tunnel is practically impossible, especially in environments without a static global IP or for those using an ISP that doesn't provide a dedicated global IPv4 address to individuals. While it can be avoided with workarounds like purchasing a VPS combined with Tailscale, this is undesirable because it costs money and introduces monthly bandwidth limitations. |
|
I think that to address this issue the Immich app and server should split uploads into chunks, that way, it will make the upload more reliable by preventing very large files to timeout because of the time it takes to upload a file of several GB, and prevent proxy issues that has a limit on the size of the requests. |



Uh oh!
There was an error while loading. Please reload this page.
I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.
The bug
When uploading large video files, the file upload often gets stuck at 0% for long periods of time, and it takes a long time for the upload to fail with a 413 error.
The first file fails with 413, but the others get stuck at 0%.
It is unclear whether this is an Immich issue or a Cloudflare issue.
This causes extremely long upload times for directories containing large numbers of video files.
If this is not an Immich bug, then large video files that are clearly impossible to upload should be skipped instead of uploaded.
To avoid this issue, a feature is needed that allows server administrators to set a limit on the size of uploadable files and automatically skip those files.
The OS that Immich Server is running on
Ubuntu Server 24.04
Version of Immich Server
v2.2.3
Version of Immich Mobile App
Web Client
Platform with the issue
Device make and model
No response
Your docker-compose.yml content
Default configuration file without modificationsYour .env content
Reproduction steps
...
Relevant log output
Additional information
No response
All reactions