#50651·supabase

PGRST303 "JWT issued at future" with sb_secret_ keys — skew sometimes exceeds a 2s retry budget (adds details to #49655)

Author: Abdelrahman-A8Created Sep 21, 2026Updated Sep 27, 2026
Labelsexternal-issueto-triage

Summary

Server-side REST requests authenticated with the new-format sb_secret_ API key intermittently fail with:

HTTP 401
PGRST303 — JWT issued at future

We never mint or send a JWT. The token being validated is created inside Supabase (the gateway exchanges the opaque sb_secret_ key for a short-lived JWT before forwarding to PostgREST), so the iat being "in the future" can only mean clock skew between two Supabase components.

This has been reported twice before and both were closed as awaiting-details:

  • supabase/supabase#49655 — same key format, same error
  • supabase/supabase#41294 — more severe variant (PostgREST ~15h ahead)

This report adds the details those were missing: a 19-day timeline, HTTP-level evidence, and a measurement showing the skew sometimes exceeds 2 seconds.


What we send

Client @supabase/supabase-js, server-side (Node 26)
Auth sb_secret_… key (new format, not a legacy JWT service key)
Token minted by us none
Our host Railway; our own clock shows no skew in our logs

The key format carries no iat claim, so the rejected timestamp cannot be one we supplied.


Timeline (all UTC)

2026-09-02 — 5 × HTTP 500 out of 501 requests over a 5-hour window, across three different public pages. Several independent server-side reads (settings, regions, payment methods, one product table) all failed in the same second with the identical message. One failure was reproduced in a browser; the Next.js error digest shown to the visitor matched the server log exactly.

2026-09-19 21:03:30 — public page → 500. Failing read was a select with an !inner join. Supabase returned 401 / PGRST303.

2026-09-20 11:12:29 — different public page → 500. Failing read was a simple single-table select. Same 401 / PGRST303.

Between those dates the error appeared only intermittently; it is not reproducible on demand, which is why this is a measurement report rather than a repro script.


Sizing the skew

After the 2026-09-02 event we added a fetch-level retry that fires only on 401/403 and this specific body signature:

Attempts 4
Backoff 120 ms, 320 ms, 600 ms, 1000 ms (~2 s total budget)

In one 11-minute window we observed two occurrences: one recovered inside the ~2 s budget, the other did not.

That is the part we think is new: #49655 reported recovery at ~1.4 s, which suggests sub-second skew. We have at least one occurrence where the skew outlived a 2-second retry budget.


Impact

Public, crawlable pages returned HTTP 500 to real visitors and to search-engine crawlers. The failure is transient and unpredictable, so it is invisible to uptime checks that sample infrequently.


Questions

  1. Can you confirm whether NTP skew between the API gateway and PostgREST is known on the affected instances, and whether there is a fix in progress?
  2. PGRST303 says "JWT issued at future" even when the caller supplied a non-JWT sb_secret_ key. Could the message distinguish gateway-minted tokens from caller-supplied ones? Right now users cannot tell "your clock" from "our clock", which is likely why the earlier reports were closed as external.
  3. Is there a supported client-side leeway/tolerance setting, or is retrying the only mitigation available to users?

Mitigations we shipped (context, not a fix request)

  • Fetch-level retry on this exact signature (above)
  • Config reads fall back to the last known-good snapshot for up to 5 minutes
  • One cached page serves its existing snapshot instead of a 500 when this specific error occurs

None address the cause. Happy to supply request IDs and exact timestamps privately for a specific project ref if that helps.