Repository navigation
Open
Labels
Milestone
Description
Summary
A media upload whose body takes longer than 60 s to arrive fails with 502. Traefik v3 stops reading a request after its default readTimeout of 60 s, and scripts/traefik/traefik.yml sets no respondingTimeouts. The upload cap is 10 MiB (DEFAULT_MEDIA_MAX_FILE_SIZE), so a full-size file needs about 175 KB/s of upload speed. A phone on a weak connection has less.
Found 2026-11-20 while tracing the one real 5xx in the #710 7-day read.
Evidence (production, 2026-11-13)
| Time (UTC) | Route | Traefik | App | Body bytes received |
|---|---|---|---|---|
| 06:19:26 | POST /api/plugins/hypermultimedia/:documentId |
502 after 56.68 s |
500, AbortError: The connection was closed., 56,605 ms |
327,500 |
| 06:20:10 | same route, same document | 502 after 57.95 s |
500, same error, 57,178 ms |
229,250 |
- The same person tried twice, at about 4-6 KB/s, over HTTP/2. Both tries failed, and the person saw a failed upload.
- The app logs a client disconnect as
500and sends it to GlitchTip. So the API error rule counted it as a server error: 3 breach minutes, no firing (Keep health checks out of the API error and latency alerts #710 (c)).
Benchmark
| Field | Value |
|---|---|
| Metric | (1) Uploads that finish when the body takes longer than 60 s. (2) The status the app logs for a client disconnect |
| Before | (1) 0 of 2 in production on 2026-11-13. (2) 500, and a GlitchTip event |
| After | Not measured yet |
| Condition | Local: Traefik with the repo config, a 10 MiB upload throttled to 100 KB/s, n = 5. Production: 7-day count of 502 on the media route |
| Pass rule | (1) 5 of 5 finish. (2) A disconnect logs 499, sends no GlitchTip event, and stays out of the 5xx alert input |
Steps
| # | Change | Where | Owner |
|---|---|---|---|
| U1 | Set readTimeout on the websecure entry point long enough for a 10 MiB upload on a slow connection, for example 300 s. Keep idleTimeout short |
scripts/traefik/traefik.yml |
agent in the repo |
| U2 | Log a client disconnect during an upload as 499, without a GlitchTip event |
the upload route's error handling | agent in the repo |
| U3 | The local throttled test, before and after, n = 5 | local | agent in the repo |
U1 is a static Traefik change, so it ships in one Traefik restart with #746 and #802. A longer read timeout lets a slow client hold a connection longer, so it ships with #802's per-client cap, not before it.
Risk
- A longer
readTimeoutkeeps slow connections open longer. Keep one client from slowing the edge proxy for every site #802 E1 caps how many one client can hold. - U2 must not hide a real server fault. Map only an
AbortErrorthat happens while the request body is read.
Related
- Keep health checks out of the API error and latency alerts #710: the 7-day read that showed the one
5xx. - Keep one client from slowing the edge proxy for every site #802: the per-client cap that a longer timeout needs.
- Upgrade production Traefik to v3.7.18, with every static edge change in one restart #746: the Traefik upgrade and its restart.
Activity