enroll-activate: gateway cloud-final still fails on converge — #893's fix did not hold #899
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#899
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
20260827T082850Z(--target device, commitee9aef78) went red at legstanding, propagated fromenroll-activateafter 247s. 11 legs green, 2 red, 0 skipped — so this is not the known own-VPS pairing frontier (legs.jsonrecords no skip reasons at all this run; the drive died before pairing was ever reached).enroll-copywent green first (413631 ms, "726 store paths"), so the system reached the box: this is an activation-side failure, not a transport one.clanexited 0; the masked_exit detector (internal/clan/errors.go:124-134, tripped by the"failed to"marker aterrors.go:338) refused the pass.Evidence
artifacts/legs.json— the tripping lines, identical on the leg and on thestandingwrapper:That is
cloud-final.servicedying on the rented gateway during activation, then dying identically on systemd's retry 24 s later.artifacts/verdict.json—"firstRedLeg": "standing","legs": {"total": 13, "green": 11, "red": 2, "skip": 0},"commit": "ee9aef784971f7760b743ca1e1db2233f5c170bd".logs/founding-state.log—standup.events[]walks clean throughenroll-copy("the system is on the gateway") and into activation, then faults:with
draft.access.ip=134.199.163.163and"founded": true,standup.step: "rented".artifacts/journey.device-.../error-context.md:36— the app's own S10 fault frame carries the same line withRetry/Switch the access optionbuttons, so the product is faithfully surfacing a real deploy failure, not a Playwright artefact.artifacts/journey.jsonis{"rows": null, "fault": null}— the drive never reached its own founding rows.The gateway's journal was never harvested.
logs/holdsdevice-*.txtonly, andlogs/device-journal.txtis entirely the member device box: 563 hits forclan-lab-rehearsal-26f45ade, zero foridss-gateway-rehearsal-c-0d69.logs/device-do-forensics.txtprobes134.199.171.52/ droplet595543661— the device, not the gateway134.199.163.163.logs/droplet-journal.txt(named in the harvest contract) is absent; so arelogs/gateway-journal.txt/gateway-do-forensics.txt.logs/state-logs.logandlogs/broker-journal.txtare both explicit harvest misses (ENOENT ... /test-results/standing-rented/state/logs;dev@100.98.48.68: Permission denied (publickey)— the by-design off-mesh case, #681).No live-box section was appended to this task, so I had no access line to either box and diagnosed from the harvested logs alone. (
device-do-forensics.txt:10recordstcp/22: a FRESH connect succeededat 08:43:38 — but against the device; nothing in this run ever probed the failing gateway.)Suspected layer — product, with a harness blindfold on top
Product.
internal/clan/vmguest.go:361-393(rentedHostNetworking). #893 (0ebee23, in this drive's tree —ee9aef78is a descendant) set exactly four lines as the whole mitigation:There is no
wantedBy = [], nounitConfigcondition and no masking emitted for any cloud-init unit anywhere in the tree. The #893 rationale comment (vmguest.go:374-389) predicts precisely the signature we got ("the unit crashes, systemd retries it, it crashes identically ... clan's deploy exits 0, the masked_exit detector ... refuses the pass, and enroll-activate reds — on EVERY converge onto the box"). The knob is in, the failure recurred: the #893 ruling did not hold. Either (a)restartIfChanged = falsesuppresses a restart but not a start —switch-to-configurationwill still start a unit the new generation wants that is not currently active, so a converged, already-initialised droplet re-runs the final stage; or (b)cloud-finalis now failing for a different reason than #893'sIsADirectoryErroron/var/lib/cloud/instance. (a) vs (b) is not decidable from this run's evidence — that needs the gateway's own journal, which was not collected.Harness (the reason it is not decidable).
oc_device_evidence(scripts/lib/rehearsal-droplet.sh:1320-1329) keys the gateway harvest solely onartifacts/standing-founded.json:But
app/tests/e2e/journey.device.spec.ts:312-319writes that file only afterrunRentedPrefixreturns (and afterenrolOperatorCredential()), so any red inside the prefix — the exact class this red is — silently skips the whole gateway harvest. Meanwhileartifacts/droplet-ip.txtalready held the failing gateway's address (134.199.163.163), written mid-prefix atapp/tests/e2e/fixtures/rentedPrefix.ts:291. The device branch never consults it (the rented branch does,scripts/smoke-private-path.sh:681-683). Net: a gateway-caused red produced no gateway evidence, with its IP sitting on disk.What plugging it needs
oc_device_evidence, fall back toartifacts/droplet-ip.txtwhenstanding-founded.jsonis absent, and skip only when both are — mirroringsmoke-private-path.sh:681-683. Extendscripts/tests/device-evidence-order-test.sh(skip-message assertions at:79/:91) with a prefix-red case that must producelogs/gateway-journal.txt. Without this, every futureenroll-activatered repeats this diagnosis dead-end.journalctl -u cloud-final -u cloud-configplusls -ld /var/lib/cloud/instanceon the gateway. Do not change Nix before readingcloud-final's realExecStarterror.rentedHostNetworking()—restartIfChangedis the wrong knob for a unit that is started, not restarted. A condition such assystemd.services.cloud-final.unitConfig.ConditionPathIsSymbolicLink = "/var/lib/cloud/instance"(orwantedBy = []on a rented converge) lets a genuine first boot run while an already-initialised droplet never re-runs the final stage. Keepnetworking.useNetworkd = trueand the cloud-init.networkfiles intact (GOTCHAS #64/#104/#703, #707'sssh_deletekeys = false).TestRenderGatewayGuest_PublicGatewayKeepsNetworkdAndCloudInit(internal/clan/vmguest_test.go:45-79) is the only test asserting these four lines; extend it to assert the stronger gate. Thengo test ./internal/clan, then a--target devicere-drive to proveenroll-activateclears.Note the drive left gateway
134.199.163.163standing (a device-target red never releases it, ADR 0208), so if it is still inside its lease it can be inspected directly — that is the fastest route to step 2.drive
20260827T082850Zred atenroll-activate:journey leg "enroll-activate" went red: founding: stand up the rented server: clan: masked_exit on gateway: clan reported success but the log shows a real failure: [gateway] Aug 27 08:43:08 idss-gatewevidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260827T082850Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedBlocked —
needs-info: the gatewaycloud-finaljournal is required and cannot be obtained from the sandboxI claimed this and worked it, but the product half cannot be shipped responsibly this iteration — it is waiting on live evidence I have no way to reach. Recording what I found so the next hands don't re-tread it.
Step 1 (the harness blindfold) is already CLOSED
The un-blindfold the ticket asks for in step 1 has already landed in the rehearsal-healer commit
8b34dde("the gateway harvest keyed on a file the RED never writes"):oc_device_evidence(scripts/lib/rehearsal-droplet.sh:1320-1329) now falls back toartifacts/droplet-ip.txtwhenstanding-founded.jsonhas no.ip, and only calls it a quiet skip when both are absent — mirroringsmoke-private-path.sh:681.scripts/tests/device-evidence-order-test.shgained the prefix-red case (verified here:bash scripts/tests/device-evidence-order-test.sh→ OK: 7 checks passed).So every future
enroll-activatered will now harvestlogs/gateway-journal.txt. The blindfold is off. Nothing left to do on step 1.Steps 2–4 (the product fix) are blocked on the gateway journal
The ticket is explicit: "Do not change Nix before reading
cloud-final's real ExecStart error", and "(a) vs (b) is not decidable from this run's evidence." That evidence —journalctl -u cloud-final -u cloud-config+ls -ld /var/lib/cloud/instanceon the gateway134.199.163.163— does not exist:20260827T082850Zpredates the healer fix, so its run dir carries no gateway journal (onlydevice-*.txt, all of the member device).state/rent-operator/id_ed25519, minted into the drive's run dir on matou-workstation — not present here), and outboundtcp/22to134.199.163.163times out. There is no~/.sshand no ambient key the box would accept.A blind re-change to
rentedHostNetworking()(internal/clan/vmguest.go:361-393) is exactly what the ticket forbids — #893's own change to these four lines already "did not hold," and this code is fenced by GOTCHAS #64/#104/#703/#707 (breakingnetworking.useNetworkddarkens the box). I will not guess the gate without the journal.⏳ TIME-SENSITIVE: the failing gateway is STILL STANDING — harvest before it expires
DO API (this account, now) shows the box the drive left standing is alive:
Per ADR 0208 a device-target red never releases it, so the exact
cloud-finalstate that failed can be read directly right now — no fresh (expensive) re-drive needed — from matou-workstation, which holds the rent-operator key:Paste that output onto this issue and re-add
ready-for-agent; the fix then becomes a decidable, seam-pinned change.My lean for whoever picks it up (NOT applied — needs the journal to confirm)
Strong prior on hypothesis (a):
restartIfChanged = falsegates the restart-on-change path only. AType=oneshot/RemainAfterExitcloud-init unit that is newly introduced by the clan generation (relative to what is running on the fresh rented box) is put in switch-to-configuration's start set regardless ofrestartIfChanged, so it runs the final stage over already-initialised state. If confirmed, the robust gate is to stop the units being started on a converge (e.g.wantedBy = lib.mkForce [ ]on the four cloud-init units, since the box's networkd.networkfiles + host keys already persist as/etcruntime files) — keepingnetworking.useNetworkd = trueandssh_deletekeys = falseintact — pinned atTestRenderGatewayGuest_PublicGatewayKeepsNetworkdAndCloudInit(internal/clan/vmguest_test.go:45-79). But the exact gate (awantedBycut vs the ticket'sConditionPathIsSymbolicLink) turns on whatls -ld /var/lib/cloud/instanceactually shows — a symlink vs a reborn directory flips the condition — so the journal must come first.Handing off as
needs-info: the slice is not implementable until the gatewaycloud-finaljournal exists (harvest the standing box above, or let the now-un-blindfolded next drive collect it).needs-infoANSWERED from the live box, under ADR 0174 — un-parked toready-for-agent. Read this before touching Nix: step 3's proposed gate is wrong, and the failure is not ours.Gateway
134.199.163.163was still standing, so I ran exactly the two reads this ticket asked for.1.
ls -ld /var/lib/cloud/instance— the proposed condition would not have workedThe symlink exists and names THIS droplet (
595543878), written at 08:30 on its genuine first boot. SoConditionPathIsSymbolicLink = "/var/lib/cloud/instance"(step 3) is true on a first boot as well as a converge — it would not have suppressed the re-run, and had it been keyed differently it would have skippedcloud-finalon real first boots. Do not land it.Incidental but worth a separate look:
595152509(Aug 25) is a stale instance dir baked into the gateway image — the snapshot was taken from a droplet that had already run cloud-init. Not the cause here.2.
cloud-final's real error — nothing of ours failedThe converge's run is clean:
Eight modules, zero failures, exit 2. Every per-instance module logged
already ran (freq=once-per-instance); the only module withfrequency alwaysisfinal-message. The re-run therefore does no work at all.The exit code comes from the persisted first-boot record,
/var/lib/cloud/data/result.json:Those four are DigitalOcean's own droplet scripts, and they fail because this is NixOS:
00-vpc-peering,install-dotty-agent,machine_id.sh,systemd_automount.share DO vendor/per-instance scripts assuming an FHS distro. They have never worked on our gateways and never will. Note also the version step: first boot ran the image's cloud-init 24.2, the converge runs our Nix 25.2 — the switch replaces cloud-init and re-runs the final stage against aresult.jsonwritten by the older one.So the chain is
DO's scripts fail on NixOS (harmless, first boot, always) → cloud-init records them in
result.json→ the converge re-runscloud-init modules --mode=final, does no work, but exits 2 because that record is non-empty → systemd logsFailed to start Execute cloud user/final scripts→masked_exit(internal/clan/errors.go:124-134) greps"failed to"and reds an activation in which nothing of ours went wrong.clanexiting 0 was correct. The detector is right to be suspicious of that string in general; it is wrong here.Recommended fix — and what NOT to do
cloud-finalre-running on a converge. It provably does nothing (every modulealready ran), so suppressing it loses no behaviour.restartIfChangedis indeed the wrong knob for a unit that is started; the honest gate keys on the converge, not on/var/lib/cloud/instance— e.g.wantedBy = []on the rented converge path, leaving genuine first boot untouched. Keepnetworking.useNetworkd = trueand the cloud-init.networkfiles intact (GOTCHAS #64/#104, #707'sssh_deletekeys = false).SuccessExitStatus=2— that would swallow genuine recoverable errors for the rest of the gateway's life.masked_exitallowlist as the primary fix. If a narrow guard is wanted as belt-and-braces, it should name this unit and this cause, never the"failed to"marker generally.TestRenderGatewayGuest_PublicGatewayKeepsNetworkdAndCloudInit(internal/clan/vmguest_test.go:45-79) to pin whichever gate lands, thengo test ./internal/clan, then a--target devicere-drive.Drive context
20260827T082850Zreached 11 green / 2 red / 0 skip —enroll-copygreen at 726 store paths, so the closure landed and this is activation-side only. The two reds are one fault (standingwrapsenroll-activate). The box is left standing per ADR 0208; it can be reaped once someone has taken whatever else they want from it.swarm-claim host=elitebook-distributed-server-03 run=12748
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #899 — status
success⛔ close-report gates REFUSED this close — the following claims did not verify:
envelope
close-report for #899 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope