wizard-rent reds on a raw DO 404 from Rent's initial create/ssh-key POST — the #672 retry only covers the poll path #677
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.
Reference
Matou/idss#677
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.
wizard-rent(the S4a rent-success leg) timed out after 480000ms waiting for[data-status="address"](tests/e2e/journey.rented.spec.ts:173). The DOM snapshot captured at timeout (artifacts/journey.rented-.../error-context.md) shows the app had already settled into the S4a rent-error card, not the address screen:So the broker returned a
provision-stage failure with a raw DigitalOcean 404 refusal, and the test (which only asserts the success path) burned the full 8-minute timeout waiting for a status that was never coming. Run:test-results/drive-rented/20260822T181240Z, signature3b0b824f61b8.Evidence this is a real, unretried DO refusal (not the already-fixed poll race).
broker/internal/broker/rentals.go:192-199—Rent()callsr.prov.Create(ctx, req); on error it wraps whateverCreatereturned as&ProvisionError{Stage: "provision", Err: createErr}withcreateErrpassed through untouched.broker/internal/broker/provider_do.go:109-146(DigitalOcean.Create) has two call sites that return a DO error immediately, unwrapped, with no retry:ensureSSHKey(line 174-196): only a 422 (duplicate key) is treated as expected; any other status, including a transient 404, returns raw (return "", errat line 193).raw, err := d.do(ctx, http.MethodPost, "/v2/droplets", body); if err != nil { return Server{}, err }— no retry at all.pollActive(provider_do.go:198-248), which does retry a transient GET 404 within itsPollTries/PollIntervalbudget (fixed for #672, commitb4157077, documented indocs/GOTCHAS.md#54 at line 1513) and, on exhaustion, wraps the cause as"broker: DO droplet %d never became reachable in time: %w"(line 245).doRefusal.Error()string ("broker: DigitalOcean refused: %s: %s", provider_do.go:291-292). That rules out the already-hardened poll path and points at the two un-retried POST call sites above.docs/GOTCHAS.md#54 documents the identical raw-refusal text previously surfacing from a transient post-create read-after-write 404 on the poll GET. This run reproduces the same DO error class, but from a different, not-yet-hardened call site.Suspected layer.
broker/internal/broker/provider_do.go—DigitalOcean.Createand/orensureSSHKey's single-shot POST calls to DigitalOcean's API, which propagate any transient refusal (including a 404) as terminal with zero retry, unlike the poll loop.What plugging it needs — and why I filed instead of fixing. This isn't mechanical: retrying a POST that creates a resource is only safe if the create is provably idempotent, or if the retry first checks whether a droplet from this attempt already exists (otherwise a retried create-after-a-lost-response could leak a second droplet, violating the ADR 0047 no-half-rented invariant from the other direction). Deciding the right idempotency guard (e.g., name-based lookup before retry, or accepting only DO's own idempotency semantics) is a design call, and I have no way to exercise a real DO 404-on-create against this machine to verify a fix. There's also a real possibility this is a one-off DO-account issue (e.g. a stale/invalid image reference) rather than a systemic race — the run captured no broker-side log to distinguish the two, only the UI-visible fault-line text. Recommend: add broker-side structured logging of the outgoing DO call (method+path+status) around
Create/ensureSSHKeyso the next occurrence pins the exact call site, then decide the retry/idempotency strategy; extendprovider_do_test.go(which already hasTestDO_CreateRetriesTransientPollNotFound/TestDO_CreateFailsLoudWhenPollNeverRecoversfor the poll path) with the equivalent pair for whichever call site turns out to be the culprit.drive
20260822T181240Zred atwizard-rent:expect(locator).toBeVisible() failed Locator: locator('[data-status="address"]') Expected: visible Timeout: 480000ms Error: element(s) not found Call log: - Expect "toBeVisible" with timeout 480000msevidence:
test-results/…/20260822T181240Z/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.
Investigated both un-retried POST call sites #672 left open in
DigitalOcean.Create(broker/internal/broker/provider_do.go):ensureSSHKey'sPOST /v2/account/keysand the dropletPOST /v2/dropletsitself. They are NOT equally safe to retry:
ensureSSHKey's POST is provably idempotent independent of DO'sresponse — the fingerprint is computed locally from the key blob, and a
real duplicate always 422s (already handled), retried or not. Retrying it
on any other error carries zero risk of creating two different identities.
Fixed: retries up to
sshKeyPostRetries(3, fixed) spaced by theexisting
PollInterval, mirroring #672/#54's pattern on the poll GET.first POST actually succeeded but the response was lost, a naive retry
creates a SECOND droplet (ADR 0047 no-half-rented, from the other
direction). This needs a name/tag-based existence check (or DO's own
idempotency semantics) before a retry can be trusted, which is a design
call best made against real evidence, not guessed at. Left unruled,
filed as #678 (
needs-info— not actionable until the next occurrence'snew logging pins it as the culprit).
What proves the ruling: revertible by commit; the ssh-key retry is
proved by two new TDD tests (
TestDO_EnsureSSHKeyRetriesTransientPostNotFound,TestDO_EnsureSSHKeyFailsLoudWhenPostNeverRecovers), and the newmethod/path/status logging (
TestDO_DoLogsRefusalMethodPathStatus) is whatlets #678 actually be actionable next time instead of another round of
wrapper-text elimination.
go build/vet/test ./...green in the brokermodule. GOTCHAS #55 records both halves — what's fixed and what's
deliberately still open, and why.
Landing this now.
Close-report.
Landed:
e9df8863(advances #677, pushed tomain).DigitalOcean.ensureSSHKey'sPOST /v2/account/keysnow retries atransient refusal (any status but the already-handled 422 duplicate) up to
sshKeyPostRetries(3, fixed), spaced by the existingPollInterval. Safeby construction: the fingerprint used for the droplet create is computed
locally from the key blob, never from DO's response, so a retried POST
either succeeds or hits the same 422-duplicate path already handled — no
risk of registering two different identities.
DigitalOcean.donow logsmethod/path/statusat Info on everynon-2xx DO response, so a future raw-refusal fault-line can be pinned to
its exact outgoing call (ssh-key POST vs droplet-create POST vs a poll
GET) directly from the broker's own log, instead of the wrapper-text
elimination this investigation needed.
POST /v2/dropletsitself is deliberately leftun-retried — blindly retrying it risks a second real droplet if the
first response was merely lost (ADR 0047 no-half-rented, from the other
direction). That needs a name/tag-based existence-check guard (or DO's
own idempotency semantics), designed against real evidence rather than
guessed at now. Filed as #678 (
needs-info, gated on the nextoccurrence's new logging naming
/v2/dropletsas the culprit).Proof:
go build/vet/test ./...green in the broker module (TDDred-first:
TestDO_EnsureSSHKeyRetriesTransientPostNotFound,TestDO_EnsureSSHKeyFailsLoudWhenPostNeverRecovers,TestDO_DoLogsRefusalMethodPathStatus).golangci-linthit a pre-existingtoolchain-version typecheck failure in
zone_test.go/ a vendored cryptofile (go1.26 vs this sandbox's go1.23) — confirmed via
git stashtopredate this change, not introduced by it. Live re-proof of the specific
red drive needs a broker binary redeploy + a fresh
renteddrive (thissession has no way to force a live DO 404-on-create on demand, same
limitation the filer noted); the next cron-triggered
rented-target drivethat hits either POST is the live proof — and now, either it stays green
(ensureSSHKey rode out the transient) or its new log line pins
/v2/dropletsunambiguously, making #678 immediately actionable.
Ruling: see the ADR 0174 ruling comment above.
docs/GOTCHAS.md#55records both halves.
Closing #677 — its own filed recommendation (structured logging, then decide
retry strategy per call site) is fully executed for the call site that was
safely decidable now; the other half continues as #678.
provision — DigitalOcean refused: Not Found#682