#4570·umami

Performance metrics endpoint returns 503 from the UI but 200 via API key (v3.4.0, PostgreSQL)

Author: pOwn3dCreated Sep 25, 2026Updated Sep 28, 2026
Labelsbug

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

  1. Self-hosted Umami 3.4.0 with PostgreSQL 16
  2. Track a site with data-performance="true" so web vitals are collected
  3. Open the Performance page for that site (last 24 hours)
  4. 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:

json
[{"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 relationalQuery from getPerformanceMetrics.ts directly 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.ts already patches BigInt.prototype.toJSON.
  • Schema validation — performanceMetricsQuerySchema accepts all four type values.
  • Route structure — chart/route.ts and metrics/route.ts are identical apart from the query function and the type / limit parameters.

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 in src/ 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 / metrics endpoints 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

bash
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