standing: S4a rent dies at the DigitalOcean droplet-create — the just-registered SSH key is not yet visible to the create validator, and the create is the one DO hop with no read-after-write tolerance #1178

Closed
opened 2026-09-03 04:37:54 +00:00 by matou-build-agent · 4 comments

The failure

Drive drive-device/20260903T042240Z (commit 8237a0db, target device) reds at leg standing after 9.5s, and again at the nested wizard-rent. Both carry one fault:

S4a rent was declined in place by the broker (rent-error), never reaching S5 —
provision — broker: DigitalOcean refused: Unprocessable Entity:
{"id":"unprocessable_entity","message":"f3:5d:78:b6:37:3b:1f:a7:f5:f3:27:b4:af:65:a8:46 are invalid key identifiers for Droplet creation."}

artifacts/legs.json, artifacts/verdict.json (firstRedLeg: standing, 0 green / 2 red) and artifacts/journey.device-*/error-context.md all agree. The page snapshot shows the wizard correctly parked at Create · 3 of 5 with a retriable rent-error and a Retry button — the app-side surface behaved exactly as DDR 0190 decision 3 asks; the fault is upstream in the broker.

The rent was raised against the LIVE broker (IDSS_BROKER_URL=https://broker.idss.nz), so the DO calls happen on the broker droplet, not on the executor.

  1. The fingerprint is correct. The app's minted rent-operator key survives at test-results/standing-rented/state/rent-operator/id_ed25519.pub:
    ssh-keygen -l -E md5 → MD5:f3:5d:78:b6:37:3b:1f:a7:f5:f3:27:b4:af:65:a8:46 — byte-for-byte the fingerprint DO refused. sshKeyFingerprint (broker/internal/broker/provider_do.go:616) is computing the right value; this is NOT a fingerprint-format bug.
  2. The key IS on the account. GET /v2/account/keys returns id 59072583, name idss-gateway-rehearsal-e-dac8, fingerprint f3:5d:78:… — the broker's own naming convention from rentals.go:284. So ensureSSHKey's POST (provider_do.go:344-377) genuinely succeeded; it did not fall through its 422-duplicate branch on a phantom.
  3. MD5 fingerprints are still valid identifiers. GET /v2/account/keys/f3:5d:78:… resolves 200 today. And the 2026-08-31 gateway-image build (/home/swarm/swarm/gateway-image-build.log, rc 0) created its build droplet with --ssh-keys <MD5 fingerprint> from scripts/gateway-image/preflight-ssh-key.sh. DO has not deprecated the identifier form.

Suspected layer — the broker's DO provider, at the one un-retried hop

Key registered, identifier valid, create refused. The remaining explanation is read-after-write: at the instant of POST /v2/droplets the droplet-create validator had not yet observed the key ensureSSHKey registered milliseconds earlier.

  • provider_do.go:145 — Create calls ensureSSHKey, gets the locally-computed fingerprint back.
  • provider_do.go:154 — that fingerprint goes straight into "ssh_keys": []string{fp}.
  • provider_do.go:164 — the create POST calls the un-retried d.do, never d.doRetry. That bypass is correct and deliberate (ADR 0047 / #682: a 5xx replay could leak a second box) — but it also means a 422 here is terminal in milliseconds, with no settle window.

This is the same DO read-after-write class the repo has already fixed twice — #677 (isTransientOrUnsettledDO, the key POST's 404 tolerance) and #672 (pollActive's post-create droplet-GET 404). The create's dependency on a just-written account key is the one hop in that family that never got a settle gate; ensureSSHKey returns a fingerprint it has never confirmed DO can resolve.

Fix shape (for the ruling). Gate the create on the write actually being visible: after the key POST, poll GET /v2/account/keys/{fp} (idempotent — rides the existing doRetry/isTransientDO policy, no new retry machinery) until it resolves, then create. Optionally also carry DO's own ssh_key.id out of the POST response body instead of the locally-computed fingerprint — ensureSSHKey currently discards that body entirely — but the numeric id does not by itself dodge the propagation lag, so the confirm-gate is the load-bearing half. Critically, this adds NO retry to the droplet-create POST, so ADR 0047 / #682's fence stays intact.

Side effect to sweep. No droplet leaked (0 droplets tagged idss-gateway; ADR 0047 holds). But account key 59072583 is orphaned: Destroy reaps a key by resolving it from its droplet (provider_do.go:192), and here no droplet ever existed. Same #708 leak family — one stale key per red rent of this shape.

Why the healer refused rather than fixed

Refusal rule 3 (product-behaviour surface). The defect and its fix live in broker/internal/broker/provider_do.go's droplet-create path — literally what a deploy does when it provisions a community's gateway. That is a design decision, not harness plumbing, and it sits directly against the ADR 0047 / #682 fence that deliberately forbids retrying the create POST; anything moving near that boundary deserves a ruling rather than an in-lane heal.

Two independent bars also block a self-fix: the broker is a deployed service at broker.idss.nz, so a commit in this checkout changes nothing until the broker-deploy rail runs (infra state outside this checkout), and there is no targeted check on this machine that can exercise the fix against live DO — go test ./broker/internal/broker runs against an httptest stub, which would pass either way. Healing here would have re-fired the drive straight back into the same red at the cost of another paid stand-up.

Not a flake to paper over. The red is honest and the app-side surface is right; the rent must not proceed on a key the provider cannot resolve. Do not widen the fixture wait or soften the s4aRent fault check in app/tests/e2e/fixtures/wizard.ts:225-233 — the 8-minute race there already did its job, failing fast on the broker's own stage instead of sitting out the address wait (#897).

drive 20260903T042240Z red at standing: S4a rent was declined in place by the broker (rent-error), never reaching S5 — provision — broker: DigitalOcean refused: Unprocessable Entity: {"id":"unprocessable_entity","message":"f3:5d:78:b6:3
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260903T042240Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure Drive `drive-device/20260903T042240Z` (commit `8237a0db`, target `device`) reds at leg `standing` after 9.5s, and again at the nested `wizard-rent`. Both carry one fault: ``` S4a rent was declined in place by the broker (rent-error), never reaching S5 — provision — broker: DigitalOcean refused: Unprocessable Entity: {"id":"unprocessable_entity","message":"f3:5d:78:b6:37:3b:1f:a7:f5:f3:27:b4:af:65:a8:46 are invalid key identifiers for Droplet creation."} ``` `artifacts/legs.json`, `artifacts/verdict.json` (`firstRedLeg: standing`, 0 green / 2 red) and `artifacts/journey.device-*/error-context.md` all agree. The page snapshot shows the wizard correctly parked at `Create · 3 of 5` with a retriable `rent-error` and a Retry button — the app-side surface behaved exactly as DDR 0190 decision 3 asks; the fault is upstream in the broker. The rent was raised against the LIVE broker (`IDSS_BROKER_URL=https://broker.idss.nz`), so the DO calls happen on the broker droplet, not on the executor. ## Evidence — all three links checked against the live account 1. **The fingerprint is correct.** The app's minted rent-operator key survives at `test-results/standing-rented/state/rent-operator/id_ed25519.pub`: `ssh-keygen -l -E md5` → `MD5:f3:5d:78:b6:37:3b:1f:a7:f5:f3:27:b4:af:65:a8:46` — byte-for-byte the fingerprint DO refused. `sshKeyFingerprint` (`broker/internal/broker/provider_do.go:616`) is computing the right value; this is NOT a fingerprint-format bug. 2. **The key IS on the account.** `GET /v2/account/keys` returns `id 59072583`, `name idss-gateway-rehearsal-e-dac8`, `fingerprint f3:5d:78:…` — the broker's own naming convention from `rentals.go:284`. So `ensureSSHKey`'s POST (`provider_do.go:344-377`) genuinely succeeded; it did not fall through its 422-duplicate branch on a phantom. 3. **MD5 fingerprints are still valid identifiers.** `GET /v2/account/keys/f3:5d:78:…` resolves 200 today. And the 2026-08-31 gateway-image build (`/home/swarm/swarm/gateway-image-build.log`, rc 0) created its build droplet with `--ssh-keys <MD5 fingerprint>` from `scripts/gateway-image/preflight-ssh-key.sh`. DO has not deprecated the identifier form. ## Suspected layer — the broker's DO provider, at the one un-retried hop Key registered, identifier valid, create refused. The remaining explanation is read-after-write: at the instant of `POST /v2/droplets` the droplet-create validator had not yet observed the key `ensureSSHKey` registered milliseconds earlier. - `provider_do.go:145` — `Create` calls `ensureSSHKey`, gets the locally-computed fingerprint back. - `provider_do.go:154` — that fingerprint goes straight into `"ssh_keys": []string{fp}`. - `provider_do.go:164` — the create POST calls the **un-retried** `d.do`, never `d.doRetry`. That bypass is correct and deliberate (ADR 0047 / #682: a 5xx replay could leak a second box) — but it also means a 422 here is terminal in milliseconds, with no settle window. This is the same DO read-after-write class the repo has already fixed twice — #677 (`isTransientOrUnsettledDO`, the key POST's 404 tolerance) and #672 (`pollActive`'s post-create droplet-GET 404). The create's *dependency* on a just-written account key is the one hop in that family that never got a settle gate; `ensureSSHKey` returns a fingerprint it has never confirmed DO can resolve. **Fix shape (for the ruling).** Gate the create on the write actually being visible: after the key POST, poll `GET /v2/account/keys/{fp}` (idempotent — rides the existing `doRetry`/`isTransientDO` policy, no new retry machinery) until it resolves, then create. Optionally also carry DO's own `ssh_key.id` out of the POST response body instead of the locally-computed fingerprint — `ensureSSHKey` currently discards that body entirely — but the numeric id does not by itself dodge the propagation lag, so the confirm-gate is the load-bearing half. Critically, this adds NO retry to the droplet-create POST, so ADR 0047 / #682's fence stays intact. **Side effect to sweep.** No droplet leaked (0 droplets tagged `idss-gateway`; ADR 0047 holds). But account key `59072583` is orphaned: `Destroy` reaps a key by resolving it from its droplet (`provider_do.go:192`), and here no droplet ever existed. Same #708 leak family — one stale key per red rent of this shape. ## Why the healer refused rather than fixed **Refusal rule 3 (product-behaviour surface).** The defect and its fix live in `broker/internal/broker/provider_do.go`'s droplet-create path — literally what a deploy does when it provisions a community's gateway. That is a design decision, not harness plumbing, and it sits directly against the ADR 0047 / #682 fence that deliberately forbids retrying the create POST; anything moving near that boundary deserves a ruling rather than an in-lane heal. Two independent bars also block a self-fix: the broker is a **deployed service** at `broker.idss.nz`, so a commit in this checkout changes nothing until the `broker-deploy` rail runs (infra state outside this checkout), and there is no targeted check on this machine that can exercise the fix against live DO — `go test ./broker/internal/broker` runs against an `httptest` stub, which would pass either way. Healing here would have re-fired the drive straight back into the same red at the cost of another paid stand-up. **Not a flake to paper over.** The red is honest and the app-side surface is right; the rent must not proceed on a key the provider cannot resolve. Do not widen the fixture wait or soften the `s4aRent` fault check in `app/tests/e2e/fixtures/wizard.ts:225-233` — the 8-minute race there already did its job, failing fast on the broker's own stage instead of sitting out the address wait (#897). drive `20260903T042240Z` red at `standing`: `S4a rent was declined in place by the broker (rent-error), never reaching S5 — provision — broker: DigitalOcean refused: Unprocessable Entity: {"id":"unprocessable_entity","message":"f3:5d:78:b6:3` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260903T042240Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 25304f657c24 -->
Owner

Ruled by session under ADR 0174 — veto anytime. The fix shape this ticket proposed is adopted verbatim and LANDED: 0fc29770.

The ruling: ensureSSHKey confirm-gates BOTH its return paths (fresh registration and the 422-duplicate branch) on GET /v2/account/keys/{fp} resolving, riding the existing doRetry/isTransientOrUnsettledDO policy. The droplet-create POST gains NO retry — the ADR 0047/#682 fence is untouched, and TestDO_CreatePostIsNeverRetried still proves it. Two-way: revertible, same family as the #677/#672 precedents. The duplicate branch is gated too because a released rental's owed reap (#756) can delete the very key the duplicate 422 vouched for — this drive's own probable variant.

New pins: create waits out the lag and still POSTs exactly once; a never-resolvable key fails LOUD naming it with ZERO droplet POSTs (the can-fire half); the duplicate path confirm-gates. Broker suite green; gofmt + go vet clean.

Deploy: the fix is not live until the deploy-broker rail installs it on the mail droplet (GOTCHAS: a broker change is not live until broker-deploy ran). This session is watching the installed binary's mtime and will close this ticket only once the live broker carries 0fc29770 — the drive re-fires on that close.

Orphan key 59072583 (idss-gateway-rehearsal-e-dac8): deliberately NOT deleted yet — the surviving standing-rented/state/rent-operator key means the re-drive's rent may 422-dup against it and now resolve through the gate. Sweep it once the phase-7 drive is past the rent (the #708 leak family, one stale key per red rent of this shape).

**Ruled by session under ADR 0174 — veto anytime.** The fix shape this ticket proposed is adopted verbatim and LANDED: `0fc29770`. **The ruling:** `ensureSSHKey` confirm-gates BOTH its return paths (fresh registration and the 422-duplicate branch) on `GET /v2/account/keys/{fp}` resolving, riding the existing `doRetry`/`isTransientOrUnsettledDO` policy. The droplet-create POST gains NO retry — the ADR 0047/#682 fence is untouched, and `TestDO_CreatePostIsNeverRetried` still proves it. Two-way: revertible, same family as the #677/#672 precedents. The duplicate branch is gated too because a released rental's owed reap (#756) can delete the very key the duplicate 422 vouched for — this drive's own probable variant. **New pins:** create waits out the lag and still POSTs exactly once; a never-resolvable key fails LOUD naming it with ZERO droplet POSTs (the can-fire half); the duplicate path confirm-gates. Broker suite green; gofmt + go vet clean. **Deploy:** the fix is not live until the `deploy-broker` rail installs it on the mail droplet (GOTCHAS: a broker change is not live until broker-deploy ran). This session is watching the installed binary's mtime and will close this ticket only once the live broker carries `0fc29770` — the drive re-fires on that close. **Orphan key 59072583** (`idss-gateway-rehearsal-e-dac8`): deliberately NOT deleted yet — the surviving `standing-rented/state/rent-operator` key means the re-drive's rent may 422-dup against it and now resolve through the gate. Sweep it once the phase-7 drive is past the rent (the #708 leak family, one stale key per red rent of this shape).
Author
Member

session-runner: two unattended attempts did not advance this ticket — labelled agent-blocked for a human look (ADR 0174 escalation). Latest session log: /home/swarm/.local/state/matou-session-runner-Matou-idss/logs/run-1178-20260903T064511Z.log on the workstation. Remove agent-blocked (and the stale fail counter if re-arming by hand) to let the runner retry.

session-runner: two unattended attempts did not advance this ticket — labelled `agent-blocked` for a human look (ADR 0174 escalation). Latest session log: `/home/swarm/.local/state/matou-session-runner-Matou-idss/logs/run-1178-20260903T064511Z.log` on the workstation. Remove `agent-blocked` (and the stale fail counter if re-arming by hand) to let the runner retry.
Author
Member

session-runner: two unattended attempts did not advance this ticket — labelled agent-blocked for a human look (ADR 0174 escalation). Latest session log: /home/dev/.local/state/matou-session-runner-Matou-idss/logs/run-1178-20260903T070012Z.log on the workstation. Remove agent-blocked (and the stale fail counter if re-arming by hand) to let the runner retry.

session-runner: two unattended attempts did not advance this ticket — labelled `agent-blocked` for a human look (ADR 0174 escalation). Latest session log: `/home/dev/.local/state/matou-session-runner-Matou-idss/logs/run-1178-20260903T070012Z.log` on the workstation. Remove `agent-blocked` (and the stale fail counter if re-arming by hand) to let the runner retry.
Owner

DEPLOY VERIFIED — closing; the drive re-fires on this close.

Live check on the mail droplet 2026-09-03: /usr/local/bin/ourcloud-broker mtime 07:31:23Z, ourcloud-broker.sha = eb3f630c — and git merge-base --is-ancestor 0fc29770 eb3f630c holds, so the running binary CARRIES the confirm gate (served-bits-vs-main discipline, never trusting the mtime alone). ourcloud-broker.service active; /v1/gateways/offer answering.

Credit where due: this deploy was stranded twice by the CI seam and was walked home by the swarm — #1180/#1182 greened the seam, two re-triggers (3daafbdc, eb488739), and #1183 raised the auto-deploy walk horizon so a far-back orphaned broker fix self-heals in future.

Remaining sweep (not blocking): orphan account key 59072583 (idss-gateway-rehearsal-e-dac8) — delete once the phase-7 drive is past the rent.

**DEPLOY VERIFIED — closing; the drive re-fires on this close.** Live check on the mail droplet 2026-09-03: `/usr/local/bin/ourcloud-broker` mtime 07:31:23Z, `ourcloud-broker.sha` = `eb3f630c` — and `git merge-base --is-ancestor 0fc29770 eb3f630c` holds, so the running binary CARRIES the confirm gate (served-bits-vs-main discipline, never trusting the mtime alone). `ourcloud-broker.service` active; /v1/gateways/offer answering. Credit where due: this deploy was stranded twice by the CI seam and was walked home by the swarm — #1180/#1182 greened the seam, two re-triggers (3daafbdc, eb488739), and #1183 raised the auto-deploy walk horizon so a far-back orphaned broker fix self-heals in future. Remaining sweep (not blocking): orphan account key 59072583 (`idss-gateway-rehearsal-e-dac8`) — delete once the phase-7 drive is past the rent.
ben closed this issue 2026-09-03 14:35:15 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1178
No description provided.