enroll-configure went red: eval preflight blocked, no vars generated for gateway #398

Closed
opened 2026-08-10 15:22:02 +00:00 by ben · 1 comment
Owner

Failure

The drive got past connect/point/seed on the own-VPS carrier — SSH connected, DNS pointed, the community flake seeded, brand + header landed — then went red on the enroll-configure leg while preparing NixOS takeover (nixos-anywhere). Playwright timed out after the full 360s budget with the standup already in a terminal blocked fault, not still working:

JourneyFailure: journey leg "enroll-configure" went red: budget of 360s elapsed at "absent"

artifacts/journey.droplet-.../error-context.md's page snapshot shows the fault line rendered in the UI:

founding: the server stand-up did not complete (status "blocked"): a required secret has not been generated — run vars generate for the node, then re-drive

logs/founding-state.log gives the full own-vps event trail and pins the cause precisely — the stage's own log line states its intended order, then contradicts it:

{"stage": "enroll-configure", "message": "installing NixOS on the server (nixos-anywhere takeover) — eval preflight, then the machine vars"}
{"stage": "enroll-configure", "message": "takeover-ready node config committed"}
{"stage": "enroll-configure", "message": "eval preflight did not pass — missing_var"}
{"stage": "enroll-configure", "message": "the stand-up hit a problem — founding: ... a required secret has not been generated — run vars generate for the node, then re-drive"}

carrying "fault_resumable": true.

Corroborating evidence

  • state/clan-config/.git/logs/HEAD shows the config-repo commit sequence: flake seed → brand artifacts → community header → logo → secrets: add user operator → ourcloud: bake takeover-ready config for gateway → front-door/acme-dns/gateway-dir commits. No commit generates machine vars/secrets for the gateway node itself — only the operator user key was added (sops/users/operator/key.json).
  • The config repo has no sops/machines/ or vars/ directory at all — confirming no machine-scoped secret was ever generated for gateway.
  • logs/droplet-journal.txt shows the droplet itself is healthy and reachable (cloud-init finished cleanly, SSH accepted at 15:18:55) but never shows nixos-anywhere/kexec/installer activity — takeover itself never started.
  • All logs/guest-*.log files (caddy, control-plane, kanidm, nextcloud, phpfpm, files-oidc, failed-units) are empty, and guest-unit.log/guest-unit-file.log can't find any guest unit — consistent with NixOS never having been installed.
  • artifacts/legs.json is [] and artifacts/journey.json has rows: null, fault: null — no leg-level bookkeeping ever engaged, and there is no skip-reason referencing the known own-VPS pairing frontier.
  • artifacts/host.json shows "qemu": "exit ENOENT ..." and logs/qemu.log finds no qemu process, but this is an own-VPS carrier drive against a real DigitalOcean droplet (170.64.161.79) — the qemu absence is inert here, not the cause.

Is this the known frontier?

No. The known own-VPS frontier is the pairing/connect leg never flipping green. Here connect, point, and seed all completed — the drive got one full leg further, into enroll-configure, and hit a distinct, new blocker.

Suspected layer

Product — the founding/standup orchestrator for the own-vps carrier's enroll-configure stage. Its own log states the intended order ("eval preflight, then the machine vars") but eval preflight itself needs those vars to pass, so run in that order it can never succeed on a fresh node. The fault is correctly classified fault_resumable: true and names its own remedy, but nothing in enroll-configure actually invokes vars generation for the gateway node — it only surfaces the blocked status.

What plugging it needs

Enroll-configure needs to run machine vars generation (clan vars generate or equivalent) for the target node — populating whatever secret(s) the gateway's module set requires — either before eval preflight runs, or as an automatic remedy triggered by a missing_var preflight result. A swarm agent can act directly: find the own-vps enroll-configure stage implementation (the code emitting the eval preflight / takeover-ready node config committed / missing_var messages above) and wire in the vars-generate step so a fresh own-VPS founding no longer blocks here.

drive 20260810T151050Z red at wizard: drive red at wizard — the wizard died before any leg ran
evidence: test-results/…/20260810T151050Z/ on matou-workstation (legs.json, droplet-journal.txt, trace)

## Failure The drive got past connect/point/seed on the own-VPS carrier — SSH connected, DNS pointed, the community flake seeded, brand + header landed — then went red on the **enroll-configure** leg while preparing NixOS takeover (nixos-anywhere). Playwright timed out after the full 360s budget with the standup already in a terminal `blocked` fault, not still working: ``` JourneyFailure: journey leg "enroll-configure" went red: budget of 360s elapsed at "absent" ``` `artifacts/journey.droplet-.../error-context.md`'s page snapshot shows the fault line rendered in the UI: ``` founding: the server stand-up did not complete (status "blocked"): a required secret has not been generated — run vars generate for the node, then re-drive ``` `logs/founding-state.log` gives the full `own-vps` event trail and pins the cause precisely — the stage's own log line states its intended order, then contradicts it: ``` {"stage": "enroll-configure", "message": "installing NixOS on the server (nixos-anywhere takeover) — eval preflight, then the machine vars"} {"stage": "enroll-configure", "message": "takeover-ready node config committed"} {"stage": "enroll-configure", "message": "eval preflight did not pass — missing_var"} {"stage": "enroll-configure", "message": "the stand-up hit a problem — founding: ... a required secret has not been generated — run vars generate for the node, then re-drive"} ``` carrying `"fault_resumable": true`. ## Corroborating evidence - `state/clan-config/.git/logs/HEAD` shows the config-repo commit sequence: flake seed → brand artifacts → community header → logo → **`secrets: add user operator`** → `ourcloud: bake takeover-ready config for gateway` → front-door/acme-dns/gateway-dir commits. No commit generates machine vars/secrets for the `gateway` node itself — only the operator *user* key was added (`sops/users/operator/key.json`). - The config repo has no `sops/machines/` or `vars/` directory at all — confirming no machine-scoped secret was ever generated for gateway. - `logs/droplet-journal.txt` shows the droplet itself is healthy and reachable (cloud-init finished cleanly, SSH accepted at 15:18:55) but never shows nixos-anywhere/kexec/installer activity — takeover itself never started. - All `logs/guest-*.log` files (caddy, control-plane, kanidm, nextcloud, phpfpm, files-oidc, failed-units) are empty, and `guest-unit.log`/`guest-unit-file.log` can't find any guest unit — consistent with NixOS never having been installed. - `artifacts/legs.json` is `[]` and `artifacts/journey.json` has `rows: null, fault: null` — no leg-level bookkeeping ever engaged, and there is no skip-reason referencing the known own-VPS pairing frontier. - `artifacts/host.json` shows `"qemu": "exit ENOENT ..."` and `logs/qemu.log` finds no qemu process, but this is an own-VPS carrier drive against a real DigitalOcean droplet (170.64.161.79) — the qemu absence is inert here, not the cause. ## Is this the known frontier? No. The known own-VPS frontier is the pairing/connect leg never flipping green. Here connect, point, and seed all completed — the drive got one full leg further, into enroll-configure, and hit a distinct, new blocker. ## Suspected layer **Product** — the founding/standup orchestrator for the own-vps carrier's enroll-configure stage. Its own log states the intended order ("eval preflight, then the machine vars") but eval preflight itself needs those vars to pass, so run in that order it can never succeed on a fresh node. The fault is correctly classified `fault_resumable: true` and names its own remedy, but nothing in enroll-configure actually invokes vars generation for the gateway node — it only surfaces the blocked status. ## What plugging it needs Enroll-configure needs to run machine vars generation (`clan vars generate` or equivalent) for the target node — populating whatever secret(s) the gateway's module set requires — either before eval preflight runs, or as an automatic remedy triggered by a `missing_var` preflight result. A swarm agent can act directly: find the own-vps enroll-configure stage implementation (the code emitting the `eval preflight` / `takeover-ready node config committed` / `missing_var` messages above) and wire in the vars-generate step so a fresh own-VPS founding no longer blocks here. drive `20260810T151050Z` red at `wizard`: `drive red at wizard — the wizard died before any leg ran` evidence: `test-results/…/20260810T151050Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) <!-- rehearsal-sig: dcf630511b50 -->
Author
Owner

Fixed in f989696 (on origin/main).

Cause. The clan enrollment workflow ran the eval preflight (a nix eval of the node's full config) AHEAD of vars generate. A fresh gateway node's config references its declared vars, so the eval itself failed missing_var ("a required secret has not been generated") and the stand-up blocked forever — no sops/machines/ was ever written. The stage's own log line ("eval preflight, then the machine vars") stated the wrong order: run that way, a fresh node can never pass.

Fix (internal/clan/enrollment.go). The preflight stage now runs clan vars generate <node> --no-sandbox ahead of the eval gate (and ahead of the install phases / verify's machines update), guarded by the snapshot's VarsGenerated so a resume never re-drives it. The install stage keeps a defensive fallback generate only for a resume that re-enters it directly. This fixes both the own-VPS (FullInstall) and private (VM-mode) paths, which share this workflow.

Test-first at the clan-adapter seam (internal/clan/enrollment_test.go):

  • New TestEnroll_GeneratesVarsBeforeEvalPreflight drives a fresh node whose nix eval fails missing_var until vars generate has run — RED before the fix (blocked "a required secret has not been generated", reproducing this issue), GREEN after.
  • TestEnroll_VMModeGeneratesVarsBeforeVerify's asserted order updated to generate→eval.
  • The fake (internal/clan/testing/fake.go) mirrors the corrected order so founding/join seam consumers model generate-before-preflight.

All internal/... Go tests pass under the nix develop .#go-ci gate; go build ./... clean. The drive's frontier moves past enroll-configure toward supply/pair. STATUS.md updated (header lead + milestone log).

Fixed in f989696 (on origin/main). **Cause.** The clan enrollment workflow ran the eval preflight (a `nix eval` of the node's full config) AHEAD of `vars generate`. A fresh gateway node's config references its declared vars, so the eval itself failed `missing_var` ("a required secret has not been generated") and the stand-up blocked forever — no `sops/machines/` was ever written. The stage's own log line ("eval preflight, then the machine vars") stated the wrong order: run that way, a fresh node can never pass. **Fix** (`internal/clan/enrollment.go`). The `preflight` stage now runs `clan vars generate <node> --no-sandbox` ahead of the eval gate (and ahead of the install phases / verify's `machines update`), guarded by the snapshot's `VarsGenerated` so a resume never re-drives it. The install stage keeps a defensive fallback generate only for a resume that re-enters it directly. This fixes both the own-VPS (FullInstall) and private (VM-mode) paths, which share this workflow. **Test-first at the clan-adapter seam** (`internal/clan/enrollment_test.go`): - New `TestEnroll_GeneratesVarsBeforeEvalPreflight` drives a fresh node whose `nix eval` fails `missing_var` until `vars generate` has run — RED before the fix (blocked "a required secret has not been generated", reproducing this issue), GREEN after. - `TestEnroll_VMModeGeneratesVarsBeforeVerify`'s asserted order updated to generate→eval. - The fake (`internal/clan/testing/fake.go`) mirrors the corrected order so founding/join seam consumers model generate-before-preflight. All `internal/...` Go tests pass under the `nix develop .#go-ci` gate; `go build ./...` clean. The drive's frontier moves past `enroll-configure` toward `supply`/`pair`. STATUS.md updated (header lead + milestone log).
ben closed this issue 2026-08-10 15:34:54 +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#398
No description provided.