When increasing attachment upload limits from the admin panel to over 500 MiB, you aren't able to download files over 500 MiB even if upload worked fine. When downloading files over 500 MiB, media-proxy throws an error and rejects the download:
media-proxy-1 | {"timestamp":"2026-06-16T19:44:41.879912Z","level":"WARN","fields":{"message":"request rejected","req":"NY8KF0BHZ0Q5","kind":"attachment","method":"GET","path":"/attachments/1516471820922912790/1516508361430925312/hannah_montana_linux_x86_basic_edition.iso","query":"download=true","status":413,"duration_ms":3,"fetch_ms":0,"transform_ms":0,"nsfw_ms":0,"reason":"storage_error","source":"\"key=attachments/1516471820922912790/1516508361430925312/hannah_montana_linux_x86_basic_edition.iso err=stream too long\""},"target":"fluxer_media_proxy::request_log"}
Seems to be because of a constant MAX_MEDIA_PROXY_BYTES
Same error for me.
After investigating, I found that serve_stored_passthrough_stream() rejects any object whose size exceeds constants::MAX_MEDIA_PROXY_BYTES before attempting to stream it:
if head.content_length > constants::MAX_MEDIA_PROXY_BYTESasu64{returnstorage_error_response(key,StorageError::StreamTooLong);}
Hi! I would like to take this one
I reproduced the issue locally and confirmed the 413 on attachment downloads over 500 MiB. The limit seems to be shared between the media processing path and streamed attachment downloads, so I’m planning to keep the cap for media processing while removing it from the streaming path
Mind if I take this?
2 comments
Comment by @cirogargatagli
serve_stored_passthrough_stream()rejects any object whose size exceedsconstants::MAX_MEDIA_PROXY_BYTESbefore attempting to stream it:Deleted comment
Comment by @brunorsvr