self-hosted consent leg: terminal enroll redeem races the relay carrier's own backoff — no readiness handshake between /run/ourcloud/enroll-relay.sock's bind and the dial onto it #599
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#599
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
20260819T214706Z, legconsent, red:the terminal join exited 1with:This is the same error text #597 (
95c428f) fixed once by makinglistenUnixSocket()(agent/cmd/agent/main.go:193-201)MkdirAll/run/ourcloudbefore the agent's first bind. That fix IS present and working here:droplet-journal.txt:1156showsourcloud-agent.servicestarting andmain.go's ownjoin socket listeninglog firing at21:48:27.666Z, proving/run/ourcloudexisted by then. #597's own STATUS.md entry named live-drive reconfirmation as an honest residual (get.idss.nzwas unreachable at fix time) — this run is that reconfirmation, and it surfaces a different, deeper defect the directory fix didn't touch.Root cause: an unsynchronized race between two independent retry loops
ssh -N -Rforward (internal/fleetwire/relay.go:161-190supervise()) only starts once the S7b screen begins polling (internal/founding/selfhostedcarrier.go:107ensureRelay), and retries on a fixed 2s backoff (relay.go:165-168,RelayConfig.Backoff).droplet-journal.txt:1125and:1146show its first two-Rbind attempts failing withunix_listener: cannot bind to path /run/ourcloud/enroll-relay.sock: No such file or directoryat21:48:24and21:48:26— both before the directory existed (created at27.666). Its third attempt wasn't due until~21:48:28, and a freshsshTCP handshake + auth + bind over a real DigitalOcean droplet easily costs several hundred ms.ourcloud-agent enroll <code>command (app/tests/e2e/journey.selfhosted.spec.ts:263-288, invoked immediately after the agent-install leg'ssystemctl is-activecheck passes — i.e. essentially the same instant/run/ourcloudfirst appears) callsRedeem→internal/enrollwire/client.go:53-57, which is a single-shot HTTP POST viaclient.go:94-121do()with no retry and no backoff at all.At
21:48:28.504Zthe terminal's one-shot redeem dialed the box socket before the relay's own backoff-delayed reconnect had finished re-binding it, hitENOENTonce, and the wholeagent enrollprocess exited 1 — no second chance, peragent/cmd/agent/main.go:155-165.Suspected layer / what plugging it needs
This is a design decision, not a mechanical patch — candidates a swarm worker should weigh:
ENOENTcondition (inrunEnroll/RunTerminalor a wrapper around the firstRedeemcall), bounded well insideCEILING.consent(app/tests/e2e/journey.selfhosted.spec.ts:60, which has ample headroom for a few seconds of retry).agent enroll— but the box-side terminal join is device-driven and has no channel back to the app-side carrier today (ADR 0181's whole point is the box has no control plane yet).internal/enrollwire/client.go's genericdo()would affect everyRedeem/Pair/Poll/ConfirmEnrolledcaller, not just this self-hosted relay path — probably too broad; the fix likely belongs closer to the self-hosted terminal join call site.Not self-fixed: this needs a retry/backoff policy decision spanning
agent/cmd/agent,internal/enrollwire, and/orinternal/fleetwire/internal/founding, and the same error signature already resisted one prior fix attempt (#597) — reappearing on exactly the reconfirmation drive that fix called for.drive
20260819T214706Zred atconsent:the terminal join exited N --- transcript --- Warning: Permanently added 'N.N.N.N' (EDN) to the list of known hosts. time=N-N-NTN:N:N.NZ level=ERROR msg="enroll did not reach Pending" component=agent err="enrollwire: POST http://enroll-relay/api/vN/enroll/redeem: Post \"http://enroll-relay/api/vN/enroll/redeem\": di Connection to N.N.N.N closed.evidence:
test-results/…/20260819T214706Z/on matou-workstation (legs.json, droplet-journal.txt, trace)swarm-claim host=matou-dev-server-01 run=7834
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #599 — status
success⛔ close-report gates REFUSED this close — the following claims did not verify:
envelope
close-report for #599 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope