Edit history

Self-hosted: media proxy cuts large attachment downloads after 30 seconds has not been edited, so there are no earlier versions.

Current version | Original by Recentiv
Show

Self-hosted: media proxy cuts large attachment downloads after 30 seconds

Reproduction steps

  1. Be on a selfhosted instance. in my case its on my truenas box with docker.
  2. Upload a file that is big enough so that a download would take more than 30 seconds. In my case a 100mb file and a 200mb file: with the upload off my server off 1.5 MB/s it takes longer than 30 seconds to download
  3. Download that file. After about thirty seconds it should stop the download and delete the temp file it created.

Expected behaviour

The download finishes, even if it takes a few minutes.

Actual behaviour

The download stops after about 40 seconds. And the temp file gets deleted. I tried it on my browser and on the linux and Windows desktop apps. Same behavior. I tested it with a 109 MB .exe and a 228 MB .mp4 The videoplayback is unaffected, but slow and choppy thanks to the slow upload of my server

Build information

Stable Desktop 2026.1101.102918, Web 2026.1101.230756, Windows 11 10.0.26200 (x64), Electron 44.10.0, Chrome 152.0.7977.169, Node 24.22.1, Locale de Stable Web 2026.1101.35536, Windows NT 10.0 (x64), Chrome 156.0.0.0, Locale de Stable Desktop 2026.1029.224039, Web 2026.1029.224039, Linux 6.12.107+deb13-amd64 (x64), Electron 44.9.1, Chrome 152.0.7977.167, Node 24.22.0, Locale de

Platform

Windows, Linux, Web, Self-hosting

Evidence

1. test trough my proxy at first.

$ curl -o /dev/null -w 'code %{http_code}, %{size_download} bytes, %{time_total} s\n' 'https://<domain>/media/attachments/<id>/<id>/20201011223143.mp4?REDACTED' curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2) code 200, 65189456 bytes, 44.073701 s

2. second test from my local network with no throttling

$ curl -o /dev/null -w 'code %{http_code}, %{size_download} bytes, %{time_total} s\n' -H 'Host: <domain>' 'http://<server>:15080/media/attachments/<id>/<id>/20201011223143.mp4?REDACTED' code 200, 239389769 bytes, 0.595878 s

3. Local network throttled to 1.5 MB/s

$ curl -o /dev/null --limit-rate 1500k -w 'code %{http_code}, %{size_download} bytes, %{time_total} s\n' -H 'Host: <domain>' 'http://<server>:15080/media/attachments/<id>/<id>/20201011223143.mp4?REDACTED' curl: (18) transfer closed with 169749577 bytes remaining to read code 200, 69640192 bytes, 39.127721 s

4. Second try Local network throttled to 1.5 MB/s but now with logs from the media proxy

$ curl -o /dev/null --limit-rate 1500k -w 'code %{http_code}, %{size_download} bytes, %{time_total} s\n' -H 'Host: <domain>' 'http://<server>:15080/media/attachments/<id>/<id>/20201011223143.mp4?REDACTED' curl: (18) transfer closed with 174722121 bytes remaining to read code 200, 64667648 bytes, 40.945339 s Media Proxy log: {"timestamp":"2026-11-02T17:58:25.671136Z","level":"INFO","fields":{"message":"request","req":"2JA7VA9QTTJC","kind":"attachment","method":"GET","path":"/attachments/<id>/<id>/20201011223143.mp4","query":"REDACTED","status":200,"duration_ms":149,"fetch_ms":0,"transform_ms":0,"nsfw_ms":0},"target":"fluxer_media_proxy::request_log"} SeaweedFS log: E1102 17:58:55.909824 s3api_object_handlers.go:1176 streamFromVolumeServers: streamFn failed after writing 74961872 bytes: write tcp 172.16.29.6:8333->172.16.29.16:52318: write: broken pipe E1102 17:58:55.911599 s3api_object_handlers.go:883 GetObjectHandler: failed to stream fluxer/attachments/<id>/<id>/20201011223143.mp4 from volume servers: write tcp 172.16.29.6:8333->172.16.29.16:52318: write: broken pipe

5. third try Local network throttled to 1.5 MB/s with logs from the media proxy

$ curl -o /dev/null --limit-rate 1500k -w 'code %{http_code}, %{size_download} bytes, %{time_total} s\n' -H 'Host: <domain>' 'http://<server>:15080/media/attachments/<id>/<id>/20201011223143.mp4?REDACTED' curl: (18) transfer closed with 172166969 bytes remaining to read code 200, 67222800 bytes, 37.332827 s Media Proxy log: {"timestamp":"2026-11-02T18:13:37.152613Z","level":"INFO","fields":{"message":"request","req":"PCWGE6EBDV8W","kind":"attachment","method":"GET","path":"/attachments/<id>/<id>/20201011223143.mp4","query":"REDACTED","status":200,"duration_ms":11,"fetch_ms":0,"transform_ms":0,"nsfw_ms":0},"target":"fluxer_media_proxy::request_log"} SeaweedFS log: E1102 18:14:07.739672 s3api_object_handlers.go:1176 streamFromVolumeServers: streamFn failed after writing 74319352 bytes: write tcp 172.16.29.6:8333->172.16.29.16:38692: write: broken pipe E1102 18:14:07.739740 s3api_object_handlers.go:883 GetObjectHandler: failed to stream fluxer/attachments/<id>/<id>/20201011223143.mp4 from volume servers: write tcp 172.16.29.6:8333->172.16.29.16:38692: write: broken pipe