cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

🐛Playback of any video file over Cloudflare Tunnel (via Immich) causes stream to be canceled

Open aspiziri opened this issue 6 months ago • 4 comments

Describe the bug When accessing Immich hosted on my local network via a Cloudflare Tunnel I run into the following error any time I attempt to interact with any video file:

2025-08-15T19:00:25Z ERR  error="stream 109 canceled by remote with error code 0" connIndex=1 event=1 ingressRule=6 originService=http://{removed}
2025-08-15T19:00:25Z ERR Request failed error="stream 109 canceled by remote with error code 0" connIndex=1 dest=https://immich.{removed}/api/assets/{removed}/video/playback?c={removed} event=0 ip={removed} type=http

To be clear - Immich loads completely fine, I can navigate and use the app perfectly fine for photos, making configuration changes, etc. But the second I even mouse over the thumbnail of a video (which would normally start playing a preview) it hangs in the UI and the above error is thrown in the Cloudflare logs.

This is a 100% repro.

I've see multiple other related bugs (#1105 and #1300 ) but in those ingressRule is 0 and in mine it is 6. I don't know if that helps identify anything specific to debug.

To Reproduce Steps to reproduce the behavior:

  1. Access Immich through a Cloudflare Tunnel
  2. Try and play back a video file of any kind

If it's an issue with Cloudflare Tunnel: 4. Tunnel ID : aa57fc79-c207-419b-a614-9bff2255d1a1 5. cloudflared config:

Expected behavior The video would start playing back.

Environment and versions

  • OS: Any/all
  • Architecture: Any/all
  • Version: Any/all

Logs and errors

2025-08-15T19:00:25Z ERR  error="stream 109 canceled by remote with error code 0" connIndex=1 event=1 ingressRule=6 originService=http://{removed}
2025-08-15T19:00:25Z ERR Request failed error="stream 109 canceled by remote with error code 0" connIndex=1 dest=https://immich.{removed}/api/assets/{removed}/video/playback?c={removed} event=0 ip={removed} type=http

Additional context N/A

aspiziri avatar Aug 15 '25 19:08 aspiziri

@aspiziri I was able to workaround this by disabling HTTP/3 with QUIC in the Cloudflare dashboard under [My Domain] > Speed > Optimization > Protocol Optimization. This way I was able to keep traffic proxying through the tunnel. I also had to wait several minutes for Cloudflare to propagate the change and some caching stuff blah blah blah. Not sure why this happens, but let me know if it helps!

danieloppenlander avatar Aug 18 '25 01:08 danieloppenlander

Huh interesting. Confirming this has solved my issue - thank you for the recommendation @danieloppenlander !

aspiziri avatar Aug 18 '25 02:08 aspiziri

This looks to have worked for me as well. Thank you @danieloppenlander.

edm00se avatar Aug 28 '25 18:08 edm00se

@aspiziri I was able to workaround this by disabling HTTP/3 with QUIC in the Cloudflare dashboard under [My Domain] > Speed > Optimization > Protocol Optimization. This way I was able to keep traffic proxying through the tunnel. I also had to wait several minutes for Cloudflare to propagate the change and some caching stuff blah blah blah. Not sure why this happens, but let me know if it helps!

Also experiencing this after deploying Immich. Tried disabling HTTP/3, but still getting these errors (been waiting 30 min so far). How long did you have to wait for the change to take effect? Did you leave the "HTTP/2 to Origin" and "0-RTT Connection Resumption" settings enabled? Does setting a the --protocol parameter on the tunnel run command matter at all?

fedamerd avatar Nov 17 '25 16:11 fedamerd

Confirming here as well. HTTP3 disablement fixed the issue.

AlexandruNegura avatar Dec 14 '25 19:12 AlexandruNegura