deploy-takeover: the kexec installer rejoins the mesh as a NEW peer on a NEW wt0 address, so every post-kexec phase deploys to the dead pre-kexec IP #1068
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
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1068
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?
Failure
Drive
20260831T102457Z(targetdevice, commit4b01ae58) red atdeploy-takeoverafter 661s, whole journey otherwise green (26/27 legs,artifacts/legs.json,artifacts/verdict.json):This is NOT a recurrence of #1057. That fix (commit
082daa34, in this drive's tree) holds: the installer's netbird DAEMON stood, the oneshot ran clean and exited successfully.Evidence — the installer rejoined, at a different address
From
logs/device-journal.txt(the post-kexec installer environment)::877—client/internal/profilemanager/config.go:294: generated new Wireguard key:905—client/internal/auth/auth.go:307: peer has been successfully registered on Management Service:946—client/internal/connect.go:387: Netbird engine started, the IP is: **100.82.232.94**/16:950—idss-installer-mesh: the takeover installer rejoined the mesh on wt0:952—systemd[1]: Finished IDSS takeover installer — rejoin the community mesh (wt0).Corroborated by
logs/device-units.txt:7— the installer's netbird binds100.82.232.94:53and nothing on100.82.251.189; and bylogs/device-stall.txt:2,:9— uptime 0:04 at 10:55:32 with a 2.0G tmpfs root, i.e. the box was alive in the kexec installer the whole time the deploy was gettingNo route to host.logs/device-do-forensics.txtconfirms the droplet itself never faulted (tcp/22: a FRESH connect succeeded; the only DO action on droplet 596561468 is itscreate).So: the box was up, on the mesh, reachable — at an address the deploy never tried.
Defect
Two lines encode an assumption this drive disproves.
internal/provision/takeover.go:172-173pins the enrollment's target once, at takeover start, to the device's pre-kexec wt0 address:That target drives every phase, including all post-kexec ones.
internal/clan/netbird.go:653-730(renderInstallerMesh) has the installer redeem a fresh single-use setup key (internal/clan/clan.go:397-406, minted per takeover atinternal/provision/takeover.go:207-220→control-plane/cmd/control-plane/whole_composition.go:913-922). A fresh key redeemed by a fresh WireGuard key is, to the management plane, a new peer — and a new peer is allocated a new mesh IP.The doc comment asserts the opposite.
internal/clan/netbird.go:624-626: "so the device reappears at its wt0 address in the installer environment and every post-kexec phase (disko, install, reboot) deploys to the ONE mesh target ADR 0209 rules, before AND after the kexec." The identity is not preserved across the kexec, so the address is not either. Same claim ininternal/clan/clan.go:372-384and in the ADR 0209 amendment (2026-08-30, #1011/#1012) it implements.Suspected layer
The ADR 0209 amendment's addressing model — not the installer image, not the daemon wiring. The amendment already ruled on addressing once (it rejected "option A", a public/
NetworkFacts.Addresssplit, because a NAT'd member device has no such address —internal/clan/netbird.go:646-649), so re-opening it is a design call, which is why this is filed rather than healed.What plugging it needs
Two candidate remedies; they differ in secret-handling posture, so pick one at design before coding:
node-<requestID>(internal/enroll/mesh_minter.go,NetbirdMinterdoc — "auto-grouped into a group named for the request (node-) so the peer it admits is identifiable and revocable by request id"), and the gateway already holds a management-API client on that port. So the gateway can look the installer's new IP up by group after the kexec. Needs: a resolve-peer-address-by-node port besideMintInstaller, plus a way forclan.Enrollmentto re-point its SSH target mid-run (today it cannot — the target is fixed atEnroll). Keeps the amendment's "never the device's original join key" invariant intact.100.82.251.189. This directly contradicts the reasoning recorded atinternal/clan/netbird.go:641-649, which justifies the baked copy precisely because the key is fresh, single-use and short-TTL ("a baked copy in a transient, locally-built image widens no standing blast radius") — a standing peer key would not clear that bar. Do not take this path without an explicit ADR ruling.Whichever is chosen,
internal/clan/netbird.go:624-626,internal/clan/clan.go:372-384and the ADR 0209 amendment must be corrected: the current text states an invariant the mesh does not provide.Also check as part of the fix (not proven by this run, since the takeover never got past kexec): whether the installed system likewise comes back on a third address, which would leave the stale
d.MeshAddresswrong for the files placement atinternal/provision/deploy.go:751,778too.Cost note. Each rediscovery of this costs a full one-droplet stand-up plus ~11 minutes of leg ceiling; the drive should stay blocked until the addressing model is ruled on.
drive
20260831T102457Zred atdeploy-takeover:deploy failed (rescue): clan: target_lost on node-req-0003: the takeover's deploy target root@100.82.251.189 stopped answering during the kexec phase, before any disk work completed — the session waevidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260831T102457Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedClose report — #1068 fixed (option A), commit
03fb43cfRuled by agent under ADR 0174 — veto anytime. The ticket asked the addressing model to be ruled on before coding. Ruling: adopt option A (re-resolve the target after the rejoin). It is a two-way door — a revertible code change, proven at the clan + enroll seams, that keeps the #1012 amendment's "never the device's original join key" invariant intact. Option B (bake the device's live netbird WireGuard private key so it re-registers as the same peer) is rejected: a standing peer key in a baked image is a security-posture widening — a one-way door under ADR 0174 — and does not clear the bar the amendment set for the fresh, single-use, short-TTL key. Its trust residue would need an explicit human ruling; option A needs none.
Root cause confirmed
The #1012 amendment assumed the installer "reappears at its
wt0address." It does not: a fresh single-use node-scoped setup key redeemed by a fresh WireGuard key is, to the Netbird management plane, a new peer → a new mesh IP. Drive20260831T102457Zproved it (installer up at100.82.232.94, deploy knocking the dead100.82.251.189). Not a #1057 recurrence — the declared daemon held.What landed (all offline-proven, revertible)
enroll.NetbirdMinter.ResolveInstallerAddress(node, exclude)— readsGET /api/peers, returns the connected peer in thenode-<requestID>group whose IP ≠ the pre-kexec address (the dead peer lingers, disconnected); polls until the installer rejoins or the ctx deadline. No rejoined peer → error, never a fabricated address (ADR 0100).clan.InstallerAddressResolverport +EnrollRequest.InstallerResolver(request-only). On a kexec-phase connectivity fault before any disk work,enrollment.repointToRejoinedInstallerre-pointssnap.Targetand continues disko/install/reboot against the rejoined address; a box that never rejoins still reds the honesttarget_lost(naming the dead target, no resume promise). The re-pointed target is persisted, so a resume needs no resolver.provision.InstallerMeshMintergainsResolveInstallerAddress;takeoversetsreq.InstallerResolver = o.installerMinter; the whole-composition adapter delegates to theNetbirdMinter. The gateway already held that management-API client (the one the mint rode).Proof
Red-first offline seams:
internal/clan/installer_repoint_test.go(re-point → new address; never-rejoins →target_lostwith no disk work; no resolver → unchanged pre-#1068 terminal),internal/enroll/mesh_minter_test.go(ResolveInstallerAddressreturns / skips-the-pre-kexec-address / errs-loud).go build/vet/test ./internal/clan ./internal/enroll ./internal/provision ./control-plane/...+ gofmt green.Docs corrected (the ticket's requirement)
The false invariant is fixed everywhere it was stated:
internal/clan/netbird.go,internal/clan/clan.go,internal/clan/adapter.go,internal/provision/provision.go, and a new ADR 0209 amendment (2026-08-31) recording the ruling + the corrected model.GOTCHAS #142records the hazard.Residue (not this ticket)
deploy-takeoverrides the next paid device drive — the mechanism is proven at the seams; the nixos-anywhere reconnect timing is the loop-closer, as with every prior drive-found defect.d.MeshAddressfor the front-door files route and possibly the post-reboot verify reconnect) — unprovable here because this drive never got past the kexec.Closing as done + proven at the offline seams. Re-open if the next device drive shows the re-point missed a frame.
20260831T113210Zred atdeploy-takeover: the #1068 re-point held and the install LANDED, but the installed member is off the mesh so verify can never reconnect (#1069, live proof) #107020260831T113210Zred atdeploy-takeover: the #1068 re-point held and the install LANDED, but the installed member is off the mesh so verify can never reconnect (#1069, live proof) #107020260831T113210Zred atdeploy-takeover: the #1068 re-point held and the install LANDED, but the installed member is off the mesh so verify can never reconnect (#1069, live proof) #1070activefires while it is still pulling the closure #1099activefires while it is still pulling the closure #1099activefires while it is still pulling the closure #1099deploy-takeoverreds on a proof that cannot exist —journalctl -bon the box the takeover just erased #1110netbird upis a no-op on a device already on another mesh and records the foreign address as the mesh fact; a member Files placement writes a kanidm-only files-idp.nix onto the gateway and nothing detaches it — gatew… #2040