deploy-whakapapa: the owner-bootstrap gate never gated and two migrators raced the Gramps Web users DB — already fixed at HEAD by 729d81be (duplicate of #1313) #1315

Closed
opened 2026-09-08 05:32:31 +00:00 by matou-build-agent · 2 comments

Drive 20260908T035208Z (private-path, target brands) red at deploy-whakapapa after the full 4500 s ceiling. This red is already diagnosed and fixed on main — HEAD 729d81be names this drive verbatim in its commit body. Filing only as the loop's record; the action is verify-and-close against #1313, not new work.

The failure

  • artifacts/legs.json (leg 16): deploy-whakapapa, ms: 4503815 — deploy did not reach active within 4500s — deploy bar: state=running current=deploy-services percent=download:0 install:0; wire /api/v1/fleet: probe failed: Failed to fetch.
  • artifacts/verdict.json: 15 green / 1 red, firstRedLeg: deploy-whakapapa, commit: 3a2645a2798560166d28bdaa8b9f04c63c0a4f49 — two commits behind current main.

Evidence

The NixOS switch was not slow; activation blocked on the whakapapa containers.

  • logs/guest-caddy.log:18-21 — Reloading Caddy... / Reloaded Caddy at 04:09:03–04:09:04, ~35 s after the deploy began. The switch reached activation almost immediately.
  • logs/guest-resources.log — clan machines update gateway --flake git+file:///srv/idss/config?rev=67344b6b… --build-host localhost (PID 11900) started 04:08, still running at harvest 05:25 with only 0:06 CPU time. Blocked, not building.
  • logs/guest-caddy.log:22-35 — every ~5 min from 04:13:36 to 05:21:36, the control-plane whakapapa health probe (POST /api/token/, Go-http-client/2.0) got 502 / dial tcp 127.0.0.1:8085: connect: connection refused. Gramps Web never served for 68 consecutive minutes.
  • logs/guest-failed-units.log — grampsweb-admin.service loaded failed failed ("Bootstrap the Gramps Web owner service identity from a clan var (whakapapa port, ADR 0062)").
  • logs/guest-grampsweb.log — the crash loop, both containers, one cycle apart on the shared users.sqlite:
    • 05:25:40 grampsweb[93969] — Running upgrade a8e57fe0d82e -> 2082445b0769, add oidc_accounts table… → sqlite3.OperationalError: table oidc_accounts already exists → alembic upgrade head returned exit status 1.
    • 05:25:43 grampsweb-celery[94080] — the identical traceback; podman-grampsweb-celery.service: Failed with result 'exit-code'.
    • 05:25:39 / 05:25:43 whakapapa-brand-start — curl: (7) Failed to connect to 127.0.0.1 port 8085, a retry loop against a port that never opened.

Suspected layer — confirmed

internal/clan/whakapapa.go (the whakapapa port renderer), two defects:

  1. renderGrampsWebAdmin's readiness gate rendered curl -s -o /dev/null -w '%{http_code}' … || echo 000. On a refused connection curl prints 000 and exits non-zero, so both halves ran and the gate read "000000", which != 000 — the gate passed on the first tick and the owner user add raced the image entrypoint's alembic upgrade head.
  2. renderGrampsWebContainers gave grampsweb-celery only dependsOn = [ "grampsweb-redis" ]. The worker runs the image's same entrypoint, i.e. the same migration chain, against the same SQLite. Two migrators, non-transactional DDL → oidc_accounts created by one with the other's alembic_version behind it, poisoning the DB for every subsequent restart. switch-to-configuration then waited on a unit that could never reach active, which is the 75-minute hang.

Why no heal was landed here

HEAD 729d81be (internal/clan/whakapapa.go:340-373, :472-486) is exactly this fix: probe() captures curl's output and normalises via case … [0-9][0-9][0-9] with no echo-on-failure fallback; grampsweb-celery gains dependsOn = [ "grampsweb-redis" "grampsweb" ] plus a lib.mkAfter ExecStartPre that waits up to 300 s for GET /api/metadata/ to answer before starting a second migrator. GOTCHAS #188. There is nothing left in this red to repair.

The fix will reach the next drive: railKey() (app/tests/e2e/fixtures/snapshotRail.ts:162-171) hashes HEAD:internal, so the internal/clan/ change invalidates snapshot key 32f70af1fdcdaf7f (recorded @ 3a2645a2, artifacts/legs.json leg 1) and the drive re-founds in full, baking the corrected control-plane.

Verified at HEAD: go test ./internal/clan/ → ok (18.5 s). Working tree clean — no edits made.

Noted, not filed (deliberately out of scope)

The same human diagnosis that produced 729d81be had this evidence and chose to fix the root cause only. Recording two observations so they are not lost, neither claimed as a defect to act on:

  • The deploy hangs rather than fails. clan machines update blocked ~75 min on a crash-looping podman unit with no start-limit. Any future crash-loop burns the whole ceiling again instead of failing loudly. Changing that alters what a deploy does on failure — a design call, not a heal.
  • Harvest depth. logs/guest-system-journal.log holds 500 lines, all from 05:25:40–05:25:44; the entire 75-minute window and the first failure are gone. The timeline above had to be reconstructed from guest-caddy.log's sparse 5-minute probe errors. Worth deepening the harvest window for hang-shaped reds.

Evidence absent by construction

This is a VM-mode private-path drive (ADR 0056, qemu guest on the workstation), not a droplet drive: there is no droplet-journal.txt and no error-context.md in the run directory. founding-state.log (15 KB) and state/clan-config (HEAD d6a7e67a) are present; logs/state-logs.log records no state logs directory … ENOENT.

drive 20260908T035208Z red at deploy-whakapapa: deploy did not reach active within 4500s — deploy bar: state=running current=deploy-services percent=download:0 install:0; wire /api/v1/fleet: probe failed: Failed to fetch
evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260908T035208Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

Drive `20260908T035208Z` (private-path, target `brands`) red at `deploy-whakapapa` after the full 4500 s ceiling. **This red is already diagnosed and fixed on `main`** — HEAD `729d81be` names this drive verbatim in its commit body. Filing only as the loop's record; the action is verify-and-close against **#1313**, not new work. ## The failure - `artifacts/legs.json` (leg 16): `deploy-whakapapa`, `ms: 4503815` — `deploy did not reach active within 4500s — deploy bar: state=running current=deploy-services percent=download:0 install:0; wire /api/v1/fleet: probe failed: Failed to fetch`. - `artifacts/verdict.json`: 15 green / 1 red, `firstRedLeg: deploy-whakapapa`, `commit: 3a2645a2798560166d28bdaa8b9f04c63c0a4f49` — **two commits behind current `main`**. ## Evidence The NixOS switch was not slow; activation blocked on the whakapapa containers. - `logs/guest-caddy.log:18-21` — `Reloading Caddy... / Reloaded Caddy` at `04:09:03`–`04:09:04`, ~35 s after the deploy began. The switch reached activation almost immediately. - `logs/guest-resources.log` — `clan machines update gateway --flake git+file:///srv/idss/config?rev=67344b6b… --build-host localhost` (PID 11900) started `04:08`, still running at harvest `05:25` with only **`0:06` CPU time**. Blocked, not building. - `logs/guest-caddy.log:22-35` — every ~5 min from `04:13:36` to `05:21:36`, the control-plane whakapapa health probe (`POST /api/token/`, `Go-http-client/2.0`) got `502` / `dial tcp 127.0.0.1:8085: connect: connection refused`. Gramps Web never served for 68 consecutive minutes. - `logs/guest-failed-units.log` — `grampsweb-admin.service loaded failed failed` ("Bootstrap the Gramps Web owner service identity from a clan var (whakapapa port, ADR 0062)"). - `logs/guest-grampsweb.log` — the crash loop, both containers, one cycle apart on the shared `users.sqlite`: - `05:25:40 grampsweb[93969]` — `Running upgrade a8e57fe0d82e -> 2082445b0769, add oidc_accounts table…` → `sqlite3.OperationalError: table oidc_accounts already exists` → `alembic upgrade head` returned exit status 1. - `05:25:43 grampsweb-celery[94080]` — the identical traceback; `podman-grampsweb-celery.service: Failed with result 'exit-code'`. - `05:25:39` / `05:25:43 whakapapa-brand-start` — `curl: (7) Failed to connect to 127.0.0.1 port 8085`, a retry loop against a port that never opened. ## Suspected layer — confirmed `internal/clan/whakapapa.go` (the whakapapa port renderer), two defects: 1. `renderGrampsWebAdmin`'s readiness gate rendered `curl -s -o /dev/null -w '%{http_code}' … || echo 000`. On a refused connection curl **prints** `000` *and* exits non-zero, so both halves ran and the gate read `"000000"`, which `!= 000` — the gate passed on the first tick and the owner `user add` raced the image entrypoint's `alembic upgrade head`. 2. `renderGrampsWebContainers` gave `grampsweb-celery` only `dependsOn = [ "grampsweb-redis" ]`. The worker runs the image's **same** entrypoint, i.e. the same migration chain, against the same SQLite. Two migrators, non-transactional DDL → `oidc_accounts` created by one with the other's `alembic_version` behind it, poisoning the DB for every subsequent restart. `switch-to-configuration` then waited on a unit that could never reach active, which is the 75-minute hang. ## Why no heal was landed here HEAD `729d81be` (`internal/clan/whakapapa.go:340-373`, `:472-486`) is exactly this fix: `probe()` captures curl's output and normalises via `case … [0-9][0-9][0-9]` with no echo-on-failure fallback; `grampsweb-celery` gains `dependsOn = [ "grampsweb-redis" "grampsweb" ]` plus a `lib.mkAfter` `ExecStartPre` that waits up to 300 s for `GET /api/metadata/` to answer before starting a second migrator. GOTCHAS #188. There is nothing left in this red to repair. The fix will reach the next drive: `railKey()` (`app/tests/e2e/fixtures/snapshotRail.ts:162-171`) hashes `HEAD:internal`, so the `internal/clan/` change invalidates snapshot key `32f70af1fdcdaf7f` (recorded `@ 3a2645a2`, `artifacts/legs.json` leg 1) and the drive re-founds in full, baking the corrected control-plane. Verified at HEAD: `go test ./internal/clan/` → ok (18.5 s). Working tree clean — no edits made. ## Noted, not filed (deliberately out of scope) The same human diagnosis that produced `729d81be` had this evidence and chose to fix the root cause only. Recording two observations so they are not lost, neither claimed as a defect to act on: - **The deploy hangs rather than fails.** `clan machines update` blocked ~75 min on a crash-looping podman unit with no start-limit. Any future crash-loop burns the whole ceiling again instead of failing loudly. Changing that alters what a deploy *does* on failure — a design call, not a heal. - **Harvest depth.** `logs/guest-system-journal.log` holds 500 lines, all from `05:25:40`–`05:25:44`; the entire 75-minute window and the *first* failure are gone. The timeline above had to be reconstructed from `guest-caddy.log`'s sparse 5-minute probe errors. Worth deepening the harvest window for hang-shaped reds. ## Evidence absent by construction This is a VM-mode private-path drive (ADR 0056, qemu guest on the workstation), not a droplet drive: there is no `droplet-journal.txt` and no `error-context.md` in the run directory. `founding-state.log` (15 KB) and `state/clan-config` (HEAD `d6a7e67a`) are present; `logs/state-logs.log` records `no state logs directory … ENOENT`. drive `20260908T035208Z` red at `deploy-whakapapa`: `deploy did not reach active within 4500s — deploy bar: state=running current=deploy-services percent=download:0 install:0; wire /api/v1/fleet: probe failed: Failed to fetch` evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260908T035208Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: fbc98d27174f -->
Author
Member

swarm-claim host=matou-dev-server-01 run=19861
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=19861 (automated multi-host claim — lowest live claim id works this ticket)
matou-build-agent 2026-09-08 05:33:14 +00:00
Author
Member

close-report for #1315 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1315,
  "status": "success",
  "commits": [],
  "changed_files": [],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The whakapapa owner-bootstrap readiness gate must actually gate (curl 000-on-refusal not producing a false-pass '000000')": "Fixed at HEAD by 729d81be — internal/clan/whakapapa.go probe() normalises the code via 'case ... [0-9][0-9][0-9]) echo \"$code\" ;; *) echo 000' with no echo-on-failure fallback (verified by reading internal/clan/whakapapa.go:465-490)",
    "The grampsweb-celery worker must not race the API container as a second migrator on the shared users.sqlite": "Fixed at HEAD by 729d81be — grampsweb-celery gains dependsOn = [ \"grampsweb-redis\" \"grampsweb\" ] plus a lib.mkAfter ExecStartPre that waits up to 300s for GET /api/metadata/ before starting (verified by reading internal/clan/whakapapa.go:343-370)",
    "internal/clan tests pass at HEAD": "nix develop .#go-ci --command go test ./internal/clan/ → ok (exit 0)"
  },
  "summary": "Verify-and-close: the deploy-whakapapa red on drive 20260908T035208Z is a duplicate of #1313, already fixed on main by 729d81be (readiness gate normalisation + celery migrator ordering), and needs no new work.",
  "reason": "The red predates the fix (verdict commit 3a2645a2, two commits behind current main). HEAD 729d81be is exactly this fix and is reachable from origin/main; internal/clan tests are green.",
  "blockers": [],
  "no_code_change": "The failure is already diagnosed and fixed on main by 729d81be (duplicate of #1313); this ticket is the loop's own record, and the action is verify-and-close, not new work. Fix confirmed present in internal/clan/whakapapa.go and on origin/main; go test ./internal/clan/ passes."
}
**close-report** for #1315 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1315, "status": "success", "commits": [], "changed_files": [], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/clan/", "exit_code": 0 } ], "criteria": { "The whakapapa owner-bootstrap readiness gate must actually gate (curl 000-on-refusal not producing a false-pass '000000')": "Fixed at HEAD by 729d81be — internal/clan/whakapapa.go probe() normalises the code via 'case ... [0-9][0-9][0-9]) echo \"$code\" ;; *) echo 000' with no echo-on-failure fallback (verified by reading internal/clan/whakapapa.go:465-490)", "The grampsweb-celery worker must not race the API container as a second migrator on the shared users.sqlite": "Fixed at HEAD by 729d81be — grampsweb-celery gains dependsOn = [ \"grampsweb-redis\" \"grampsweb\" ] plus a lib.mkAfter ExecStartPre that waits up to 300s for GET /api/metadata/ before starting (verified by reading internal/clan/whakapapa.go:343-370)", "internal/clan tests pass at HEAD": "nix develop .#go-ci --command go test ./internal/clan/ → ok (exit 0)" }, "summary": "Verify-and-close: the deploy-whakapapa red on drive 20260908T035208Z is a duplicate of #1313, already fixed on main by 729d81be (readiness gate normalisation + celery migrator ordering), and needs no new work.", "reason": "The red predates the fix (verdict commit 3a2645a2, two commits behind current main). HEAD 729d81be is exactly this fix and is reachable from origin/main; internal/clan tests are green.", "blockers": [], "no_code_change": "The failure is already diagnosed and fixed on main by 729d81be (duplicate of #1313); this ticket is the loop's own record, and the action is verify-and-close, not new work. Fix confirmed present in internal/clan/whakapapa.go and on origin/main; go test ./internal/clan/ passes." } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1315
No description provided.