swarm pool: a fresh host's empty pnpm store kills every worker at install — warm it at host provisioning (GOTCHAS 19's missing half) #489

Closed
opened 2026-08-12 18:53:59 +00:00 by ben · 1 comment
Owner

Found live 2026-08-12 while diagnosing why elitebook-03 failed every run in ~29s (sandcastle-run-failed, dozens of red cycles from ~18:00Z) while matou-workstation ran the same commits green.

Evidence

/tmp/matou-swarm-verdict.txt on elitebook-03:

stage=sandcastle run (workers)
exit=1
ExecError: Command failed (exit 243): CI=true pnpm install --frozen-lockfile --store-dir /home/agent/.pnpm-store
  • The mount exists (GOTCHAS 19 / #466 fixed that with mkdir -p, 56b92b6) — but it is empty: workstation .sandcastle/pnpm-store = 543M warm residue of past runs; elitebook = 4.0K.
  • With an empty store every worker must fetch the whole dependency tree from the registry inside the sandbox at spawn — and that fails (exit 243), so zero workers are born, zero claims post, and the host burns cron cycles silently (only the runlog shows it).
  • Same shape as GOTCHAS 19: an established host's residue masking a fresh-host assumption; single-host operation can never expose it.

Live mitigation applied (2026-08-12, this session)

The workstation's warm store was tar-copied to elitebook (plus the missing ~/.claude/.credentials.json OAuth file — the other empty-on-fresh-host credential, which is #449 Q5's residual-exposure question made concrete).

Durable fix wanted

  1. Host provisioning warms the store — a documented/scripted step for standing up a pool host (seed .sandcastle/pnpm-store from an established host, or pnpm fetch on the host before first run), OR the sandbox permits the registry fetch on first run if that is the intended posture.
  2. Fail loud, not silent: a preflight guard that names the condition ("pnpm store empty and install cannot fetch — seed the store, see GOTCHAS 20") instead of dozens of anonymous 29s reds that only a manual verdict-file read explains.
  3. The multihost plan's host-provisioning section gains the full fresh-host checklist: pnpm store, Claude credentials file, anything else only residue provides today.

GOTCHAS 20 appended in the same commit as this filing (ADR 0160 discipline).

Found live 2026-08-12 while diagnosing why elitebook-03 failed every run in ~29s (`sandcastle-run-failed`, dozens of red cycles from ~18:00Z) while matou-workstation ran the same commits green. ## Evidence `/tmp/matou-swarm-verdict.txt` on elitebook-03: ``` stage=sandcastle run (workers) exit=1 ExecError: Command failed (exit 243): CI=true pnpm install --frozen-lockfile --store-dir /home/agent/.pnpm-store ``` - The mount exists (GOTCHAS 19 / #466 fixed that with `mkdir -p`, 56b92b6) — but it is **empty**: workstation `.sandcastle/pnpm-store` = 543M warm residue of past runs; elitebook = 4.0K. - With an empty store every worker must fetch the whole dependency tree from the registry inside the sandbox at spawn — and that fails (exit 243), so zero workers are born, zero claims post, and the host burns cron cycles silently (only the runlog shows it). - Same shape as GOTCHAS 19: an established host's residue masking a fresh-host assumption; single-host operation can never expose it. ## Live mitigation applied (2026-08-12, this session) The workstation's warm store was tar-copied to elitebook (plus the missing `~/.claude/.credentials.json` OAuth file — the other empty-on-fresh-host credential, which is #449 Q5's residual-exposure question made concrete). ## Durable fix wanted 1. **Host provisioning warms the store** — a documented/scripted step for standing up a pool host (seed `.sandcastle/pnpm-store` from an established host, or `pnpm fetch` on the host before first run), OR the sandbox permits the registry fetch on first run if that is the intended posture. 2. **Fail loud, not silent**: a preflight guard that names the condition ("pnpm store empty and install cannot fetch — seed the store, see GOTCHAS 20") instead of dozens of anonymous 29s reds that only a manual verdict-file read explains. 3. The multihost plan's host-provisioning section gains the full fresh-host checklist: pnpm store, Claude credentials file, anything else only residue provides today. GOTCHAS 20 appended in the same commit as this filing (ADR 0160 discipline).
Author
Owner

Full root cause (2026-08-12 evening debugging, live on elitebook-03): three nested fresh-host defects, each masking the next —

  1. ~/.claude/.credentials.json absent (copied over live; workers could never have authed).
  2. .sandcastle/pnpm-store empty (543M warm store tar-copied from the workstation live).
  3. The structural one: elitebook's docker is ROOTLESS; the workstation's is ROOTFUL. Sandcastle builds its per-host image with agent matching the invoking host uid (workstation: dev=1000; elitebook: swarm=1500), and with rootful docker host-uid files appear in-container as the same uid → repo/worktree mounts writable by agent. Rootless docker shifts the map — host 1500 becomes container root(0), so every repo mount is root-owned in-sandbox, agent cannot create node_modules, and pnpm install dies exit 243 before any worker reads its ticket. Verified in-container: repo-READONLY, id mismatch, ls -ln showing 0 0 ownership.

The Phase-2 soak could not catch this: claim mechanics never spawn a worker; the first REAL ticket is the first write.

Decision needed (root on elitebook required; swarm has no sudo): flip elitebook to rootful docker to match the workstation posture (then chown -R 1500:1500 .sandcastle/pnpm-store host-side — the live-copied store currently carries rootless-subuid ownership that becomes wrong on the flip), OR keep rootless as the deliberate isolation posture and give sandcastle a rootless mode (worktree/store ownership prepared via an in-container chown step before worker spawn). The multihost plan's host-provisioning checklist must record whichever posture is ruled, alongside items 1–2.

Until ruled, elitebook reds every ~1min (throughput hole only — claims are safe, fail-closed); the workstation is draining the queue alone.

**Full root cause (2026-08-12 evening debugging, live on elitebook-03):** three nested fresh-host defects, each masking the next — 1. `~/.claude/.credentials.json` absent (copied over live; workers could never have authed). 2. `.sandcastle/pnpm-store` empty (543M warm store tar-copied from the workstation live). 3. **The structural one: elitebook's docker is ROOTLESS; the workstation's is ROOTFUL.** Sandcastle builds its per-host image with `agent` matching the invoking host uid (workstation: dev=1000; elitebook: swarm=1500), and with rootful docker host-uid files appear in-container as the same uid → repo/worktree mounts writable by `agent`. Rootless docker shifts the map — host 1500 becomes container **root(0)**, so every repo mount is root-owned in-sandbox, `agent` cannot create `node_modules`, and `pnpm install` dies exit 243 before any worker reads its ticket. Verified in-container: `repo-READONLY`, `id` mismatch, `ls -ln` showing `0 0` ownership. The Phase-2 soak could not catch this: claim mechanics never spawn a worker; the first REAL ticket is the first write. **Decision needed (root on elitebook required; `swarm` has no sudo):** flip elitebook to rootful docker to match the workstation posture (then `chown -R 1500:1500 .sandcastle/pnpm-store` host-side — the live-copied store currently carries rootless-subuid ownership that becomes wrong on the flip), OR keep rootless as the deliberate isolation posture and give sandcastle a rootless mode (worktree/store ownership prepared via an in-container chown step before worker spawn). The multihost plan's host-provisioning checklist must record whichever posture is ruled, alongside items 1–2. Until ruled, elitebook reds every ~1min (throughput hole only — claims are safe, fail-closed); the workstation is draining the queue alone.
ben closed this issue 2026-08-13 03:41:26 +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.

Dependencies

No dependencies set.

Reference
Matou/idss#489
No description provided.