Rented rent success reports before SSH is reachable — image-boot reds on Connection refused/timed out (sig a25a6c0aae50) #691
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.
Reference
Matou/idss#691
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
20260823T043642Z, journeyjourney.rented.spec.ts, legimage-bootreds attests/e2e/journey.rented.spec.ts:379:wizard-rent(the rent itself) went green ~5s earlier (artifacts/legs.json:wizard-rent36215ms, thenclaim+create~322ms, thenimage-bootfails 5357ms later) — so the very first SSH probe against the freshly-rented droplet, made only a few seconds after the rent API reported success, got a TCP-level refusal. The backend's own independent connect attempt (the stand-upconnectstage) failed the same way in parallel:logs/founding-state.logrecordsfounding: connect to root@168.144.163.177 over SSH: … Connection refused … check the rented server is up and reachable, then re-drive(fault_resumable: true). Later, the afterAll evidence-gather SSH attempts (logs/droplet-journal.txt,logs/droplet-units.txt,logs/droplet-caddy.txt) all reportConnection timed outinstead ofrefused— consistent with the box being torn down by teardown/reap by the time evidence-gathering ran, not informative about the original state.Root cause layer
A rented droplet is reported as a successful rent (IP handed back,
Accessrecorded, draft advanced) the moment DigitalOcean's API says the droplet isactivewith a public IPv4 — nothing in the chain confirms the guest's network/SSH is actually up before that success propagates:broker/internal/broker/provider_do.go:228-276(pollActive) pollsGET /v2/droplets/<id>untilstatus == "active"andpublicV4(...)is non-empty (lines 260-265). No TCP or SSH probe.broker/internal/broker/rentals.go:168-269(Rentals.Rent) callsprov.Create(line 216) and, on success, immediately persists the lease and returnsRental{IP: srv.IP}(lines 233-268) — trustsCreate's notion of "active" completely.internal/founding/access.go:405-419(RentServer) callsbroker.Rent, recordsAccess{IP}, and advances the draft to Address on success — this is the point that reports "rent succeeded" to the app, with no SSH check.internal/founding/rentedpath.go:156-167callsrentedCarrier.Connect(ctx, ip), implemented atinternal/fleetwire/carrier.go:102-121as onessh …invocation with no retry/backoff for an SSH banner. A failure there becomes aresumableFaulttelling the operator to manually retry — exactly whatfounding-state.logshows in this run.tests/e2e/journey.rented.spec.ts:377) also fires a singlesshDroplet(dropletIP, 'systemctl is-active idss-agent', 30_000)immediately aftercreate, with no polling for reachability first.This is the general hazard
docs/GOTCHAS.mdalready names as #2 ("A readiness gate must test the capability you need, not the nearest thing that returns 0" — gate on an actualSSH-banner, not a status field) — but that discipline was applied to QEMU'sLocalVM.WaitReady(internal/founding/privatepath.go:61-67,879) and never extended to the rented-droplet path.Why I'm filing, not self-fixing
Closing this gap is a design decision, not a mechanical patch: it requires choosing where the readiness gate belongs (block inside the broker's
Rentcall, changing its latency contract under ADR 0047/0100/0189; add bounded retry/backoff to the app'sconnectstep; or just make the e2e probe patient) and picking a timeout budget backed by real DO boot-time data. I can't verify any of those choices against a live droplet from this checkout (the rented box in this run is already destroyed/unreachable by the time the healer runs), so there's no targeted check here that would prove a fix actually closes the race rather than just widening a window.I also can't fully rule out this being a one-off real DigitalOcean-side failure (capacity blip, this specific droplet never booting cleanly) rather than a systemic timing race — prior drives (e.g.
20260823T042838Z) SSH'd into a different rented droplet successfully moments after rent, so the gap doesn't lose every time.What plugging it needs
docs/GOTCHAS.mdin the same commit (the entry currently only covers QEMU/mauke).tests/e2e/journey.rented.spec.ts's image-boot probe to poll rather than single-shot, independent of where the production-side gate lands.drive
20260823T043642Zred atimage-boot:idss-agent is not active on the rented box: systemctl is-active reported "" (ssh: connect to host 168.144.163.177 port 22: Connection refused)evidence:
test-results/…/20260823T043642Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)Ruled by agent under ADR 0174 — veto anytime
Ruling: implement the fix the filer scoped as needing a design decision — where the SSH-readiness gate lives and its retry/backoff/timeout budget (DDR 0192) — plus the two follow-ups the ticket named (a GOTCHAS entry, e2e hardening). This is a two-way door: revertible with a commit (done,
fed89c81), and provable by the newfleetwireunit tests plus the next rented rehearsal drive; it crosses no one-way-door line (no credential, no security-posture widening, no member-facing trust accept, no data destroyed).Why I didn't just relabel
ready-for-human: the filer's own uncertainty was about evidence, not about needing Ben's hands/eyes/judgement on a genuinely irreversible call. I have the same host standing (DIGITALOCEAN_ACCESS_TOKEN,doctl) the filer lacked in their checkout, so I closed the evidence gap myself rather than punting it.What I did to size the fix (not a guess)
Rented a real
idss-gateway-*snapshot on the broker's own image/size/region (syd1,s-2vcpu-4gb) viadoctl, timed from create toactiveto full SSH auth, then destroyed it:doctl compute droplet create --waitreportedactiveat 36s — matching this ticket's ownwizard-renttiming (36215ms) almost exactly.systemctl is-active idss-agentanswered) 8s after that in this trial — but the failing drive's own evidence (the app's parallel independent connect attempt,fault_resumable: true) shows the refusal still live several seconds past the same point in a DIFFERENT trial. The gap is real and variable, not deterministic — confirming the race, not just the symptom.doctl compute droplet delete --force); local known_hosts entry dropped.Decision (DDR 0192) —
docs/adr/0192-design-rented-connect-readiness-retry.mdfleetwire.OwnVPSCarrier.Connectgains a bounded retry (CarrierConfig.ConnectTimeout/ConnectPoll), shaped exactly like the establishedvm.Manager.WaitReady/pollReadyprecedent (GOTCHAS #2's own canonical fix) — "the carrier's Connect facts ARE the probe" (DDR 0191) stays true, no new probe type introduced.Rentals.Rent's latency contract (ADR 0047/0100/0189) is untouched.wiring_prod.go'srented-carriersetsConnectTimeout: 2m, ConnectPoll: 5s;own-vps-carrieris left at zero (single-shot, unchanged) — an operator's own typo'd IP still fails loud on the FIRST probe, never waits out a budget sized for a fresh boot.journey.rented.spec.ts'simage-bootleg fires its OWN direct SSH probe outside the app's Connect path entirely, so the production fix above doesn't reach it — hardened independently with the same poll shape (waitForSSHCommand,app/tests/e2e/fixtures/droplet.ts).docs/GOTCHAS.md#60 records the rented-droplet instance of hazard #2, in the same commit.Proof
fleetwireunit tests (red before green):TestOwnVPSCarrier_ConnectNoTimeoutConfiguredIsSingleAttempt,TestOwnVPSCarrier_ConnectRetriesUntilReadyWhenTimeoutConfigured,TestOwnVPSCarrier_ConnectExhaustsTimeoutFailsLoud— all green.go build ./...,go vet ./...,go test ./internal/fleetwire/... ./internal/founding/... ./broker/... ./app/...— all green.npx tsc --noEmit/npx eslinton the two changed TS files — clean (the two pre-existing, unrelatedAppUpdateSurfaceerrors inbootstrap.ts/appShell.test.tspredate this change).20260823T042838Z, connected fine).Landed
Commit
fed89c81onmain(pushed):STATUS.md,docs/GOTCHAS.md(#60),docs/adr/0192-design-rented-connect-readiness-retry.md,internal/fleetwire/carrier.go(+tests),app/helper/cmd/helper/wiring_prod.go,app/tests/e2e/fixtures/droplet.ts,app/tests/e2e/journey.rented.spec.ts.Advances #691.