Skip to content
Source
Sign inSign up
TanStack/schemas

Anthropic 403 and Gemini 400 fail the same models polls; fetch errors drop the provider's reason #352

Closedtombeckenham opened this issue 0 comments
tombeckenhamcommented

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)countfirst seenlast seen
anthropic: fetch failed: https://api.anthropic.com/v1/models?limit=100 → 403 Forbidden315:45:2318:30:22
anthropic: anthropic models overview: parsed 0 model rows115:00:2815:00:28
gemini: fetch failed: https://generativelanguage.googleapis.com/v1beta/models?pageSize=1000 → 400 Bad Request (incl. 2 pre-#351 events with ?key=)415:00:3018: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.

  1. tombeckenham closed this

Sign in to join this conversation.