deploy-services: a VM-mode guest is admitted with no deploy target — Supply.Seed refuses node node-req-0003 has no deploy target (drive 20260903T223815Z) #1206
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1206
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The failure
Drive
20260903T223815Z(--target device, vm axis) reached leg 28 of 28 and redded atdeploy-services. 27 legs green —standingthroughselect-filesall held, includingjoinandapprove, which the last three drives were stuck behind (#1200, #1202, #1204). This is the first drive to reach the P4-S4 services deploy on the VM axis.Run evidence:
artifacts/legs.json(28 legs, one red),artifacts/verdict.json(firstRedLeg: deploy-services, commitdd569b68),artifacts/journey.device-device-add--809eb-e-standing-rented-community/error-context.md(the page snapshot shows the founding hand-off surface, not a UI fault — the error is the control plane's own).artifacts/join-transcript.txtconfirms the axis and that the guest is genuinely on the mesh: the join chose> 2(VM on the existing OS), then✓ VM online — it is the joining node→✓ joined the community network→✓ community trust installed→✓ this machine is enrolled. So the guest has a live wt0 and the ledger has its address.The defect
A VM-mode device's node is admitted into the config repo with no SSH deploy target, ever, and no later step supplies one.
Admission places the node with a name only.
internal/enroll/admission.go:43callsa.placer.AddNode(ctx, v.Grant.Node, ""), andinternal/clan/config.go:27-40writes exactlyinvMachine{Name: …}+Role— it never touchesDeploy.TargetHost. Correct by design (ADR 0209 §4: landing is membership, role comes at P4).The full-install sibling fills the gap through the enrollment:
internal/provision/takeover.go:209-210setsreq.Target = clan.SSHTarget("root@" + d.MeshAddress), andclan.Enrollment'swriteNodeConfigpersists it —internal/clan/enrollment.go:585-588(if s.Target != "" { m.Deploy.TargetHost = string(s.Target) }), withpersistTargetre-capturing it at a re-point (internal/clan/enrollment.go:2124-2148).The VM-mode path runs no enrollment at all.
internal/provision/deploy.go:216-219routes a non-takeover-ready device todeployServicesOnly, which is services-only by contract —internal/provision/deploy_test.go:1484-1487assertsrec.enrolls == 0for exactly this shape. SowriteNodeConfignever runs, anddeploy.target_hostfornode-req-0003stays empty.deployServicesOnlythen hits the hard precondition with a bare node id:node := clan.NodeID(d.ID)(internal/provision/deploy.go:369) →o.clan.Supply().Seed(ctx, node)(internal/provision/deploy.go:447), wrappedprovision: seed %s: %wat:449— the exact prefix in the leg error.Supply.targetrefuses, correctly and loudly:internal/clan/supply.go:35-37. The machine is in the inventory (otherwise the message would beis not in the inventory,supply.go:33) — it is placed but targetless. The refusal is the right behaviour; the missing write upstream is the bug.The verb that should do the write already exists and is unused on this path:
clan.Config.SetDeployTarget(internal/clan/config.go:88-100), whose only production caller today is the founding private path (internal/founding/seed.go:290). The address is already in hand —d.MeshAddress(internal/fleetstate/fleetstate.go:137-141, projected atinternal/fleetstate/projection.go:205,285from the ledger's landing capture,internal/enroll/ledger.go:551) — and the same deploy already reads it for the front-door route atinternal/provision/deploy.go:1110-1116. So on this very run the deploy knew the guest's wt0 and routed files to it, while the seed one step earlier had no door to dial.Why the seam tests are green
The VM-guest deploy is covered (
internal/provision/deploy_test.go:1465-1524, task 5 of #1153) and passes, because the fake never models the inventory:internal/clan/testing/fake.go:1200-1203—fakeSupply.Seedmarksseeded[n] = trueand returns nil, consulting no target. Any fix should close that blind spot too (a fake seed that refuses a targetless node), or the next regression lands the same way.The ruling this needs
Where the fresh-per-operation capture (ADR 0039) comes from on the VM axis, and where it is written:
d.MeshAddressis the ledger's landing-time projection. ADR 0039 says captured fresh per operation from Netbird; the full-install path hasInstallerResolver/recordRejoinedMeshAddress(internal/provision/takeover.go:335-360) for exactly that staleness. A VM guest's wt0 should be stable across a reboot, but whether the deploy re-resolves or trusts the projection is a decision, not a mechanical choice.deployServicesOnlybeforeSeed(a per-operation capture, one extra config-repo commit per deploy), or at admission/approve (membership carries the door). The former matches ADR 0039's wording; the latter matches howAddNodealready owns placement.Supply.Seeddialsssh-ng://root@<wt0>with the adapter's configured identity. The guest's root trust was minted by the device host's own enroll-trust key (#1200) plus the community trust the join transcript reports — worth confirming the gateway control plane's key is in that set, or the seed will get past this refusal only to failPermission denied (publickey)on the next drive.Refusal
Rule 3 — product-behaviour surface. Every candidate fix site (
internal/provision/deploy.godeployServicesOnly, orinternal/enroll/admission.go) is control-plane orchestrator code, and the change adds a config-repo commit and alters what a deploy does and which door it dials. That is a design decision under ADR 0039/0209/0223, not a harness or fixture repair. Nothing in the harness, fixtures orscripts/can supply a deploy target — the refusal comes from the real control plane on the standing gateway.No edits were made; the checkout is clean at
dd569b68.Evidence gaps, stated
state/clan-config-snapshot/is not the authoritative repo:logs/clan-config-snapshot.lognames its source astest-results/standing-rented/state/clan-config, the founding-time local replica.founding-state.logrecords the authority flip to the control-plane API on the gateway (founding repo pushed to clan-ssh://node-req-0001/srv/idss/config.git — authority flipped), so the snapshot's gateway-onlytree.txt(lines 25-30; nomachines/node-req-0003/) does not prove what the gateway's live inventory holds. The diagnosis above rests on the code path and on the refusal's own wording (has no deploy target, notis not in the inventory), which places the machine in the live inventory without a target.logs/broker-journal.txt— harvest failed,dev@100.98.48.68: Permission denied (publickey); off-mesh executor, by design (#681), verdict does not depend on it.logs/state-logs.log—ENOENTatstanding-rented/state/logs; no per-operation control-plane logs were harvested for this run. The gateway journal (logs/gateway-journal.txt, 611 KB) is present if a worker wants the control plane's own line for the failed seed.Targeted check for the fix
go test ./internal/provisionandgo test ./internal/clan, with a new case proving a VM-mode deploy records the guest's wt0 asdeploy.target_hostbeforeSeed— and afakeSupply.Seedthat refuses a targetless node, so the case can actually fail.Advances #1153.
drive
20260903T223815Zred atdeploy-services:deploy failed (clean-retry): provision: seed node-req-0003: clan: Seed: node node-req-0003 has no deploy target — captured fresh per operation from Netbird at enrollment (ADR 0039; engine-adapters:cevidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260903T223815Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRuled by session under ADR 0174 — veto anytime. The diagnosis above is adopted (deploy-time capture via the existing
SetDeployTargetverb, fromd.MeshAddress, ADR 0039 fresh-per-operation, + close thefakeSupply.Seedblind spot so the fake refuses a targetless node exactly likesupplyFace.target). Two additions from tracing the whole chain — the target write alone moves the red one wall, it does not open the door:Gap 2 — the gateway's deploy key never reaches the GUEST. The grant carries
ClanTrust.DeployAuthorizedKeys(#1007) andtrust.InstallCerts→authorizeDeployKeysinstalls it — buttrust.New(run)runs on the host (agent/cmd/agent/wiring_prod.go:114), so in VM mode the key lands in the host's/root/.ssh/authorized_keyswhile the node the gateway will dial is the guest, whose root trusts exactly one key: the host agent's enroll-trust key (fw_cfg, DDR 0224). Fix the target alone and the very next drive reds at Seed withPermission denied (publickey)— the #1200 signature, one hop over.Fix shape: at landing, in the ModeVM branch of
join/land.go(afterGuestMeshJoin, beforeConfirmEnrolled— a guest that cannot authorize the gateway must red the LANDING, not the later deploy), hand the grant's deploy keys into the guest over the same loopback channel: aGuestAuthorizeDeployKeyson the vm manager viaguestRun, idempotent append mirroringtrust.go's script, same refuse-loud posture (a redeemable member grant with no deploy key refuses, #1007 / ADR 0100).Constraint — the append path inside the guest: NOT
/root/.ssh/authorized_keys. The guest'sidss-enroll-trustunitcp-OVERWRITES that file from fw_cfg on every boot (nix/guest/configuration.nix:84) — an append there works until the first guest reboot, then the fleet silently loses its deploy door (a latent, worlds-later red). Use/etc/ssh/authorized_keys.d/root, which NixOS sshd reads beside it (the same splitinternal/clan/vmguest.go:516already leans on for the DO gateway) and nothing overwrites. Verified: guest firewall allows 22 globally (wt0 included),PermitRootLogin prohibit-password— key auth is all that's missing.Also carried by the wire evidence: the host-side
InstallCertsstays as-is in VM mode (the HOST needs the community CA in its TLS bundle for the agent's own API calls; sshd-up on the host is harmless). Only the deploy-key authorization is node-scoped and must follow the node into the guest.Rulings (two-way, design-tier accept): (1) consent copy and consentHash UNTOUCHED — the P3-S3 offer already binds "dedicates N cores…"; the gateway reaching the node it admitted is the ADR 0210/0223 deploy contract, not a new disclosure. (2) No posture widening: the guest ends up trusting exactly what a full-install member trusts (the community's deploy key, #1007 precedent), over the same mesh; the host keeps supervisor-only powers. (3) Cannot-fail pins wanted: the fake-Supply blind spot (a targetless Seed must red offline), the authorized_keys.d-vs-overwrite fact (a test asserting the append path is NOT the fw_cfg-owned file), and the landing-order fact (deploy-key hand-in failure reds the landing before ConfirmEnrolled).
It's
ready-for-session— if the runner hasn't claimed it in ~20 minutes I'll take it myself, same as #1200.Claimed by session (unclaimed past the 20-minute window). Implementing both gaps per the rulings above — deploy-time
SetDeployTargetcapture + land-timeGuestAuthorizeDeployKeysinto/etc/ssh/authorized_keys.d/root, with the three cannot-fail pins.Landed as
e86e9f00— all three walls from the rulings:deployServicesOnlycapturesdeploy.target_host = root@<MeshAddress>fresh per operation (ADR 0039) before Seed; gateway rows exempt (founding-owned self target). Pinned by the extendedTestDeploy_VMModeDrivesClanDeployServicesOnlyNeverEnroll.vm.GuestAuthorizeDeployKeys) afterGuestMeshJoin, beforeConfirmEnrolled— keyless grant refuses to land, failed hand-in stays Approved/retryable; keys land in/etc/ssh/authorized_keys.d/root(the fw_cfg-owned file is overwritten every boot — pinned byTestGuestAuthorizeDeployKeys_LandsInAuthorizedKeysDNeverTheFwCfgOwnedFile), base64 transport, grep-guarded idempotent append.fakeSupply.Seednow refuses a targetless node exactly likesupplyFace.target, fed bySetDeployTarget/Enroll(req.Target); fixtures across provision/update/controlapi/enrollwire grew the mesh facts every landed node has live.GOTCHAS #158 + ADR 0223 amendment record the class. Full suite green, both tag sets. Advances #1153 — drive 10 travels
deploy-serviceswith a door that exists and trusts the gateway.