fleet: the gateway's mesh peer presents as a joinable "connected — not set up" device, while the gateway row reads "no recent signal" #1221
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.
Dependencies
No dependencies set.
Reference
Matou/idss#1221
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?
Observed on the phase-7 VM-mode drives 16 and 18 (runs on 2026-09-04, standing community rehearsal-e; the drive-18 Fleet screenshots in run
20260904T184215Zcarry both frames).Two symptoms, likely one cause
idss-gateway-rehearsal-e-0fa2appears on the Fleet screen as a joinable, "connected — not set up" device — an invitation to enroll the community's own gateway as a device.Hypothesis (unverified)
The
-0fa2suffix is netbird's collision rename: a peer re-registering under an already-taken hostname gets a suffixed name. If the gateway's mesh identity was re-registered at some point (the #1210 mesh-stack rework and the #1214 management restarts are candidates), the fleet projection may still bind the gateway row to the old, dead peer record (hence: no recent signal) while the live suffixed peer matches no known machine and falls through into the joinable-device bucket. One identity-matching defect would produce both frames.Whoever picks this up should first enumerate the management store's peers for rehearsal-e (how many peers claim to be the gateway, and which one the fleet projection binds to) before touching the matching code — if there is genuinely one peer, the two symptoms are separate defects and this splits.
Why it matters
Found as a phase-7 follow-up (task list of #1153's wrap-up); not blocking, the journey is green around it.
Ruled by agent under ADR 0174 — veto anytime
Ruling:
ready-for-session(an interactive agent session with the standing rehearsal-e gateway's management-store standing), notready-for-humanand notready-for-agent.Why this is a two-way door. The fix path is not yet knowable from code alone — the issue's own precondition is to first enumerate the management store's peers for rehearsal-e (how many peers claim to be the gateway, and which record the fleet projection binds the gateway row to) before touching the matching code, because if there is genuinely one peer the two symptoms are separate defects and the ticket splits. That enumeration + the subsequent correction is:
internal/fleetwire/) or a ticket split, both undoable by a later commit/label change.-0fa2peer is no longer offered as a joinable "connected — not set up" device.Why not
ready-for-agent: the diagnosis needs live enumeration of the rehearsal-e management store — session/host standing a swarm worker (reads onlyready-for-agent) lacks; it would land inagent-blocked. Why notneeds-info: the reporter (Ben) supplied the full picture; the missing piece is live-store enumeration a session performs, not information Ben must hand over. Why notneeds-design: Fleet is an existing surface — no missing flow/wireframe/seam contract.Session brief
20260904T184215Z, standing community rehearsal-e); the drive-18 Fleet screenshots carry both frames.idss-gateway-rehearsal-e-0fa2shows as a joinable "connected — not set up" device — an invitation to enroll the community's own gateway; (2) the gateway's own Fleet row reads "no recent signal" on a demonstrably-alive gateway.-0fa2suffix is netbird's collision rename; if the gateway's mesh identity re-registered (candidates: #1210 mesh-stack rework, #1214 management restarts), the fleet projection may still bind the gateway row to the old dead peer record (→ no recent signal) while the live suffixed peer matches no known machine and falls into the joinable bucket. One identity-matching defect would produce both frames.internal/fleetwire/so the row binds the live peer.Ruled by agent under ADR 0174 — veto anytime
Session outcome: the ticket's mandated first step — enumerate rehearsal-e's
management store peers before touching the matching code — could not be run in
this session (missing door, below). But the DO API + a code read settle enough to
refute the ticket's central hypothesis and point to the split the ticket
itself anticipates. Recording that, then routing to a human for the one read this
factory session cannot do.
Ruling 1 (provable, two-way door):
-0fa2is the broker's droplet-name suffix, NOT a netbird collision renameThe hypothesis blamed netbird's collision rename of a re-registered gateway peer
(candidates: the #1210 mesh rework, the #1214 restarts) — producing an old dead
record + a new suffixed one. That does not hold:
idss-gateway-rehearsal-e-0fa2,tags
idss-gateway, idss-rental, created2026-09-04T10:18:08Z(syd1) — therented drive box that served drives 16/18 (run
20260904T184215Z).idss-gateway-<slug>-<rand4>by the broker atcreation (
scripts/rental-reap.sh:73). Hereslug = rehearsal-e,rand4 = 0fa2.idss-gateway-rehearsal-e-0fa2(id 59115308). The box's OS hostname — hence its netbird peer name — inherits the
droplet name.
So
-0fa2is deterministic from droplet creation and present from the start — itis the gateway's original, correct peer registration, not a suffix netbird minted on
a re-join collision (that would look different, e.g.
…-e-0fa2-1). This stronglyimplies one peer, which per the ticket's own guidance means "the two symptoms are
separate defects and this splits."
Ruling 2 (code read): the Fleet projection never reads netbird peers — so neither symptom is "a mesh peer leaking into a bucket"
internal/fleetstate/projection.go+fleetstate.go: the projection is a live readover exactly two sources — the config-repo inventory (placement) + the enroll
ledger — and reads no netbird peer list. Therefore:
Symptom 2 ("no recent signal" on the gateway row). The gateway row is the
placed node with
Role=gateway(whole_surfaces.go:Gateway()), wearing monitoring'schip.
internal/monitor/status.go:170-197keys the heartbeat lookup by theplacement
Device.ID(o.beats.Latest(enroll.NodeID(d.ID))); a miss ⇒!reported⇒ the "no recent signal" /
silentchip. But the gateway is heartbeat-eligible(enrolled node #1 —
internal/founding/standup.go:216-220). The projection's ownnote (
projection.go:99-105) documents that the placementID("gateway") and theledger fleet identity ("node-"+requestID) diverge, and the projection joins ledger
facts through
IdentitywhileDevice.IDstays the clan name. If the gateway'sheartbeat arrives keyed to its enroll node identity but monitoring looks it up by
the clan-name
Device.ID, the row is permanently silent on a live gateway — anidentity-key mismatch, no collision required.
Symptom 1 (joinable
-0fa2device, "connected — not set up"). Since theprojection reads no peers, this entry is either a second placed inventory node
under the droplet hostname (⇒
provision/assess.go:deviceView,Provisioned=false⇒ "connected — not set up"), or a pending/enrolled ledger record under the
gateway's probed hostname surfaced by the pending strip
(
whole_surfaces.go:PendingDevices). Both are the gateway's own self-record failingto dedup against its placed gateway node — again an identity-match gap, not a
netbird rename.
Two identity-match gaps at two seams (monitor heartbeat-key vs. placement
ID;placement/ledger self-record dedup). They likely share the theme (the gateway's
identity is represented under more than one key across placement + ledger + heartbeat)
but are fixed in different code — hence the split.
Why human (the blocker this session hit)
Confirming one peer vs. two — the read that settles the split — requires reading the
live standing gateway's management store and/or its config-repo inventory + enroll
ledger. All of that lives on the gateway droplet (
170.64.139.203), and this sessioncannot reach it:
(
dev@matou-dev-01-controller) nor the clannixos-anywherekey; its rent-operatorkey is not on this host (no
test-results/standing-rented/orstate/rent-operator/anywhere; the drive workdir that held it is gone).
no cert for any name I could present; this host is on a different mesh
(
netbird.dev.matou.nz), so the mgmt API is not reachable from here either.The residue is operator/SSH access to the live standing gateway (a host-/account-held
credential this unattended session does not hold — ADR 0174 rule 3), or Ben's eyes on
the running dashboard's Fleet screen + the mgmt peer list.
Proposed default ruling (adoptable under ADR 0174 once the read is done)
The one read needed is ~5 min for anyone with the gateway door:
netbird … peer list(orsqlite3 store.db 'select id,name,last_login from peers') +the dashboard Fleet + enroll-ledger dump. If it shows one gateway peer (expected),
SPLIT into two defect tickets:
liveness is keyed to the placement
Device.ID(clan name) while the gateway reportsunder its enroll node identity (
monitor/status.go×fleetstate/projection.goIdentity divergence).
device — placement/ledger self-node dedup gap (
whole_surfaces.gopending strip /provision/assess.godeviceView).If it shows two gateway peer records, the original collision hypothesis is back in
play and stays a single ticket on the matching code.
Reproduced on a fresh manual founding 2026-09-08 (Whakatohea, rented, build db1d1b23, box 209.38.86.8): the Fleet gateway row wears
no recent signal/silent,telemetry_state: none,sampled_atzero —GET /api/v1/fleetreturns exactly that. So this is not rehearsal-e-specific.One more fact for the split, from the box itself: no agent unit runs on the gateway after the switch —
systemctl list-unitsshowsidss-control-plane,idss-mesh-self-admit,idss-self-trust,acme-dns-registerand noidss-agent*. The control-plane journal since boot carries no heartbeat receipt at all. So before the identity-key question (placementDevice.ID"gateway" vs ledgernode-req-0001, ruling 2 above) there is a prior one: nothing on the gateway heartbeats — the only thing sending a heartbeat is the address heartbeat to the broker. Whichever way the ruling goes (the gateway runs the agent like any device, or the control plane self-samples its own host and writes the beat under the gateway's node identity), the row stays silent until one of them exists.The
-0fa2-style joinable-device symptom was not checked on this box (idss-gateway-whakatohea-research-centre-cb94would be the name); the row symptom alone is enough to keep this open. Still ready-for-human — Ben, this needs your ruling on which of the two designs above.The check Ben asked for — what
idss-agent joindoes once enrolled — changes the picture. It is not that the gateway's unit died at the switch (it did — the golden image'sidss-agent.servicestarted at 00:09:47 and the rendered config carries no such unit — but that is not the root).No node in the fleet has ever sent a standing heartbeat. The whole chain is built and composed except its first link:
join.Orchestrator.Heartbeat(internal/join/land.go:187) builds theStatusReportand calls the fleet-reporting face — and has no production caller.grep -rn '\.Heartbeat(' agent internal/join control-planefinds only the definition. There is no cadence constant, no ticker, no loop in the agent that calls it.resumeOnce/guardOnceticker) resumes stranded joins and polls the enrolled guard (#1219). It never reports.grepfor cpu/mem/disk readers, gopsutil, /proc/meminfo: nothing).enroll.ResourceReadings(cpu_pct / mem_pct / disk_pct) is only ever projected, never filled — everytelemetry_statein production isnone.841c393) delivered the route (POST /api/v1/fleet/report), the authenticated stream, the composition, and "the agent's reporting face is now the real ReportClient" — the CLIENT, not the loop that drives it. Its AC1 ("an enrolled device reports → Latest reflects the beat within a cycle") was proven by a seam test drivingReportdirectly, not by an agent process on a cadence.So the Fleet health chip is blind for every node, gateway or device, and DDR 0071's silence classification has never had a live signal to work with — "pull the plug and nothing notices" (#208's own framing) is still true today. The gateway row is just where it is visible, because founding enrols it as node #1 and the projection shows it.
Revised recommendation:
Orchestrator.Heartbeatwith a sampledResourceReadings(a small/proc-based sampler: loadavg/cpu, meminfo, statfs on/). Same loop for every node kind. This is #208's missing half and #769/#800's missing source./var/lib/idss/agent-cache, in a report-only shape with the control plane at loopback (the founding shape's relay transport dies with the session, per main.go's own comment — so this is a third env shape,IDSS_COMMUNITY_ORIGIN=http://127.0.0.1:8080or the mesh address, notjoin).PlacedNode.Identitywhen set, elseID.healthywith non-nil readings within one cycle of the switch; a device's row goessilentwhen its power is pulled (the #183 B·6 leg — never proven live).Self-sampling in the control plane (option B) would only paint the gateway row and leave every device blind; it is the wrong fix.
Related: #1346 (the device key is baked into the golden image — a shared machine identity across rentals, found on the same box).
RULED by Ben 2026-09-08 — the revised recommendation above stands as the build. The agent grows a standing heartbeat loop; every node kind, the gateway included, runs it; monitoring joins through the ledger identity; self-sampling in the control plane is NOT taken.
Build list (one ticket, or split 1/2 from 3 if the swarm prefers — 4 lands with whichever is last):
join.Orchestrator.HeartbeatwithResourceReadingsfrom a small sampler package (/proc/loadavgor/proc/statfor cpu_pct,/proc/meminfofor mem_pct,statfs("/")for disk_pct; temperature stays nil where no hwmon). A failed beat is logged and retried next tick, never fatal (ADR 0100). Uptime from the process/host clock./var/lib/idss/agent-cache(already seeded, never fetched at switch),IDSS_COMMUNITY_ORIGIN= the control plane at loopback (http://127.0.0.1:8080) on the gateway, the mesh address on devices; identity from the pairing-mintedenroll.json/device.keythat survive the clan update. Verify what the loop needs thatjoinseeded, and that the founding-shape relay transport is never selected in this shape (main.go's own comment).internal/monitor(status.go:170, silence.go:104, readings.go:147) look the beat up throughPlacedNode.Identitywhen non-empty, elseID— one helper, three call sites.healthywith non-nil readings within one cycle of the switch (e2e leg on the rented + local-guest drives); (b) a device whose power is pulled readssilentafter StaleAfter (the #183 B·6 leg — live, not the seam double); (c) a unit test that the loop calls Heartbeat on cadence and survives a refused beat.no recent signal/telemetry_state: noneforever; cause = #208 shipped the ingest and client, never the sender; rule = a face with a client is not a signal until something drives it on a cadence — prove ingest legs with a process, not a direct call.The device-key collision on the image is #1346, separate.
Progress — CODE half landed (build-list items 1, 3, 5); item 2 + live pins remain (needs a live gateway drive)
Committed to
origin/mainas110f6d38(sandcastle: #1221 — build the fleet-heartbeat SENDER …). Following Ben's 2026-09-08 ruling. Fullgo test ./...(exit 0),go vet,golangci-lint, andgo build ./... -tags devall green.Landed (seam/unit proven):
internal/sampler(new) — a/proc/loadavg+/proc/meminfo+statfs("/")+ hwmon reader producing the nullableenroll.ResourceReadings(partial sample keeps the readable fields; every-reading-faulted →Unavailable; never a fabricated 0 — DDR 0202). The missing SOURCE #208 never shipped.join.Orchestrator.Heartbeatnow carries*ResourceReadings; newjoin.RunHeartbeatLoop(HeartbeatCadence= 30 s, one constant with monitoring's aggregation window + the P9 #769 freshness verdict) beats immediately then per cadence, logs+retries a refused beat, never fatal (ADR 0100). This is #208's missing sender loop.agent reportsubcommand (agent/cmd/agent/main.go) — wires the loop to the same production transportjoin/enrolluse (enrollTransportFor→ the Fleet face ofIDSS_COMMUNITY_ORIGIN);reportNodeIDresolvesIDSS_NODE_IDelse derivesnode-+requestID from the resume anchor.internal/monitorkeys the beat lookup throughfleetstate.Device.Identity(the ledgernode-+requestID) not the placement's clan namegateway, via a newbeatKeyhelper at all three sites (status.go/silence.go/readings.go); the projection propagatesPlacedNode.IdentityontoDevice. Proven: a placed node whose Identity diverges from ID, beat recorded under Identity, row readshealthy(control: a beat under the clan name alone stays silent).Still open — build-list item 2 + pins 4a/4b (needs a LIVE gateway drive, hence handing off):
agent report, on the gateway (internal/clanrenderControlPlaneSurface/renderGatewayGuest) and device (renderMemberMesh, which today emits no systemd unit). The unit must bake the LEDGER identity (node-+requestID, NOT the clan name — baking the clan name silently no-ops, beats refused) asIDSS_NODE_ID, resolve the seeded agent binary path/arch, order after the control-plane/mesh, and gate on the binary's arrival (the path-unit pattern). Getting the baked identity right + the ordering/binary path correct is unverifiable in-sandbox.healthywith non-nil readings within one cycle of the switch (rented + local-guest drives); a device whose power is pulled readssilentafter StaleAfter (the #183 B·6 leg, live).The sender + monitor join are proven and ready; the sender is dormant until item 2's unit lands and runs it. A swarm worker holds no live gateway standing (the same wall the earlier session hit), so item 2 + the live pins want a live-standing session/drive.
Live pins 4a + 4b PROVEN on a real rented gateway (2026-09-09, Whakatohea trial box 209.38.86.8, session with root standing) — items 1 and 3 hold end to end. Item 2 remains the only open piece.
Setup: the published agent
884b3130(carries110f6d38) copied to the box; the control plane rebuilt fromorigin/main74519845and swapped in at/srv/idss/bin/control-plane(old binary kept ascontrol-plane.db1d1b23); loop started by hand exactly as item 2's unit would:Pin 4a — the gateway row reads healthy within one cycle:
GET /api/v1/fleet35 s after the swapped control plane came up —(cpu 0 is honest —
/proc/loadavgon the idle box reads0.00.) Before the swap, the same beats against the OLD control plane left the rowsilent/none— the identity join (item 3) is what makes the clan-name row find the ledger-identity beat; proven by the before/after.Pin 4b — pulled plug reads silent after StaleAfter: loop killed at 14:06:00Z; at 14:12:15Z —
The silence classified against a live fleet with the last-known sample kept, never a fabricated zero — DDR 0071 / DDR 0202 as specced. #208's B·6 premise ("pull the plug and something notices") is true for the first time.
What this settles for item 2: the report-only shape works with exactly two env vars (
IDSS_COMMUNITY_ORIGINat loopback,IDSS_NODE_ID= the LEDGER identity);device.key+enroll.jsonunder/var/lib/idsssurvive the clan update so the transport authenticates;Clan.Statereads fine on the gateway. The rendered unit is a straightsystemd.services.idss-agent-reportover the seeded binary with those two vars — the only unverifiable bit was the baked identity, andnode-req-0001(="node-" + request idfrom the seed) is what worked. No live standing needed any more to land it; the pins above are the acceptance for the drive.swarm-claim host=elitebook-distributed-server-03 run=20674
(automated multi-host claim — lowest live claim id works this ticket)
Ruled by agent under ADR 0174 — veto anytime — item 2 SPLIT: gateway half landed, device half → #1356
Ruling: land build-list item 2's GATEWAY half here (the ticket's titular symptom — the gateway row reading "no recent signal"), split the DEVICE half + pin 4b to a follow-up (#1356,
needs-design). Ben's own build-list note explicitly allows this ("one ticket, or split 1/2 from 3 if the swarm prefers").Why this is a two-way door. The change is a rendered systemd unit (revertible by a later commit) and is proven by an existing seam test (
report_unit_test.go) plus Ben's own live proof 2026-09-09; not on the one-way-door list.Landed (gateway half of item 2): a new
gatewayReportUnitspliced into all four gateway renders (renderGatewayGuestkanidm+IDIP,renderControlPlaneSurfacekanidm+IDIP —internal/clan/vmguest.go) —idss-agent-reportexecs the SEEDED binary (/var/lib/idss/agent-cache/x86_64/idss-agent report) with exactly the two env vars proven live:IDSS_COMMUNITY_ORIGIN=http://127.0.0.1:8080andIDSS_NODE_ID= the box's LEDGER identity. That identity is a newGatewayFacts.FleetIdentity, fed by founding from a newenroll.FoundingGatewayNodeID(node-req-0001) — deterministic because the founding gateway is enroll request #1, so it works on every path (private VM / rented / own-VPS / self-hosted, kanidm & IDIP). Becausefleetwire.Supplyseeds the binary at DEPLOY not switch, the service is triggered by a companionsystemd.pathsoff the binary's arrival (the #1056meshSelfAdmitOneshotpattern), never the activation job. EmptyFleetIdentityrenders nothing (ADR 0100 no-op → warm-repo/test callers byte-identical). Full gate green (go build/vet/test ./...+golangci-lint+-tags dev, incl. the clan nix-eval smoke). Pin 4a delivered (Ben's live proof + this unit renders exactly that shape); pin 4c already landed in110f6d38.Why the device half is genuinely a separate slice (→ #1356,
needs-design). The gateway reports to loopback under a deterministic identity; a device does neither. ItsIDSS_COMMUNITY_ORIGINmust be the community API over the mesh (Ben: "the mesh address"), butrenderMemberMesh(internal/clan/netbird.go) carries only the netbird setup key + management URL (mesh.<apex>:443) — not the IDSS API, whosewt0address is dynamic; and there are TWO device shapes (NixOSrenderMemberMeshvs the non-declarativeinternal/installunit). Its identity comes from the resume anchor, not a bake. Pin 4b (a device powered off readssilent) rides that follow-up + a live device drive. None of that is available atrenderMemberMeshtime, so it wants its own design + slice rather than a guessed mesh origin shipped here.What proves the gateway half:
report_unit_test.go(all four renders bake the unit + the path unit + the two env vars + the seeded binary path; a no-identity render bakes nothing) and Ben's 2026-09-09 live pin 4a.close-report for #1221 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
mem_mb: nullwith nochipbecause no per-service monitoring slice exists #1433