deploy-newsletters: the guest OOM-killed idss-control-plane mid-deploy — every "removed" service was still running on the box, and the restarted plane never resumed or failed the lost deploy run #1348

Closed
opened 2026-09-09 05:36:40 +00:00 by matou-build-agent · 1 comment

The failure

Rehearsal drive 20260909T031934Z (private path, brands target) red at deploy-newsletters, the 6th of 7 service cycles. The leg never reached P4-S5 and the drive died on the whole-test ceiling 69 min later. The readout that would have named this has now been repaired in-lane (commit a5ec128a, GOTCHAS #206) — this ticket is the fault that readout was hiding.

Newsletters/Listmonk never deployed at all: grep -i listmonk across every harvested log returns only the control plane's start-up wiring lines, and newsletters appears zero times in logs/guest-caddy.log.

The evidence

1. The control plane was OOM-killed mid-deploy. logs/guest-control-plane.log, ~2.5 min into the newsletters deploy (tick-newsletters green at 04:12 per artifacts/legs.json):

Sep 09 04:15:10 gateway systemd[1]: idss-control-plane.service: The kernel OOM killer killed some processes in this unit.
Sep 09 04:15:10 gateway systemd[1]: idss-control-plane.service: Failed with result 'oom-kill'.
Sep 09 04:15:10 gateway systemd[1]: ... 2.7G memory peak, 50.4G read from disk, 5.6G written to disk
Sep 09 04:15:16 gateway systemd[1]: idss-control-plane.service: Scheduled restart job, restart counter is at 1.

The unit came back 6 s later and re-wired every port cleanly — and then sat there. Nothing resumed the deploy, and nothing failed it: the S4 surface showed neither [data-field="deploy-failure"] nor [data-status="setup-error"] for the next 67 minutes (the poll in app/tests/e2e/fixtures/provision.ts:453-476 checks both every 10 s and would have thrown in seconds). A deploy run lost to a control-plane restart is a black box to the operator — the case ADR 0027 exists to forbid.

2. The box was out of memory because REMOVED services never left it. logs/guest-resources.log, harvested 05:22 on a 2 vCPU / 3.6 GB guest with no swap:

               total        used        free      shared  buff/cache   available
Mem:            3451        2673         282          76         805         778
Swap:              0           0           0

Still resident at 05:22, with their start times: omeka + omeka-db (03:40), paperless granian + celeryd ×2 + redis + postgres (03:50), grampsweb gunicorn ×4 + celery ×3 — ~1.4 GB RSS between them alone (04:04), mariadbd + php-fpm: pool limesurvey ×3 (04:08), grist node ×2 (04:11).

Every one of those is a service whose removal leg had already gone green (artifacts/legs.json): remove-archive 03:41, remove-document-archive 03:52, remove-whakapapa 04:06, remove-surveys 04:09, remove-data-collections 04:12.

3. They were still in the DEPLOYED set, not just lingering processes. The control plane's own deploy-time health gate (attempt=1 attempts=36) kept probing them on every later deploy — logs/guest-control-plane.log:

04:11:44 service=archive           verdict=healthy   (removed 03:41)
04:11:48 service=document-archive  verdict=healthy   (removed 03:52)
04:11:48 service=surveys           verdict=healthy   (removed 04:09 — the NEXT leg)
04:11:49 service=whakapapa         verdict=healthy   (removed 04:06)
04:12:25 service=archive           verdict=healthy
04:12:29 service=surveys / whakapapa / document-archive  verdict=healthy

Omeka was still serving those probes at 04:25:52 (logs/guest-system-journal.log), 44 minutes after remove-archive went green. The one removal that did stick within its own leg is data-collections: it is absent from the 04:12:25-29 probe set. So the removal reaches the config transiently and the service is back in the deployed set by the next cycle.

Why this matters beyond one red

The brand-reach drive is designed around removal freeing the box — "REMOVE it before the next (the guest never has to fit them all)" (app/tests/e2e/fixtures/brandreach.ts:49-51). That design is silently defeated, so the guest accumulates all seven services and dies of memory on the 6th. The drive's remove-<slug> legs are green on a claim that is not true of the box: expectServiceGone (brandreach.ts:306-313) proves only that the S5 card vanished, and confirmRemoveDeploy (brandreach.ts:277-299) proves only that the review diff carried a REMOVES row. Neither reaches the guest. So the removal path — the #1114 class — is being reported green by a check that cannot see the failure.

Suspected layer

Two distinct defects, and which to fix first needs a ruling:

  1. Removal does not take the service off the box (product, internal/clan render + the deploy/removal path, or the co-host selection the next tick re-submits). The decisive question the evidence does not settle: does the removal's generated config actually drop the service and the switch fail to stop the units, or does the next cycle's tick re-add every previously-removed service from a picker/config state that never lost them? Note unselectServiceOnGateway (brandreach.ts:251-254) asserts the target service reads data-status="selected" on re-entry and that passes — worth checking what ELSE the picker still has ticked at that moment.
  2. A control-plane restart silently loses an in-flight deploy run (control-plane / DeployScreen). The run neither resumes nor lands as a fault frame; the operator's S4 hangs forever. Independent of (1) — it is what turned a survivable OOM into a 69-minute black box, and it is a real community-facing behaviour (a gateway that OOMs during any deploy leaves the operator staring at a progress bar).

A third question for the ruling: whether the 2 vCPU / 3.6 GB private-path guest is the right box for a seven-service walk at all, or whether (1) fixed makes it comfortable again. Sizing is a harness decision; (1) and (2) are not.

Filed confident:false: fixing (1) means deciding what "remove" is contracted to do to a running service, and fixing (2) means deciding what the operator is shown when a deploy run dies with its runner — both are product-behaviour rulings, not mechanical repairs. The drive re-fires straight into this red until it is settled.

drive 20260909T031934Z red at deploy-newsletters: page.waitForTimeout: Target page, context or browser has been closed
evidence: /home/swarm/swarm/Matou/idss/test-results/private-path/20260909T031934Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure Rehearsal drive `20260909T031934Z` (private path, brands target) red at `deploy-newsletters`, the 6th of 7 service cycles. The leg never reached P4-S5 and the drive died on the whole-test ceiling 69 min later. The readout that would have named this has now been repaired in-lane (commit `a5ec128a`, GOTCHAS #206) — **this ticket is the fault that readout was hiding.** Newsletters/Listmonk never deployed at all: `grep -i listmonk` across every harvested log returns only the control plane's start-up wiring lines, and `newsletters` appears **zero** times in `logs/guest-caddy.log`. ## The evidence **1. The control plane was OOM-killed mid-deploy.** `logs/guest-control-plane.log`, ~2.5 min into the newsletters deploy (`tick-newsletters` green at 04:12 per `artifacts/legs.json`): ``` Sep 09 04:15:10 gateway systemd[1]: idss-control-plane.service: The kernel OOM killer killed some processes in this unit. Sep 09 04:15:10 gateway systemd[1]: idss-control-plane.service: Failed with result 'oom-kill'. Sep 09 04:15:10 gateway systemd[1]: ... 2.7G memory peak, 50.4G read from disk, 5.6G written to disk Sep 09 04:15:16 gateway systemd[1]: idss-control-plane.service: Scheduled restart job, restart counter is at 1. ``` The unit came back 6 s later and re-wired every port cleanly — and then sat there. Nothing resumed the deploy, and nothing **failed** it: the S4 surface showed neither `[data-field="deploy-failure"]` nor `[data-status="setup-error"]` for the next 67 minutes (the poll in `app/tests/e2e/fixtures/provision.ts:453-476` checks both every 10 s and would have thrown in seconds). A deploy run lost to a control-plane restart is a black box to the operator — the case ADR 0027 exists to forbid. **2. The box was out of memory because REMOVED services never left it.** `logs/guest-resources.log`, harvested 05:22 on a 2 vCPU / 3.6 GB guest with no swap: ``` total used free shared buff/cache available Mem: 3451 2673 282 76 805 778 Swap: 0 0 0 ``` Still resident at 05:22, with their start times: `omeka` + `omeka-db` (03:40), paperless `granian` + `celeryd` ×2 + `redis` + `postgres` (03:50), grampsweb `gunicorn` ×4 + `celery` ×3 — ~1.4 GB RSS between them alone (04:04), `mariadbd` + `php-fpm: pool limesurvey` ×3 (04:08), grist `node` ×2 (04:11). Every one of those is a service whose removal leg had **already gone green** (`artifacts/legs.json`): `remove-archive` 03:41, `remove-document-archive` 03:52, `remove-whakapapa` 04:06, `remove-surveys` 04:09, `remove-data-collections` 04:12. **3. They were still in the DEPLOYED set, not just lingering processes.** The control plane's own deploy-time health gate (`attempt=1 attempts=36`) kept probing them on every later deploy — `logs/guest-control-plane.log`: ``` 04:11:44 service=archive verdict=healthy (removed 03:41) 04:11:48 service=document-archive verdict=healthy (removed 03:52) 04:11:48 service=surveys verdict=healthy (removed 04:09 — the NEXT leg) 04:11:49 service=whakapapa verdict=healthy (removed 04:06) 04:12:25 service=archive verdict=healthy 04:12:29 service=surveys / whakapapa / document-archive verdict=healthy ``` Omeka was still serving those probes at 04:25:52 (`logs/guest-system-journal.log`), 44 minutes after `remove-archive` went green. The one removal that *did* stick within its own leg is `data-collections`: it is absent from the 04:12:25-29 probe set. So the removal reaches the config **transiently** and the service is back in the deployed set by the next cycle. ## Why this matters beyond one red The brand-reach drive is *designed* around removal freeing the box — "REMOVE it before the next (the guest never has to fit them all)" (`app/tests/e2e/fixtures/brandreach.ts:49-51`). That design is silently defeated, so the guest accumulates all seven services and dies of memory on the 6th. The drive's `remove-<slug>` legs are green on a claim that is not true of the box: `expectServiceGone` (`brandreach.ts:306-313`) proves only that the S5 card vanished, and `confirmRemoveDeploy` (`brandreach.ts:277-299`) proves only that the review diff carried a REMOVES row. Neither reaches the guest. So the removal path — the #1114 class — is being reported green by a check that cannot see the failure. ## Suspected layer Two distinct defects, and which to fix first needs a ruling: 1. **Removal does not take the service off the box** (product, `internal/clan` render + the deploy/removal path, or the co-host selection the next tick re-submits). The decisive question the evidence does not settle: does the removal's generated config actually drop the service and the switch fail to stop the units, or does the *next* cycle's tick re-add every previously-removed service from a picker/config state that never lost them? Note `unselectServiceOnGateway` (`brandreach.ts:251-254`) asserts the target service reads `data-status="selected"` on re-entry and that passes — worth checking what ELSE the picker still has ticked at that moment. 2. **A control-plane restart silently loses an in-flight deploy run** (control-plane / DeployScreen). The run neither resumes nor lands as a fault frame; the operator's S4 hangs forever. Independent of (1) — it is what turned a survivable OOM into a 69-minute black box, and it is a real community-facing behaviour (a gateway that OOMs during any deploy leaves the operator staring at a progress bar). A third question for the ruling: whether the 2 vCPU / 3.6 GB private-path guest is the right box for a seven-service walk at all, or whether (1) fixed makes it comfortable again. Sizing is a harness decision; (1) and (2) are not. Filed `confident:false`: fixing (1) means deciding what "remove" is contracted to do to a running service, and fixing (2) means deciding what the operator is shown when a deploy run dies with its runner — both are product-behaviour rulings, not mechanical repairs. The drive re-fires straight into this red until it is settled. drive `20260909T031934Z` red at `deploy-newsletters`: `page.waitForTimeout: Target page, context or browser has been closed` evidence: `/home/swarm/swarm/Matou/idss/test-results/private-path/20260909T031934Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: c0e72bdf0dd5 -->
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

Filed confident:false asking which of two defects to fix first and whether the guest sizing is wrong. Ruling: both defects are two-way doors — revertible commits, provable by tests, and neither on the one-way-door list — and both are bugs against already-stated contracts, not new product rulings, so a session may rule and act (ADR 0174 rule 1). Defect 1's contract is ADR 0210 ruling 5 (a removal mirrors an admission) + the #1134 gone-service class + the brand-reach design's own premise ("REMOVE it before the next"); defect 2's is ADR 0027 (no operation is a black box). I fixed both, and ruled the guest sizing is a harness question that defect 1 resolves (no resize) — exactly as the ticket framed it.

What landed — commit 29b418832c385e426b5d5be4e475f0072e826991 (advances #1348)

Defect 1 — the root cause (accretion + the false-green removal path). A gateway co-host removal in deployServicesOnly's removed loop (internal/provision/deploy.go) called only Config().DetachService, which edits the clan inventory JSON — but the deployed-set truth is the presence of <slug>.nix in a machine dir (machineServices/ReadDeployedServices), and a routable port's render lands a module file, not an inventory instance. So the module stayed on disk, ComposeGatewayCohost (additive) kept importing it, the front-door route stood, the nix switch never stopped its units, machineServices kept reporting it deployed, and d.Services re-ticked it into the next cycle's diffSelection — permanently. The guest accreted all seven and OOM-killed the plane on the 6th.

  • New clan.DetachPort (internal/clan/portroute.go), the removal mirror of AttachPort: deletes machines/<node>/<slug>.nix (idempotent) + drops any inventory instance in one commit.
  • detachCohostPort (internal/provision/deploy.go) drives it for a gateway co-host routable port (cohostRoutablePort), then rewrites the front door without the route from the reduced fleet-wide union (#1172) and recomposes — so the one gateway switch drops the route, stops importing the module, and stops the service's units.

Defect 2 — the 69-minute black box. The provisioning deploy run lives only in an in-memory deployRunStore (internal/controlapi/provision.go) with a detached context.Background() worker and no persistence / startup-reconcile / timeout, so an OOM-kill wipes the run and the poll endpoint returns 404 no_deploy — indistinguishable from never-deployed. The client pollToCompletion (dashboard/src/lib/api/provisionClient.ts) read that 404 as return last and settled S4 on the last running frame forever (neither deploy-failure nor setup-error).

  • pollToCompletion now distinguishes a never-seen run (last===null, unchanged) from a run watched running that the plane then 404s (a lost run) and fails loud with the cause — surfacing the S4 error frame instead of a silent hang. The #835 restart tolerance still rides out the connection-refused window (a definitive 404 is not a blip). This is the ADR 0027 black-box closer; persist-and-resume is a separate enhancement (filed #1350).

Proof

  • Red-before-green proven (then fix restored) for each defect.
  • Go: TestDetachPort_RemovesModuleFromDeployedSet / _Idempotent / _RefusesSlugWithNoModule; TestDeploy_GatewayCohostPortRemovalDropsTheModule (per routable port: DetachPort + routeless front-door rewrite + recompose). Full ./internal/clan/... ./internal/provision/... suites green.
  • TS: provisionDeployRestartTolerance.test.ts gains [RUNNING,404]→interrupted and [RUNNING,SETTLED,404]→settled; the #835 cases still green.
  • go build ./... + go vet + gofmt clean; dashboard vue-tsc clean; the pre-push eslint . gate passed in nix develop.
  • GOTCHAS #207 (⭐⭐⭐) + #208 (⭐⭐); STATUS.md lead updated.

Honest residue / follow-ups filed

  • #1349 — sibling removal gaps: a member-device routable-PORT removal and a gateway-co-host FILES removal still fall to bare DetachService (same class; out of the demonstrated scope, each needs its own mirror/design).
  • #1350 — persist + resume an interrupted provisioning deploy (beyond the fail-loud fix).
  • #1351 — the drive's remove-<slug> legs prove only the S5 card + review diff, never the guest; strengthen them to reach the box (the check that would have caught this directly).
  • #1352 — the pre-push eslint gate lints app/dist-keriweb/ build output (blocked the push; worked around by removing the untracked artifact from this checkout).

Live-drive confirmation (#1277 re-fire) runs on matou-workstation; this session ran on matou-dev-server-01 with no door to the drive host, so the proof here is the red→green unit/integration coverage, not a re-drive. If the next fire still reds at deploy-newsletters, the runner re-opens.

**Ruled by agent under ADR 0174 — veto anytime.** Filed `confident:false` asking which of two defects to fix first and whether the guest sizing is wrong. **Ruling:** both defects are **two-way doors** — revertible commits, provable by tests, and neither on the one-way-door list — and both are **bugs against already-stated contracts, not new product rulings**, so a session may rule and act (ADR 0174 rule 1). Defect 1's contract is ADR 0210 ruling 5 (a removal mirrors an admission) + the #1134 gone-service class + the brand-reach design's own premise ("REMOVE it before the next"); defect 2's is ADR 0027 (no operation is a black box). I fixed **both**, and ruled the guest sizing is a **harness** question that defect 1 resolves (no resize) — exactly as the ticket framed it. ## What landed — commit `29b418832c385e426b5d5be4e475f0072e826991` (advances #1348) **Defect 1 — the root cause (accretion + the false-green removal path).** A gateway co-host removal in `deployServicesOnly`'s removed loop (`internal/provision/deploy.go`) called only `Config().DetachService`, which edits the clan **inventory JSON** — but the deployed-set truth is the **presence of `<slug>.nix`** in a machine dir (`machineServices`/`ReadDeployedServices`), and a routable port's render lands a module **file**, not an inventory instance. So the module stayed on disk, `ComposeGatewayCohost` (additive) kept importing it, the front-door route stood, the nix switch never stopped its units, `machineServices` kept reporting it deployed, and `d.Services` re-ticked it into the next cycle's `diffSelection` — permanently. The guest accreted all seven and OOM-killed the plane on the 6th. - New **`clan.DetachPort`** (`internal/clan/portroute.go`), the removal mirror of `AttachPort`: deletes `machines/<node>/<slug>.nix` (idempotent) + drops any inventory instance in one commit. - **`detachCohostPort`** (`internal/provision/deploy.go`) drives it for a gateway co-host routable port (`cohostRoutablePort`), then rewrites the front door **without** the route from the reduced fleet-wide union (#1172) and recomposes — so the one gateway switch drops the route, stops importing the module, and **stops the service's units**. **Defect 2 — the 69-minute black box.** The provisioning deploy run lives only in an in-memory `deployRunStore` (`internal/controlapi/provision.go`) with a detached `context.Background()` worker and no persistence / startup-reconcile / timeout, so an OOM-kill wipes the run and the poll endpoint returns **404 `no_deploy`** — indistinguishable from never-deployed. The client `pollToCompletion` (`dashboard/src/lib/api/provisionClient.ts`) read that 404 as `return last` and settled S4 on the last **running** frame forever (neither `deploy-failure` nor `setup-error`). - `pollToCompletion` now distinguishes a never-seen run (`last===null`, unchanged) from a run watched **running** that the plane then 404s (a **lost** run) and **fails loud** with the cause — surfacing the S4 error frame instead of a silent hang. The #835 restart tolerance still rides out the connection-refused window (a definitive 404 is not a blip). This is the ADR 0027 black-box closer; persist-and-resume is a separate enhancement (filed #1350). ## Proof - **Red-before-green proven** (then fix restored) for each defect. - Go: `TestDetachPort_RemovesModuleFromDeployedSet` / `_Idempotent` / `_RefusesSlugWithNoModule`; `TestDeploy_GatewayCohostPortRemovalDropsTheModule` (per routable port: DetachPort + routeless front-door rewrite + recompose). Full `./internal/clan/... ./internal/provision/...` suites green. - TS: `provisionDeployRestartTolerance.test.ts` gains `[RUNNING,404]`→interrupted and `[RUNNING,SETTLED,404]`→settled; the #835 cases still green. - `go build ./...` + `go vet` + `gofmt` clean; dashboard `vue-tsc` clean; the pre-push `eslint .` gate passed in `nix develop`. - **GOTCHAS #207 (⭐⭐⭐)** + **#208 (⭐⭐)**; STATUS.md lead updated. ## Honest residue / follow-ups filed - **#1349** — sibling removal gaps: a member-device routable-PORT removal and a gateway-co-host FILES removal still fall to bare DetachService (same class; out of the demonstrated scope, each needs its own mirror/design). - **#1350** — persist + resume an interrupted provisioning deploy (beyond the fail-loud fix). - **#1351** — the drive's `remove-<slug>` legs prove only the S5 card + review diff, never the guest; strengthen them to reach the box (the check that would have caught this directly). - **#1352** — the pre-push eslint gate lints `app/dist-keriweb/` build output (blocked the push; worked around by removing the untracked artifact from this checkout). **Live-drive confirmation** (`#1277` re-fire) runs on **matou-workstation**; this session ran on matou-dev-server-01 with no door to the drive host, so the proof here is the red→green unit/integration coverage, not a re-drive. If the next fire still reds at `deploy-newsletters`, the runner re-opens.
matou-build-agent 2026-09-09 06:16:03 +00:00
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#1348
No description provided.