Skip to content

Fennec Errors & User-Visible Failures

Fennec is a thin SPA — most “fennec errors” are upstream failures from brain or the embedded Strapi backend, surfaced via TanStack Query error states. This page enumerates the failures an operator is likely to see in the UI and what to do about them.

Errors fall into four buckets:

  1. Auth — Clerk session, role gating, JWT issues
  2. Network — CORS, DNS, upstream unavailable
  3. Validation — 4xx from upstream, malformed payloads
  4. Build / runtime config — missing env vars, prefix mistakes

Auth

#What the user seesLikely causeFirst action
1Stuck on “Loading…” indefinitely after loginuseCurrentUserQuery failing silently — brain returns 401 but Clerk session loadedCheck browser console for /users/me 401; verify REACT_APP_BRAIN_URL and that Clerk JWT is being sent
2Redirected back to /profile from a guarded routePrivateRoute saw isError or insufficient role from /users/me (PrivateRoute.tsx)Confirm the user’s role in brain DB; check useCurrentUserRole output in React DevTools
3Redirected to /login immediately on every page loadClerk session expired or not initialised; window.Clerk undefinedForce sign-out, clear cookies for the Clerk frontend domain, sign back in
4”401 Unauthorized” toast on a brain mutationJWT expired mid-session; getClerkToken returned emptyReload page (Clerk refresh) or sign out/in. If persistent, see fennec-runbook.md Clerk section
5Login page renders but Clerk widget never mounts (blank panel)REACT_APP_CLERK_PUBLISHABLE_KEY missing or wrong-environment keyVerify env value matches the Clerk instance for this deploy (dev vs prod)
6”Forbidden” / 403 on admin pages for an existing adminRole drift between Clerk metadata and brain users tableCross-check GET /users/me response; reconcile in brain

Network / upstream

#What the user seesLikely causeFirst action
7”Network Error” or ERR_NETWORK on every brain callREACT_APP_BRAIN_URL wrong, brain down, or DNS failurecurl $REACT_APP_BRAIN_URL/health; check Railway brain deploy status
8CORS preflight failure (“blocked by CORS policy”)Brain or Strapi CORS allowlist missing the fennec originUpdate upstream CORS config; brain config in apps/brain/src/config/
9”Cookies not sent” symptom: works locally, fails in deployed envwithCredentials: true requires Access-Control-Allow-Credentials: true and explicit originConfirm upstream is not using a * Access-Control-Allow-Origin; explicit origin required
10Spinner forever on a list page (e.g. Generations Dashboard)Upstream timeout; TanStack Query retrying silentlyDevTools → Network tab → look for hanging requests; check brain logs
11”502 / 503 Bad Gateway” toast or red pageUpstream rolling deploy or crashedCheck Railway deploy events for the affected upstream

Validation / 4xx

#What the user seesLikely causeFirst action
12”400 Bad Request” on a saveForm payload mismatch with upstream DTO; mapper driftInspect request body in DevTools; compare with brain DTO definition
13”404 Not Found” on a known resourceID typo, soft-deleted record, or env points at the wrong DBConfirm REACT_APP_BACKEND_URL / REACT_APP_BRAIN_URL match expected environment
14”409 Conflict” creating a preset / promptDuplicate name; unique constraintRename and retry
15”413 Payload Too Large” uploading mediaUpstream body limit hit before R2; image not routed via pre-signed URLUse the pre-signed-URL flow (brainInputMedia.ts) for large files
16”415 Unsupported Media Type”Browser failed to set multipart boundary, or Content-Type overridden by callerPass raw FormData to apiClient — it intentionally omits Content-Type for FormData
17”422 Unprocessable Entity” with no clear field errorStrapi validation; missing relationInspect Strapi response body — Strapi nests errors under error.details

Build / runtime config

#What the user seesLikely causeFirst action
18”undefined/users/me” appears as request URL in Network tabapiConfig.brain is undefinedREACT_APP_BRAIN_URL not baked into bundleSet the variable and rebuild (Vite inlines env at build time, not runtime)
19New env var added but value is undefined in appMissing REACT_APP_ prefix (see fennec-env.md)Rename variable; rebuild
20Image URLs broken on prod, fine in devVITE_IMAGES_CDN_URL read in lib/utils.ts:9 ignored due to envPrefix: "REACT_APP_"Switch the read to REACT_APP_IMAGES_CDN_URL (or drop the override), set in Railway, redeploy. TODO(@law): pick rename vs remove.
21”Maximum update depth exceeded” on a page using Semantic UI formLegacy Semantic UI React component re-rendering in StrictMode-equivalent pathMigrate component to shadcn/Base UI per fennec CLAUDE.md guidance
22Blank page after deploy, console shows MIME-type or 404 on /assets/*CDN cache pinned to old index.html referencing dropped chunk hashesFlush CDN per fennec-runbook.md; re-rollout

Triage flowchart

flowchart TD
A[User reports error] --> B{Auth-related?}
B -- yes --> C[Check Clerk session + /users/me + role]
B -- no --> D{Network tab shows 4xx?}
D -- 401/403 --> C
D -- 4xx other --> E[Validation: inspect payload + upstream DTO]
D -- 5xx --> F[Upstream incident: check Railway / brain logs]
D -- no request --> G[CORS or DNS — check console]
G --> H{undefined in URL?}
H -- yes --> I[Env var missing; rebuild required]
H -- no --> F