Fix #20: Caddyfile parse-fout (frontend crash-loop) + frontend-gate en smoke-report in deploys #21

Closed
rve wants to merge 0 commits from fix/issue-20-caddyfile-crash into main
Owner

Closes #20

Incident

App volledig offline voor gebruikers sinds ±08:25Z vandaag, terwijl alle CI-runs groen waren. Root cause (bewezen met caddy validate, zie #20): commit 89d3395 zette Content-Type application/json als subdirective ín respond — een Caddyfile-parse-fout → Caddy start niet → frontend-container crash-loopt. De PocketBase-health-gate uit #18 bleef groen (die checkt de frontend niet) en test.yml test met Caddyfile.test, niet met het echte bestand.

Fix

  1. Caddyfileheader @api Content-Type application/json vóór de respond; zelfde JSON-foutgedrag, nu valide (caddy validate v2.10.0: Valid configuration; Caddyfile.test ook gecheckt). ⚠️ PROTECTED.md-bestand; wijziging is de kern van dit incident.
  2. Beide deploy-playbooks — frontend-health-gate (abort + log-dump als de Caddy-container niet serveert) én een post-deploy smoke-report in de CI-log: docker compose ps, interne proxy-health, team_members auth-methods (OIDC-provider zichtbaar), PocketBase-logtail. Dit geeft de zichtbaarheid achter de auth-perimeter die vandaag ontbrak.

Verificatie

  • caddy validate op oud bestand reproduceert de fout exact (unrecognized subdirective 'Content-Type', at Caddyfile:53)
  • caddy validate op gefixt bestand: Valid configuration
  • Deze PR-pipeline: publish herbouwt het image mét de fix, deploy-dev past beide gates toe — de run zelf is het live-bewijs
  • Smoke-report in de deploy-log: beide containers Up, proxy-health OK, OIDC-provider aanwezig
  • Menselijke check: app laden + Microsoft-login (E2E-checkbox uit #18)

Follow-up (bewust buiten scope, zie #20)

  • caddy validate van het échte Caddyfile in test.yml (frozen workflow)
  • Beleid voor directe pushes naar main

🤖 Generated with Claude Code

Closes #20 ## Incident App volledig offline voor gebruikers sinds ±08:25Z vandaag, terwijl alle CI-runs groen waren. Root cause (bewezen met `caddy validate`, zie #20): commit 89d3395 zette `Content-Type application/json` als subdirective ín `respond` — een Caddyfile-parse-fout → Caddy start niet → frontend-container crash-loopt. De PocketBase-health-gate uit #18 bleef groen (die checkt de frontend niet) en `test.yml` test met `Caddyfile.test`, niet met het echte bestand. ## Fix 1. **Caddyfile** — `header @api Content-Type application/json` vóór de `respond`; zelfde JSON-foutgedrag, nu valide (`caddy validate` v2.10.0: *Valid configuration*; `Caddyfile.test` ook gecheckt). ⚠️ PROTECTED.md-bestand; wijziging is de kern van dit incident. 2. **Beide deploy-playbooks** — frontend-health-gate (abort + log-dump als de Caddy-container niet serveert) én een post-deploy smoke-report in de CI-log: `docker compose ps`, interne proxy-health, `team_members` auth-methods (OIDC-provider zichtbaar), PocketBase-logtail. Dit geeft de zichtbaarheid achter de auth-perimeter die vandaag ontbrak. ## Verificatie - [x] `caddy validate` op oud bestand reproduceert de fout exact (`unrecognized subdirective 'Content-Type', at Caddyfile:53`) - [x] `caddy validate` op gefixt bestand: **Valid configuration** - [ ] Deze PR-pipeline: publish herbouwt het image mét de fix, deploy-dev past beide gates toe — de run zelf is het live-bewijs - [ ] Smoke-report in de deploy-log: beide containers Up, proxy-health OK, OIDC-provider aanwezig - [ ] Menselijke check: app laden + Microsoft-login (E2E-checkbox uit #18) ## Follow-up (bewust buiten scope, zie #20) - `caddy validate` van het échte Caddyfile in `test.yml` (frozen workflow) - Beleid voor directe pushes naar main 🤖 Generated with [Claude Code](https://claude.com/claude-code)
rve added 1 commit 2026-07-11 12:21:32 +00:00
fix: valid Caddyfile handle_errors + frontend health-gate in deploys (#20)
All checks were successful
On Pull Request to Main / test (pull_request) Successful in 39s
On Pull Request to Main / publish (pull_request) Successful in 1m7s
On Pull Request to Main / deploy-dev (pull_request) Successful in 3m6s
80f738ddcb
The learning-platform (Caddy) container crash-looped since this morning's
89d3395: `Content-Type application/json` is not a valid subdirective of
`respond` — a Caddyfile parse error aborts Caddy at startup, taking the
whole app offline for authenticated users while every CI run stayed green.
Verified with caddy v2.10.0: "unrecognized subdirective 'Content-Type',
at Caddyfile:53"; the fixed file validates clean.

CI was blind to this twice over: test.yml swaps the real Caddyfile for
Caddyfile.test in the test image, and the deploy health-gate from #18
only covers PocketBase.

- Caddyfile: set Content-Type via a `header @api` directive before the
  `respond`; behaviour of the JSON error response is unchanged
- infra/*/site/deploy-playbook.yml: frontend health-gate (docker exec
  wget --spider on the container) with log dump + abort on failure, and
  an always-on post-deploy smoke report (compose ps, proxy health,
  team_members auth-methods, PocketBase log tail) for visibility behind
  the auth perimeter

Closes #20

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
Owner

Live-verificatie geslaagd (run #92, deploy-log met smoke-report):

  • learning-platform (Caddy) container: Up — crash-loop opgelost, frontend-gate
  • Interne proxy-keten: {"message":"API is healthy.","code":200}
  • team_members auth-methods: OIDC-provider "Microsoft" enabled (SSO-doel van #18 nu live bevestigd)
  • PocketBase: entra_oidc reconcile (bootstrap): in-sync; PLAY RECAP failed=0

⚠️ Merge-urgentie: main heeft nog het ongeldige Caddyfile. Elke push naar main vóór deze merge herbouwt het kapotte image en haalt de app opnieuw offline. Labs draait nu op het gefixte image uit deze PR-run.

Resterende menselijke check: app laden + inloggen met Microsoft (E2E uit #18).

**Live-verificatie geslaagd (run #92, deploy-log met smoke-report):** - `learning-platform` (Caddy) container: **Up** — crash-loop opgelost, frontend-gate ✅ - Interne proxy-keten: `{"message":"API is healthy.","code":200}` ✅ - `team_members` auth-methods: **OIDC-provider "Microsoft" enabled** ✅ (SSO-doel van #18 nu live bevestigd) - PocketBase: `entra_oidc reconcile (bootstrap): in-sync`; PLAY RECAP `failed=0` ⚠️ **Merge-urgentie:** main heeft nog het ongeldige Caddyfile. Elke push naar main vóór deze merge herbouwt het kapotte image en haalt de app opnieuw offline. Labs draait nu op het gefixte image uit deze PR-run. Resterende menselijke check: app laden + inloggen met Microsoft (E2E uit #18).
rve closed this pull request 2026-07-12 15:12:14 +00:00
All checks were successful
On Pull Request to Main / test (pull_request) Successful in 39s
On Pull Request to Main / publish (pull_request) Successful in 1m7s
On Pull Request to Main / deploy-dev (pull_request) Successful in 3m6s

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rve/learning-platform#21