deploy-takeover: does the INSTALLED member device return on a THIRD mesh address, staling d.MeshAddress for the front-door files route? #1069
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
Depends on
Reference
Matou/idss#1069
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?
Follow-up split from #1068 (the kexec-installer re-address fix, ADR 0209 amendment 2026-08-31, option A). Unproven — the #1068 drive (
20260831T102457Z) never got past the kexec phase, so this was never exercised.The open question
#1068 established that the takeover's kexec installer rejoins the mesh as a NEW peer at a NEW
wt0address (a fresh WireGuard key redeeming the single-use node-scoped key is a new peer to the management plane), and fixed the takeover to re-resolve that address and re-point disko/install/reboot there (enrollment.repointToRejoinedInstaller,enroll.NetbirdMinter.ResolveInstallerAddress).But the same reasoning may apply one step later: after
install+reboot, the box boots the installed NixOS system, whose netbird has its own fresh state dir → potentially a thirdwt0address, different from both the pre-kexec address AND the installer address. If so:d.MeshAddress(captured at landing, pre-kexec — ADR 0209 §3) is stale for the front door's member-device files route atinternal/provision/deploy.go:751,778(files.<apex>→<device-mesh-ip>:80), which would 502.snap.Target— now the installer IP2, also dead once the box reboots into the installed system).What to check
meshSelfAdmitOneshot— that is gateway-specific.)Device.MeshAddressmust be re-resolved and written back after the takeover completes (the sameResolveInstallerAddressprimitive #1068 added can find the connectednode-<requestID>peer), so both the verify reconnect and the later files route target the live address.How it will surface
Only a live device drive that gets PAST the kexec (i.e. with #1068's fix aboard) can prove or disprove this. Expect it to red at
enroll-activate/verify or at a later files-placement leg if the third address is real.Ruled by agent under ADR 0174 — veto anytime
Ruling:
bug+ready-for-session, blocked-by #1068 (now closed, so #1069 is on the frontier), grouped with the device-drive family (priority+rehearsal-183).Why this state, not the alternatives
ready-for-human. No one-way door here. The natural remedy is the same as #1068's landed option A — re-resolve the peer's address by itsnode-<requestID>group via the existing management-API client and write it back toDevice.MeshAddressafter the takeover completes. That reuses #1068'senroll.NetbirdMinter.ResolveInstallerAddressprimitive (commit03fb43cf), keeps the #1012 amendment's "never the device's original join key" invariant, widens no trust surface, and is fully revertible. Option B (a standing baked peer key) was already rejected on #1068 as a security-posture widening — if a fix ever needs that path it re-opens as a fresh one-way-door ticket, but nothing here proposes it.ready-for-agent(swarm-safe). The open question — does the installed NixOS system come back on a thirdwt0address? — and any fix's proof are only observable from a live device drive that now gets past the kexec with #1068 aboard (paid droplet stand-up, ~11m leg ceiling). That is an interactive session's standing and live-mesh territory, not swarm-visible work — the same reason #1068 sat atready-for-session.needs-info/deferreddon't fit. Nothing is owed from a reporter, and this is actionable now (its blocker #1068 has landed), not a human defer-with-criteria.Why it is a two-way door
Applying these labels + the blocked-by edge is revertible by a label/edge change, and the routing is provable by the next
drive-devicerun in the phase-5 family (#854): the drive either reds atenroll-activate/verify or a files-placement leg (third address is real → apply the write-back), or greens straight through (d.MeshAddresssurvives → close as disproven). Not on the one-way-door list.Grounding (verified against the tree)
internal/provision/takeover.go:172-173pins the enroll target to the pre-kexecd.MeshAddressfor every phase — confirmed.internal/provision/deploy.go:751,778routesfiles.<apex>→d.MeshAddress + ":80"— confirmed; a stale address 502s the member-device files front door.ResolveInstallerAddressprimitive is the ready building block for the write-back if the third address proves real.Next step: rides the next paid
drive-device. A session sweepingready-for-sessionpicks it up; a green drive closes it as disproven, a red applies the address write-back.Ruled by agent under ADR 0174 — veto anytime
The premise is disproven by the code — no live drive needed. There is no THIRD address: the installed member device returns on NO mesh address at all.
What the code proves
An installed member (non-gateway) node's
configuration.niximports only its base host files plus any placed service module — and none of them is a netbird client:internal/clan/member_attach.go:33—baseMemberModules = {networking.nix, disko.nix, platform.nix, access.nix}internal/clan/member_attach.go:43—memberServiceModules = {files.nix}(the one service ADR 0210 routes to a device)renderMemberConfiguration(member_attach.go:82) imports exactly that set, nothing elserenderPlatform/renderAccess/writeNodeConfig(internal/clan/enrollment.go) bake only hostPlatform, sshd+root-keys, networking, disko for a full-install member — no meshThe netbird client + self-admit oneshot are gateway-only:
netbirdClient/meshSelfAdmitOneshot(internal/clan/netbird.go:408-411, 452-534), gated onGatewayFacts.Meshand wired in only from the gateway surfaces invmguest.go. The ticket's claim that member devices have nomeshSelfAdmitOneshotis correct — and nothing replaces it.So the three addresses in the flow are:
wt0, landingmeshupredeems the original join key on the stock OS; stored asd.MeshAddress#1068re-resolves + re-pointssnap.TargethereThe RAM/tmpfs installer that owned IP2 is destroyed by the reboot; the disk-installed system has no netbird to re-establish it. So there is no third address to re-resolve.
Why this is bigger than a stale
d.MeshAddressAfter the reboot the installed member device is off the mesh entirely, which breaks both consumers named in the ticket:
verifybuilds itsclan machines update --target-hostfroms.Target(internal/clan/enrollment.go:1293-1295), which the#1068kexec re-point left at the installer IP2 (enrollment.go:1994). IP2 is dead once the box reboots into the netbird-less installed system, so verify burns its reconnect budget and concedes a misleading "still coming back up — re-drive to resume" block, never landing the member.files.<apex>→d.MeshAddress:80(internal/provision/deploy.go:751,778) is pinned to the dead landing IP1.Neither has a live peer to re-resolve to, so the
ResolveInstallerAddressprimitive#1068added cannot close this the way it closed the installer reconnect.Why human — a one-way-door mesh-admission ruling
Closing
#1069requires giving the installed member device a way to rejoin the community mesh: a member self-admit module + a key-mint mechanism. Every candidate mechanism touches the mesh trust surface:#1068ADR 0209 amendment rejected as option B ("a one-way door under ADR 0174 … rejected here without a separate Ben ruling").That is a one-way door on all three axes (trust-surface, live-drive-only, non-routine spend), so it is not agent-rulable under ADR 0174.
Proposed default ruling (for the human)
Give the installed member device its own mesh-rejoin, mirroring the gateway's self-admit but scoped to the device:
node-<requestID>-scoped self-admit oneshot into the member node's config (a newmesh.nixinbaseMemberModules, gated on the fleet running the mesh plane).MeshMinterport, not a standing key) and the member redeems it once at first boot — so no standing credential lands in the config repo (keeps the option-B invariant intact).wt0via the existingResolveInstallerAddressprimitive (the connectednode-<requestID>peer) and writes it back toDevice.MeshAddress, so both the verify reconnect and the files route target the live address. Note the write-back is non-trivial:d.MeshAddressis today a projection of the enroll ledger's landing fact (internal/fleetstate/projection.go:285, fromConfirmEnrolled), so a post-takeover address is a new authoritative source that needs its own home.If instead a standing key is deemed acceptable (option B), that is the Ben ruling this ticket needs.
This session (the two-way part, landed)
Corrected the false "third address" framing in
internal/provision/takeover.go, the ADR 0209 amendment's Open note, andSTATUS.md— commit102beb16onmain. No behaviour change; the touched Go package builds and gofmt is clean.Relabelling
ready-for-session→ready-for-human. Veto anytime.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) #1070Live proof arrived — #1070 (drive
20260831T113210Z)The live-drive evidence this ruling was waiting on has now landed on a paid drive, filed as #1070. It confirms the code-proven premise exactly:
verifyat all proves kexec · disko · install · reboot all completed (Advanceonly entersStageVerifywheninstall()returns clean).verifyspent its reconnect budget against the dead installer IP2 before conceding.So this is not a hypothetical anymore — every re-drive is now deterministic: it gets through the kexec, re-images the droplet, and reds identically at
verifyfor the ~22m it takes to spend the reconnect budget. The device drive (#854) has been re-pointed to be blocked by this ticket (#1069) — the real one-way-door blocker — so the queue no longer burns droplets on it.Two-way honesty half landed (via #1070)
Until this ruling lands, the member-device verify block no longer presents as the misleading resumable
recovery.mode: "resume"/ "wait for the reboot to finish, then re-drive to verify" (the reboot has finished; a re-drive reds identically).deployTakeovernow re-classifies aStageVerifyblock to a NON-resumable fault naming this ruling. This branch reverts when #1069 lands a member self-admit + key-mint (the box would then rejoin and a verify block becomes genuinely resumable again). Commit46bd4a7a.Still
ready-for-humanon the one-way mesh-admission ruling (the proposed default above). Ruled by agent under ADR 0174 — veto anytime.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) #1070Ruled by Ben (via session, 2026-08-31) — option (A): the installed member carries the installer's mesh identity across the install
(This ruling was posted on #1070 (comment 32838) ten minutes after triage folded #1070 into this ticket — reproduced here in full because #1069 is the open park on #854. Same content; act on this copy.)
Ruling. An installed member device rejoins the community mesh as the same peer the kexec installer already is — no third admission, no standing key, no secret in the config repo. The installer's netbird identity (its WireGuard key + config, the peer
netbird-mgmtalready admitted at IP2 under #1068) is copied onto the freshly-disko'd disk beforeinstall, and the installed member's configuration carries the same netbird client module the gateway has, so on reboot the box comes up on the same wt0 address the post-kexec phases were re-pointed to.verifythen reaches it, and that address is what the front door routes files to.Why A, not B/C. (C) — a standing node-scoped key persisted into the replicated config — is the posture widening #1068's option B was rejected on (ADR 0126: no secret in the config repo). (B) — a third single-use mint dropped on disk — works but yields a third address and a third admission per takeover for no gain. (A) reuses an admission the plane has already granted for exactly this node-, adds no secret anywhere it wasn't already (the installer's state dir is on the box's own disk, same as the gateway's), and is a two-way door: it's one file copy between two phases that already exist.
Scope for the worker:
internal/clan/member_attach.gobaseMemberModules): add a member netbird client module rendered with the SAME shape/name as the gateway's peer —services.netbird.clients.mesh = { port = 51820; interface = "wt0"; hardened = false; environment.NB_MANAGEMENT_URL = <the community management URL the installer used, InstallerMesh.ManagementURL>; }— so the state dir (/var/lib/netbird-mesh) and socket match the installer's (post-#1057renderInstallerMesh). No setup key, no self-admit oneshot on the member: the identity arrives with the state dir. Render-gated on a mesh-addressed takeover, the same predicate as the installer image.enrollment.install(internal/clan/enrollment.go:780), between thediskoandinstallphases (the takeover already drivesclan machines install --phases <ph>one phase at a time,enrollment.go:1624): over the re-pointed installer target,mkdir -p /mnt/var/lib && cp -a /var/lib/netbird-mesh /mnt/var/lib/netbird-mesh(mode-preserving; the dir is root-only). Record it inDonePhases/snapshot so a resume never re-copies over an installed system. Fail LOUD if the source dir is absent (an installer that never rejoined has nothing to carry — that is a #1057-class fault, not a silent cold member).reboot, resolve the peer by its node group exactly as #1068 does (repointToRejoinedInstaller/ResolveInstallerAddress) and persist it toDevice.MeshAddress, sodeploy.go's member files route (files.<apex>→<mesh-ip>:80) stops pointing at the dead landing IP1 — this closes #1069's real half.verifycannot reach the box, the fault must not present asrecovery.mode: "resume"with "wait for the reboot" — a resume into a dead address burns 22 min and a droplet. With (A) landed the case should not recur; keep the concession text truthful either way.member_attachrender test proves the member config carriesservices.netbird.clients.mesh(and NO setup key / self-admit), an enrollment test proves the carry-over step runs once between disko and install with the right paths and is skipped on resume, and the ADR 0209 amendment records this ruling (installed member = installer's peer; #1069's "third address" note closes).verifygreen, thenfiles-door/oidc-login(never yet run) get their first shot.Re-labelling
ready-for-session→ready-for-agent; #854 stays parked on this ticket until it lands.swarm-claim host=matou-dev-server-01 run=15180
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1069 — status
success⛔ close-report gates REFUSED this close — the following claims did not verify:
d6865d3d08is not reachable from origin/main (not landed)envelope
close-report for #1069 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope