OUTAGE: api.next 502 → fpa.photoreport.pt 500 (no auto error report) #280

Open
opened 2026-11-18 23:50:32 +00:00 by spark · 1 comment
Owner

Symptom

  • https://fpa.photoreport.pt/ → HTTP 500 (Next next_error, digest 3227098399)
  • UI: «Não foi possível carregar esta página. Tenta novamente.»
  • Middleware still rewrites to /arquivo/d26ceb8e-c146-4f68-abaf-c79ce3981b2d (host→archive id known)

Root cause (observed 2026-11-18)

  • https://api.next.photoreport.pt/health and /v1/health → HTTP 502 (openresty/nginx Bad Gateway)
  • Public DNS for api.next / fpa / site.next → 10.10.10.85
  • Site SSR fails because the archive page needs the API; site-server error reports also POST to the API (/v1/client-errors), so a dead API means no event reaches errors.bitreport.pt and Paperclip never opens a ticket automatically.

Why no automatic Paperclip report

  1. Dead-letter: apps/site/src/instrumentation.ts sends via API; fetch failure is swallowed.
  2. Documented pickup GET /v1/paperclip/recent-errors?project_slug=photoreport on errors.bitreport.pt currently returns 404 (route missing).

Ask

  1. Restore pr-api / upstream behind api.next.photoreport.pt until /health is 200.
  2. Confirm https://fpa.photoreport.pt/ returns 200.
  3. Add outage detection that does not depend on pr-api (uptime → Gitea/Paperclip), and restore the hub Paperclip recent-errors route.
## Symptom - https://fpa.photoreport.pt/ → HTTP 500 (Next __next_error__, digest 3227098399) - UI: «Não foi possível carregar esta página. Tenta novamente.» - Middleware still rewrites to /arquivo/d26ceb8e-c146-4f68-abaf-c79ce3981b2d (host→archive id known) ## Root cause (observed 2026-11-18) - https://api.next.photoreport.pt/health and /v1/health → HTTP 502 (openresty/nginx Bad Gateway) - Public DNS for api.next / fpa / site.next → 10.10.10.85 - Site SSR fails because the archive page needs the API; site-server error reports also POST to the API (/v1/client-errors), so a dead API means **no event reaches errors.bitreport.pt** and Paperclip never opens a ticket automatically. ## Why no automatic Paperclip report 1. Dead-letter: `apps/site/src/instrumentation.ts` sends via API; fetch failure is swallowed. 2. Documented pickup `GET /v1/paperclip/recent-errors?project_slug=photoreport` on errors.bitreport.pt currently returns **404** (route missing). ## Ask 1. Restore pr-api / upstream behind api.next.photoreport.pt until /health is 200. 2. Confirm https://fpa.photoreport.pt/ returns 200. 3. Add outage detection that does not depend on pr-api (uptime → Gitea/Paperclip), and restore the hub Paperclip recent-errors route.
Author
Owner

Update (agent)

pr-api restored.

  • Cause: CT 264 (pr-api on obelix) rebooted ~19:32; photoreport-boot.service timed out while spawning PM2; process list ended empty (port 3000 down → nginx 502 → FPA archive SSR 500).
  • Also found a stuck pm2 startOrReload from 20:19 and a second PM2 god daemon.
  • Action: ran infra/deploy/boot.sh api inside the CT. Local /health and nginx /health now 200 (0c20b6ba…).
  • Verifying https://fpa.photoreport.pt/ and https://api.next.photoreport.pt/health from outside next.

Still open (why Paperclip did not auto-pick this up)

  1. Site-server error reporting goes through the dead API (/v1/client-errors) — outage is invisible to the hub.
  2. Documented GET errors.bitreport.pt/v1/paperclip/recent-errors returns 404.
  3. No independent uptime check that opens a Gitea/Paperclip issue when api.next is 502.

Boot timeout on reboot should also be investigated (service start limit / hung PM2).

## Update (agent) **pr-api restored.** - Cause: CT 264 (`pr-api` on obelix) rebooted ~19:32; `photoreport-boot.service` **timed out** while spawning PM2; process list ended empty (port 3000 down → nginx 502 → FPA archive SSR 500). - Also found a stuck `pm2 startOrReload` from 20:19 and a second PM2 god daemon. - Action: ran `infra/deploy/boot.sh api` inside the CT. Local `/health` and nginx `/health` now **200** (`0c20b6ba…`). - Verifying `https://fpa.photoreport.pt/` and `https://api.next.photoreport.pt/health` from outside next. ### Still open (why Paperclip did not auto-pick this up) 1. Site-server error reporting goes through the dead API (`/v1/client-errors`) — outage is invisible to the hub. 2. Documented `GET errors.bitreport.pt/v1/paperclip/recent-errors` returns **404**. 3. No independent uptime check that opens a Gitea/Paperclip issue when `api.next` is 502. Boot timeout on reboot should also be investigated (service start limit / hung PM2).
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: BitReport.pt/photoreport#280