Performance metrics endpoint returns 503 from the UI but 200 via API key (v3.4.0, PostgreSQL)
Describe the Bug
On the Performance page, the Pages and Environment panels always show "Something went wrong". The /performance/metrics endpoint returns 503 for every value of type (path, title, device, browser), while /performance/stats and /performance/chart return 200 for the same website, the same time range and the same data.
The endpoint itself is not broken: called with an API key it returns 200 and correct data, both from inside the container and through the public reverse proxy. It only fails when called by the web UI with a session token.
Steps to reproduce
- Self-hosted Umami 3.4.0 with PostgreSQL 16
- Track a site with
data-performance="true"so web vitals are collected - Open the Performance page for that site (last 24 hours)
- Inspect the network panel
What I measured
| Call | Auth | Result |
|---|---|---|
/performance/metrics?…&type=path from the UI |
session token | 503 |
…&type=title / device / browser from the UI |
session token | 503 |
/performance/stats from the UI |
session token | 200 |
/performance/chart?metric=lcp from the UI |
session token | 200 |
/performance/metrics?…&type=path on localhost:3000 |
API key | 200 |
/performance/metrics?…&type=device on localhost:3000 |
API key | 200 |
/performance/metrics?…&type=path via public HTTPS |
API key | 200 |
| same endpoint, missing or invalid token | — | 401, as expected |
A successful response body, for reference:
[{"name":"/","p50":null,"p75":null,"p95":null,"count":2},
{"name":"/pricing","p50":2608,"p75":2608,"p95":2608,"count":1}]What I ruled out
- The SQL query — I ran the
relationalQueryfromgetPerformanceMetrics.tsdirectly against PostgreSQL: it returns correct rows. - Empty dataset — the 503 occurs both with 0 samples and with data present.
- The reverse proxy — the same request through the public HTTPS endpoint with an API key returns 200, and there is no 503 in the Traefik logs.
- Worker crash or OOM —
RestartCount=0,OOMKilled=false, 356 MiB used out of 11.7 GiB. - BigInt serialization —
src/lib/db.tsalready patchesBigInt.prototype.toJSON. - Schema validation —
performanceMetricsQuerySchemaaccepts all fourtypevalues. - Route structure —
chart/route.tsandmetrics/route.tsare identical apart from the query function and thetype/limitparameters.
Untested hypothesis
The UI issues two metrics requests concurrently (type=path and type=device), whereas every passing test above issued them sequentially. This is the only difference I could not test. I am flagging it as a lead, not as a finding.
Additional notes
serviceUnavailable()is the only place insrc/that produces a 503, and its only callers are the 2FA routes, so this status does not appear to come from application code.- The separate
stats/chart/metricsendpoints were introduced in 3.4.0 ("Separate performance stats, chart, and metrics datasets"), which may be why this has not surfaced yet. - All migrations are applied, including
18_add_performance.
Database
PostgreSQL 16
Relevant log output
Nothing is logged in the Umami container when the 503 is returned.
The container is healthy, has never restarted, and the Traefik access log shows no 503 either.Which Umami version are you using?
3.4.0 (ghcr.io/umami-software/umami)
How are you deploying your application?
Docker (Coolify), behind Traefik, on Linux
Which browser are you using?
Chrome
Source: umami-software/umami