Error#
Since 2026-10-18 15:00 UTC the 15-min models poll intermittently fails for Anthropic and Gemini in the same poll:
PostHog ingest_failed (job models-poll) | count | first seen | last seen |
|---|
anthropic: fetch failed: https://api.anthropic.com/v1/models?limit=100 → 403 Forbidden | 3 | 15:45:23 | 18:30:22 |
anthropic: anthropic models overview: parsed 0 model rows | 1 | 15:00:28 | 15:00:28 |
gemini: fetch failed: https://generativelanguage.googleapis.com/v1beta/models?pageSize=1000 → 400 Bad Request (incl. 2 pre-#351 events with ?key=) | 4 | 15:00:30 | 18:30:23 |
The two providers fail together (15:00, 15:45, 16:00, 18:30) and the polls in between succeed (/v1/status shows both lastPolledAt 18:15). Neither error appears in the previous 30 days. Same keys, so a revoked key would fail every poll, not 4 of ~15.
Hypothesis (unconfirmed)#
Both APIs reject requests by caller location: Gemini returns 400 FAILED_PRECONDITION "User location is not supported for the API use" and Anthropic returns 403 "Request not allowed". A cron invocation that egresses from an unsupported region would produce exactly this pair. It cannot be confirmed from our telemetry because fetchJson/fetchText (src/server/providers/types.ts) throw only status statusText and discard the response body, which is where both providers say why.
Fix#
Quote a short, whitespace-collapsed snippet of the error response body in the fetchJson/fetchText error. The next failing poll then names its cause, and we can decide on a placement change (or a key problem) with evidence instead of guessing. The error still throws exactly as before.