Edge returning 401 for /api/public/leaderboard — need edge-worker/cache help (project: The League)
theleagueca
HOBBYOP

19 days ago

Hi Railway team / community — we hit an edge/caching issue and need help diagnosing an edge worker or cached 401 that’s blocking our public and admin API calls.

Project: The League (projectId: ee2b1e78-bf28-4d13-8dab-4265edb9db30)

Service: Leaderboard App (service id: a95d9d22-caca-4182-8f69-10a0820ef677)

Domain: theleague-ca.com

Summary:

• We added a public leaderboard route (/api/public/leaderboard) and a middleware exemption. After merging and deploying, production intermittently returned HTTP 401 for that path. We also saw cached 404s for a temporary proxy route earlier.

• The app itself is healthy (Next.js start ok; sync ran and inserted recent rows). The 401s are being returned by railway-edge before Next handles the request.

Key evidence (please review):

• Deploy logs show Next started and sync completed with no app errors.

• HTTP log excerpt (edge) — repeated 401s for the public route:

GET /api/public/leaderboard 401 102ms

GET /api/public/leaderboard 401 11ms

GET /api/public/leaderboard 401 7ms

(also: GET / 200 ... and GET /api/sync/run 200 ... appearing in same logs)

What we tried:

• Merged middleware + public route changes and pushed to main.

• Purged CDN/edge caches and restarted Railway service replicas multiple times.

• Added a fallback/proxy endpoint and widened the public window; pushed and merged feature branches.

• Polled endpoints repeatedly; public route is reachable (200) but returning empty [] at times, and sometimes returns 401 at the edge.

• Admin-authenticated requests sometimes return 200 (from some clients) but often return 401 (edge).

Request:

• Could a Railway edge/infra engineer please inspect this project’s edge worker / CDN rules to see if there’s a rule caching/returning 401/404 for /api/* or specifically /api/public/*?

• If such a rule exists, please exempt /api/public/* and preserve Authorization headers (or advise how to forward them).

• If there are cached 401/404 responses, please purge them for:

https://theleague-ca.com/api/public/leaderboard

https://leaderboard-app-production-7056.up.railway.app/api/public/leaderboard

• If you need more logs or deploy IDs, I can paste them here (no secrets).

Thanks — Shane. Happy to DM any follow-ups or provide timestamps/deploy IDs

Closed

0 Replies

Status changed to Awaiting Railway Response Railway 19 days ago


Status changed to Closed noahd 19 days ago


Loading...