activation: gateway deploy red — both TLS doors never answer, DNS-01 delegation absent #905

Closed
opened 2026-08-27 16:09:55 +00:00 by matou-build-agent · 4 comments

The failure

artifacts/verdict.json — "verdict": "red", "firstRedLeg": "standing", {"total": 17, "green": 15, "red": 2, "skip": 0}. standing is the wrapper; the leg that actually burned is activation, 648 s:

{ "leg": "activation", "status": "red", "ms": 648090,
  "error": "the gateway deploy failed — The gateway deploy failed. [There is no old
             operating system to roll back to — this server was rented fresh …]" }

This is not the KNOWN frontier. artifacts/legs.json records "skip": 0 and carries no skip reasons at all, and pairing did flip — {"leg": "pair", "status": "green", "ms": 96}, corroborated by logs/founding-state.log:817: "paired — the community name was aimed at the server before install, so the public reachability check is skipped; the gateway deploy begins". The own-VPS carrier issue is not what killed this drive.

The deploy reached the last door and only that one. logs/founding-state.log:64-95 — five of six steps done:

{ "id": "public-entry", "label": "Public entry — secure connections live", "status": "failed" }

The evidence

1. Neither door ever answered, and neither ever came close. logs/founding-state.log:143–615, 119 logged probes, all identical in shape:

"[id.rehearsal-c.idss.nz rehearsal-c.idss.nz] not answering yet (probe 119/120) — re-probing in 5s (Caddy still gated behind acme-dns registration / issuance, #499, #524)"

Checked in this run dir: grep -c 'not answering yet' = 119; the count of those lines lacking the two-name pending set is 0. The pending set never shrank by a single name across the whole ~600 s budget.

2. The app blames a budget, offers a retry, and ships kind literally unknown. logs/founding-state.log:633-638:

"kind": "unknown",
"headline": "The gateway deploy failed.",
"detail": "https://id.rehearsal-c.idss.nz did not answer over TLS within the first-boot
           cold-start budget — acme-dns registration and DNS-01 issuance gate Caddy's
           :443 listener, and the apex is a SEPARATE order that can lag the wildcard's
           (GOTCHAS #15, ADR 0014, #524); resume the deploy to re-probe once it settles"

The apex-lags-wildcard story needs one name to answer before the other. Neither did. The UI surfaces exactly this (artifacts/journey.…/error-context.md: "The gateway deploy failed." + Resume the deploy / Reinstall the agent / Rescue boot).

3. The box was alive throughout; only the door was shut. logs/gateway-do-forensics.txt — droplet 595628182 / idss-gateway-rehearsal-c-fe92, status: active, a single create action and nothing else (no DO-side power_cycle/resize), 0% packet loss, and tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did.

What is absent

  • No live-box section was appended to this diagnosis. I was given no access line, and this session's sandbox refused an authoritative dig, an outbound curl to the public entry, and every read outside the run directory (including git). I could not independently re-verify the zone, the live gateway, or any in-repo claim below. Diagnosis below is from harvested logs.

  • logs/droplet-journal.txt does not exist. This drive writes logs/device-journal.txt (the clan-lab device box, 134.199.162.122) and logs/gateway-journal.txt instead.

  • All four gateway captures are blind. gateway-journal.txt, -units.txt, -stall.txt, -caddy.txt are the same two lines:

    root@168.144.172.20: Permission denied (publickey,keyboard-interactive).
    note: gateway evidence gather failed (gateway unreachable?)

    Against tcp/22: a FRESH connect succeeded in the same run's own forensics, "unreachable?" is a misread: the harvest dialled root@<ip> with no identity, and the rented gateway trusts only the app's rent-operator key — the enrollment blob at the tail of logs/founding-state.log names it test-results/standing-rented/state/rent-operator/id_ed25519. The drive kept zero evidence off the one box that failed.

  • logs/broker-journal.txt — dev@100.98.48.68: Permission denied (publickey); off the admin mesh from this executor, absent by design (ADR 0208, #681). The broker is the prime suspect and its journal is precisely what is missing.

  • artifacts/journey.json is {"rows": null, "fault": null} — the device-add journey never reached its founding rows, as expected when standing reds.

  • logs/state-logs.log — ENOENT … test-results/standing-rented/state/logs. logs/qemu.log and logs/guest-*.log are empty by design ("the guest was never created"); this drive rents a DO gateway, no local guest. logs/helper.log is 0 bytes.

  • logs/device-units.txt shows the device box is bare Ubuntu — only sshd and systemd-resolve listening, nginx/phpfpm-nextcloud "could not be found", --failed empty, uptime 1:06 with no reboot. Consistent with the run dying before device-add, not a second fault.

Suspected layer — infra (the live broker), with a product tail

The only live-box reading in this run dir is logs/healer-claude.out, a prior healer agent's harvest off the still-standing gateway using the rent-operator key. I relay it as that agent's claim; I could confirm none of it. It reports:

  • acme-dns came up clean and wrote its per-boot fulldomain 07feca20-5f4c-4c51-a570-24c0f7fc4c70.acme.rehearsal-c.idss.nz at 14:58:36.388Z; the control plane re-pointed 1.6 s later (14:58:37.991Z, address heartbeat: gateway address changed, community record re-pointed ip=168.144.172.20) — so the challenge value existed and was carried.
  • The zone never got the delegation. Authoritative dig @andy.ns.cloudflare.com: _acme-challenge.rehearsal-c.idss.nz CNAME rehearsal-c.idss.nz. — the apex, not the fulldomain; acme.rehearsal-c.idss.nz NS NODATA; no glue A. Only the two challenge-independent records of PutRecords' five-record set are live, and the challenge CNAME that is live names the wrong target.
  • acme-dns-gate at 15:03:40 said so out loud: "_acme-challenge.rehearsal-c.idss.nz never resolved to 07feca20-… on all of [1.1.1.1 8.8.8.8] within budget — releasing Caddy anyway (fail-open)".
  • Caddy then failed as it must: 7 × tls.obtain … timed out waiting for record to fully propagate, for both *.rehearsal-c.idss.nz and rehearsal-c.idss.nz, still retrying (attempt: 7, elapsed: 2651s) long after the drive gave up.
  • Same host, second fault: /v1/gateways/renew returned 502 on all 11 passes, 14:58:39Z → 15:53:40Z — DigitalOcean refused: Forbidden … You are not authorized to perform this operation. The rented lease is therefore never renewed.

If that harvest holds, this is the dead end GOTCHAS #28 was opened for, whose own deploy gate reads: the LIVE broker runs from /usr/local/bin/idss-broker and a repo landing does not change it — it must be rebuilt and redeployed before any drive can green. A larger door budget cannot fix this, and "Resume the deploy" would burn wall-clock forever.

What I can verify in the run dir is consistent with that and inconsistent with the app's own stated theory: both names pending across all 119 probes rules out apex-lags-wildcard.

What plugging it needs

  1. On the broker host (dev@100.98.48.68, ourcloud-broker.service, off-mesh from this executor): identify which build /usr/local/bin/idss-broker is, and read its journal for 14:58:37Z — whether the point request arrived with AcmeChallenge non-empty is the one check that splits stale build from challenge dropped in transit. Rebuild and redeploy at the #508 five-record PutRecords if stale.
  2. Overwrite, don't skip. _acme-challenge.rehearsal-c is a live wrong-target CNAME, not a missing record — whatever writes the set must replace it.
  3. Repair the DigitalOcean token's authorization for the rental expiry-tag move (/v1/gateways/renew → 403 Forbidden).
  4. Re-check the zone before the next device drive: the five-record set live, with _acme-challenge.<slug> naming the gateway's per-boot acme-dns fulldomain.
  5. Product tail, in-repo and independently actionable: the deploy failure ships "kind": "unknown" with text blaming a cold-start budget (founding-state.log:637) while acme-dns-gate already knew the truth at 15:03:40. Feed the gate's fail-open verdict into the deploy fault so it names the missing delegation, and so "Resume the deploy" is not the advice offered against a dead delegation.
  6. Harness: logs/healer-claude.out claims commit 8f5ae592 gives the gateway harvest the rent-operator identity. I could not run git to confirm it is on the branch drives run from — verify it, or the next red is blind in exactly the same place and "gateway unreachable?" will again contradict tcp/22: a FRESH connect succeeded in the same run dir.

drive 20260827T144343Z red at activation: the gateway deploy failed — The gateway deploy failed. [There is no old operating system to roll back to — this server was rented fresh for the community, so nothing of yours was overwritten.]
evidence: /home/swarm/swarm/Matou/idss/test-results/drive-device/20260827T144343Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure `artifacts/verdict.json` — `"verdict": "red"`, `"firstRedLeg": "standing"`, `{"total": 17, "green": 15, "red": 2, "skip": 0}`. `standing` is the wrapper; the leg that actually burned is `activation`, 648 s: ``` { "leg": "activation", "status": "red", "ms": 648090, "error": "the gateway deploy failed — The gateway deploy failed. [There is no old operating system to roll back to — this server was rented fresh …]" } ``` **This is not the KNOWN frontier.** `artifacts/legs.json` records `"skip": 0` and carries no skip reasons at all, and pairing *did* flip — `{"leg": "pair", "status": "green", "ms": 96}`, corroborated by `logs/founding-state.log:817`: *"paired — the community name was aimed at the server before install, so the public reachability check is skipped; the gateway deploy begins"*. The own-VPS carrier issue is not what killed this drive. The deploy reached the last door and only that one. `logs/founding-state.log:64-95` — five of six steps `done`: ``` { "id": "public-entry", "label": "Public entry — secure connections live", "status": "failed" } ``` ## The evidence **1. Neither door ever answered, and neither ever came close.** `logs/founding-state.log:143`–`615`, 119 logged probes, all identical in shape: > `"[id.rehearsal-c.idss.nz rehearsal-c.idss.nz] not answering yet (probe 119/120) — re-probing in 5s (Caddy still gated behind acme-dns registration / issuance, #499, #524)"` Checked in this run dir: `grep -c 'not answering yet'` = **119**; the count of those lines *lacking* the two-name pending set is **0**. The pending set never shrank by a single name across the whole ~600 s budget. **2. The app blames a budget, offers a retry, and ships `kind` literally unknown.** `logs/founding-state.log:633-638`: ``` "kind": "unknown", "headline": "The gateway deploy failed.", "detail": "https://id.rehearsal-c.idss.nz did not answer over TLS within the first-boot cold-start budget — acme-dns registration and DNS-01 issuance gate Caddy's :443 listener, and the apex is a SEPARATE order that can lag the wildcard's (GOTCHAS #15, ADR 0014, #524); resume the deploy to re-probe once it settles" ``` The apex-lags-wildcard story needs one name to answer before the other. Neither did. The UI surfaces exactly this (`artifacts/journey.…/error-context.md`: *"The gateway deploy failed."* + **Resume the deploy** / **Reinstall the agent** / **Rescue boot**). **3. The box was alive throughout; only the door was shut.** `logs/gateway-do-forensics.txt` — droplet `595628182` / `idss-gateway-rehearsal-c-fe92`, `status: active`, a single `create` action and nothing else (no DO-side power_cycle/resize), `0% packet loss`, and `tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did`. ## What is absent - **No live-box section was appended to this diagnosis.** I was given no access line, and this session's sandbox refused an authoritative `dig`, an outbound `curl` to the public entry, and every read outside the run directory (including `git`). I could not independently re-verify the zone, the live gateway, or any in-repo claim below. Diagnosis below is from harvested logs. - **`logs/droplet-journal.txt` does not exist.** This drive writes `logs/device-journal.txt` (the clan-lab device box, 134.199.162.122) and `logs/gateway-journal.txt` instead. - **All four gateway captures are blind.** `gateway-journal.txt`, `-units.txt`, `-stall.txt`, `-caddy.txt` are the same two lines: > `root@168.144.172.20: Permission denied (publickey,keyboard-interactive).` > `note: gateway evidence gather failed (gateway unreachable?)` Against `tcp/22: a FRESH connect succeeded` in the same run's own forensics, "unreachable?" is a misread: the harvest dialled `root@<ip>` with **no identity**, and the rented gateway trusts only the app's rent-operator key — the enrollment blob at the tail of `logs/founding-state.log` names it `test-results/standing-rented/state/rent-operator/id_ed25519`. **The drive kept zero evidence off the one box that failed.** - **`logs/broker-journal.txt`** — `dev@100.98.48.68: Permission denied (publickey)`; off the admin mesh from this executor, absent by design (ADR 0208, #681). The broker is the prime suspect and its journal is precisely what is missing. - `artifacts/journey.json` is `{"rows": null, "fault": null}` — the device-add journey never reached its founding rows, as expected when `standing` reds. - `logs/state-logs.log` — `ENOENT … test-results/standing-rented/state/logs`. `logs/qemu.log` and `logs/guest-*.log` are empty by design (*"the guest was never created"*); this drive rents a DO gateway, no local guest. `logs/helper.log` is 0 bytes. - `logs/device-units.txt` shows the *device* box is bare Ubuntu — only `sshd` and `systemd-resolve` listening, `nginx`/`phpfpm-nextcloud` "could not be found", `--failed` empty, uptime 1:06 with no reboot. Consistent with the run dying before device-add, not a second fault. ## Suspected layer — infra (the live broker), with a product tail The only live-box reading in this run dir is `logs/healer-claude.out`, a prior healer agent's harvest off the still-standing gateway using the rent-operator key. **I relay it as that agent's claim; I could confirm none of it.** It reports: - acme-dns came up clean and wrote its per-boot fulldomain `07feca20-5f4c-4c51-a570-24c0f7fc4c70.acme.rehearsal-c.idss.nz` at **14:58:36.388Z**; the control plane re-pointed **1.6 s later** (`14:58:37.991Z`, `address heartbeat: gateway address changed, community record re-pointed ip=168.144.172.20`) — so the challenge value existed and was carried. - The zone never got the delegation. Authoritative `dig @andy.ns.cloudflare.com`: `_acme-challenge.rehearsal-c.idss.nz CNAME rehearsal-c.idss.nz.` — the **apex**, not the fulldomain; `acme.rehearsal-c.idss.nz NS` NODATA; no glue A. Only the two challenge-independent records of `PutRecords`' five-record set are live, and the challenge CNAME that *is* live names the wrong target. - `acme-dns-gate` at `15:03:40` said so out loud: *"`_acme-challenge.rehearsal-c.idss.nz` never resolved to `07feca20-…` on all of [1.1.1.1 8.8.8.8] within budget — releasing Caddy anyway (fail-open)"*. - Caddy then failed as it must: 7 × `tls.obtain … timed out waiting for record to fully propagate`, for **both** `*.rehearsal-c.idss.nz` and `rehearsal-c.idss.nz`, still retrying (`attempt: 7`, `elapsed: 2651s`) long after the drive gave up. - Same host, second fault: `/v1/gateways/renew` returned 502 on **all 11** passes, 14:58:39Z → 15:53:40Z — `DigitalOcean refused: Forbidden … You are not authorized to perform this operation`. The rented lease is therefore never renewed. If that harvest holds, this is the dead end **GOTCHAS #28** was opened for, whose own deploy gate reads: the LIVE broker runs from `/usr/local/bin/idss-broker` and a repo landing does not change it — it must be rebuilt and redeployed before any drive can green. **A larger door budget cannot fix this**, and "Resume the deploy" would burn wall-clock forever. What I *can* verify in the run dir is consistent with that and inconsistent with the app's own stated theory: both names pending across all 119 probes rules out apex-lags-wildcard. ## What plugging it needs 1. **On the broker host** (`dev@100.98.48.68`, `ourcloud-broker.service`, off-mesh from this executor): identify which build `/usr/local/bin/idss-broker` is, and read its journal for `14:58:37Z` — whether the point request arrived with `AcmeChallenge` non-empty is the one check that splits *stale build* from *challenge dropped in transit*. Rebuild and redeploy at the #508 five-record `PutRecords` if stale. 2. **Overwrite, don't skip.** `_acme-challenge.rehearsal-c` is a live *wrong-target* CNAME, not a missing record — whatever writes the set must replace it. 3. **Repair the DigitalOcean token's authorization** for the rental expiry-tag move (`/v1/gateways/renew` → 403 Forbidden). 4. **Re-check the zone before the next device drive:** the five-record set live, with `_acme-challenge.<slug>` naming the gateway's per-boot acme-dns fulldomain. 5. **Product tail, in-repo and independently actionable:** the deploy failure ships `"kind": "unknown"` with text blaming a cold-start budget (`founding-state.log:637`) while `acme-dns-gate` already knew the truth at `15:03:40`. Feed the gate's fail-open verdict into the deploy fault so it names the missing delegation, and so "Resume the deploy" is not the advice offered against a dead delegation. 6. **Harness:** `logs/healer-claude.out` claims commit `8f5ae592` gives the gateway harvest the rent-operator identity. I could not run `git` to confirm it is on the branch drives run from — verify it, or the next red is blind in exactly the same place and "gateway unreachable?" will again contradict `tcp/22: a FRESH connect succeeded` in the same run dir. drive `20260827T144343Z` red at `activation`: `the gateway deploy failed — The gateway deploy failed. [There is no old operating system to roll back to — this server was rented fresh for the community, so nothing of yours was overwritten.]` evidence: `/home/swarm/swarm/Matou/idss/test-results/drive-device/20260827T144343Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 4c82deb1e678 -->
Author
Member

Product tail landed; deploy-green root cause handed to a human

Landed on origin/main (commit 1ae38ba, sandcastle: #905 (product tail)):
the in-repo, independently-actionable item — point 5 of the diagnosis.

The deploy fault the drive shipped read kind:"unknown", blamed the first-boot
cold-start budget, invoked the apex-lags-wildcard story, and offered Resume the
deploy
as the lead recovery — against a run where both names stayed pending
across all 119 probes. The apex-lags story needs one door live; when no door
ever answers the cause is an absent/wrong _acme-challenge.<apex> delegation
Caddy's :443 waits on forever, and a resume only re-probes it into the same dead
end. Fixed at the seam (internal/founding/deploy.go):

  • probeDoorsLive now reports anyLive;
  • deadDoorFailure splits the two shapes — one door live → the existing
    FailUnknown cold-start lag (resume-first, unchanged); no door live → the
    new clan.FailDelegation kind, a fault that names the missing delegation
    (GOTCHAS #27/#28, ADR 0014, #508/#554) with no self-settling-cold-start language;
  • buildDeployFailure demotes Resume the deploy out of the lead for a
    delegation fault and rewords it (still offered, for after the delegation is
    repaired off-box).

Regression tests: the all-doors-dead case asserts kind=delegation, a
delegation-naming detail, no "settles" language, and resume demoted; the apex-lag
case asserts it stays FailUnknown with resume the lead. go build/vet/test ./internal/founding/... ./internal/clan/... green; the pinned golangci-lint run ./... gate green.

Why human

The deploy itself is still red and that root cause is not in-repo. The
repo's broker/internal/broker/zone.go PutRecords already writes the correct
five-record set (_acme-challenge.<slug> CNAME at the acme-dns fulldomain plus
the acme.<slug> NS + glue A) — this is GOTCHAS #28. What remains is the standing
deploy gate of GOTCHAS #28 plus the DO tail, both off-mesh from any sandcastle
executor (ADR 0208, #681), and one of them a credential/security-posture change I
cannot rule or prove with a test:

  1. Rebuild + redeploy the LIVE broker. /usr/local/bin/idss-broker on the
    broker host (dev@100.98.48.68, ourcloud-broker.service) is what actually
    writes the zone; a repo landing does not change it (GOTCHAS #28 deploy gate,
    #508). Confirm which build it is, read its journal at the point request
    (14:58:37Z on the harvested drive — was AcmeChallenge non-empty?), and
    redeploy at the five-record PutRecords. Overwrite, don't skip:
    _acme-challenge.<slug> is a live wrong-target CNAME (→ apex), not a missing
    record.
  2. Repair the DigitalOcean token's authorization for the rental expiry-tag move
    — /v1/gateways/renew returned 403 Forbidden on all 11 passes. This is a
    credential/security-posture change on production infra (one-way door).
  3. Re-check the zone before the next device drive: the five-record set live,
    with _acme-challenge.<slug> naming the gateway's per-boot acme-dns fulldomain.

Re-arm with ready-for-agent once the broker + zone + token are healed and a drive
can reach the gateway's public doors.


Housekeeping: the same push also landed sandcastle: unblock the shared Go push gate (commit 2d4b114) — #788's IDIP arc (internal/keria, internal/keriawire,
internal/idp, internal/keriauth) had landed via session pushes that skip the
sandcastle pre-push gate, leaving origin/main lint-red on 11 revive/errcheck
findings and refusing every sandcastle worker's Go push. Purely mechanical
lint-green fixes (doc comments, _ = resp.Body.Close(), unused-param rename); no
#788 behaviour changed.

## Product tail landed; deploy-green root cause handed to a human **Landed on `origin/main`** (commit `1ae38ba`, `sandcastle: #905 (product tail)`): the in-repo, independently-actionable item — point 5 of the diagnosis. The deploy fault the drive shipped read `kind:"unknown"`, blamed the first-boot cold-start budget, invoked the apex-lags-wildcard story, and offered **Resume the deploy** as the lead recovery — against a run where **both** names stayed pending across all 119 probes. The apex-lags story needs *one* door live; when *no* door ever answers the cause is an absent/wrong `_acme-challenge.<apex>` delegation Caddy's `:443` waits on forever, and a resume only re-probes it into the same dead end. Fixed at the seam (`internal/founding/deploy.go`): - `probeDoorsLive` now reports `anyLive`; - `deadDoorFailure` splits the two shapes — one door live → the existing `FailUnknown` cold-start lag (resume-first, unchanged); **no** door live → the new `clan.FailDelegation` kind, a fault that **names the missing delegation** (GOTCHAS #27/#28, ADR 0014, #508/#554) with no self-settling-cold-start language; - `buildDeployFailure` demotes **Resume the deploy** out of the lead for a delegation fault and rewords it (still offered, for *after* the delegation is repaired off-box). Regression tests: the all-doors-dead case asserts `kind=delegation`, a delegation-naming detail, no "settles" language, and resume demoted; the apex-lag case asserts it stays `FailUnknown` with resume the lead. `go build/vet/test ./internal/founding/... ./internal/clan/...` green; the pinned `golangci-lint run ./...` gate green. ## Why human The **deploy itself is still red** and that root cause is **not in-repo**. The repo's `broker/internal/broker/zone.go` `PutRecords` already writes the correct five-record set (`_acme-challenge.<slug>` CNAME at the acme-dns fulldomain **plus** the `acme.<slug>` NS + glue A) — this is GOTCHAS #28. What remains is the standing **deploy gate** of GOTCHAS #28 plus the DO tail, both off-mesh from any sandcastle executor (ADR 0208, #681), and one of them a credential/security-posture change I cannot rule or prove with a test: 1. **Rebuild + redeploy the LIVE broker.** `/usr/local/bin/idss-broker` on the broker host (`dev@100.98.48.68`, `ourcloud-broker.service`) is what actually writes the zone; a repo landing does not change it (GOTCHAS #28 deploy gate, #508). Confirm which build it is, read its journal at the point request (`14:58:37Z` on the harvested drive — was `AcmeChallenge` non-empty?), and redeploy at the five-record `PutRecords`. **Overwrite, don't skip**: `_acme-challenge.<slug>` is a live *wrong-target* CNAME (→ apex), not a missing record. 2. **Repair the DigitalOcean token's authorization** for the rental expiry-tag move — `/v1/gateways/renew` returned `403 Forbidden` on all 11 passes. This is a credential/security-posture change on production infra (one-way door). 3. **Re-check the zone before the next device drive:** the five-record set live, with `_acme-challenge.<slug>` naming the gateway's per-boot acme-dns fulldomain. Re-arm with `ready-for-agent` once the broker + zone + token are healed and a drive can reach the gateway's public doors. --- *Housekeeping:* the same push also landed `sandcastle: unblock the shared Go push gate` (commit `2d4b114`) — #788's IDIP arc (`internal/keria`, `internal/keriawire`, `internal/idp`, `internal/keriauth`) had landed via session pushes that skip the sandcastle pre-push gate, leaving `origin/main` lint-red on 11 revive/errcheck findings and refusing **every** sandcastle worker's Go push. Purely mechanical lint-green fixes (doc comments, `_ = resp.Body.Close()`, unused-param rename); no #788 behaviour changed.
Owner

Item 1 ANSWERED from the live gateway, under ADR 0174 (Ben approved the redeploy; I did NOT run it — read why).

The handover asked: read the journal at the point request (14:58:37Z) — was AcmeChallenge non-empty? It was empty, and here is the mechanism.

The gateway never obtained an acme-dns fulldomain — and said it succeeded

Gateway 168.144.172.20 (droplet 595628182) is still standing. acme-dns-register.service, the unit whose whole job is to register the account and publish IDSS_ACMEDNS_* for Caddy (ADR 0014):

Active: active (exited) since Thu 2026-08-27 14:58:36 UTC
Main PID: 2209 (code=exited, status=0/SUCCESS)

14:58:34 Starting Register the gateway acme-dns account and publish IDSS_ACMEDNS_* …
14:58:35 acme-dns-register-start[2240]: curl: (7) Failed to connect to 127.0.0.1 port 8081 after 0 ms
14:58:36 Finished Register the gateway acme-dns account and publish IDSS_ACMEDNS_* …

It could not reach acme-dns, registered nothing, and exited 0/SUCCESS. /run/acme-dns-env does not exist on the box; IDSS_ACMEDNS_* was never published. The point request went out one second later, at 14:58:37Z, carrying an empty AcmeChallenge — so the broker wrote its fallback and the zone reads exactly as this ticket describes.

Why the curl failed — a readiness race, not a broken service

acme-dns is active right now and listening: LISTEN 127.0.0.1:8081 users:(("acme-dns",pid=2206)). And the ordering is declared correctly — acme-dns-register has both After= and Wants/Requires=acme-dns.service.

Note the PIDs: acme-dns is 2206, the register is 2209. acme-dns had been started; it had not yet bound its socket. After= on a plain (non-Type=notify, non-socket-activated) service guarantees only that the unit was started, never that it is accepting connections. This is GOTCHAS #2's family and the exact shape of #691 — "DigitalOcean's active is not proof sshd is up" — one layer down.

Live zone state, confirming the consequence

name type value verdict
rehearsal-c.idss.nz A 168.144.172.20 correct
*.rehearsal-c CNAME rehearsal-c.idss.nz. correct
_acme-challenge.rehearsal-c CNAME rehearsal-c.idss.nz. wrong target (should be the acme-dns fulldomain)
acme.rehearsal-c NS — absent
acme-dns.rehearsal-c A → 168.144.172.20 present

DNS-01 can never validate, Caddy waits on :443 forever, neither door answers — which is precisely the anyLive == false shape 1ae38ba0 just taught the deploy to report honestly.

Why I did not run the approved redeploy

"Redeploy at the five-record PutRecords, overwrite don't skip" would write the same wrong record again. There is still no fulldomain to point _acme-challenge at — the gateway never obtained one. Re-pointing DNS treats the symptom; the record is wrong because its input was empty. Ben approved the redeploy on the ticket's framing; the live evidence changes what the right action is, so I stopped rather than execute it.

What actually needs fixing

  1. acme-dns-register must wait for the socket to accept, not merely for the unit to start — poll until connect succeeds, with a bounded budget. The repo already has this shape twice: vm.Manager.WaitReady/pollReady, and DDR 0192's CarrierConfig.ConnectTimeout/ConnectPoll added for the identical #691 race. (Alternatively make acme-dns Type=notify or socket-activated, which fixes it at the source for every future consumer.)
  2. It must fail loud (ADR 0100). A registration that publishes nothing must not exit 0. Today's silent success is what let an empty AcmeChallenge reach the broker and a wrong CNAME reach the zone, with no red anywhere until a deploy died 648 s later at a leg five stages downstream.
  3. Only then does the zone need re-pointing — and it will be written correctly by the normal point path, needing no manual PutRecords at all.

Item 2 (the DigitalOcean token's 403 Forbidden on /v1/gateways/renew, visible in the broker journal as DELETE /v2/tags/idss-rental-expires-… refused) is untouched and remains Ben's — it is a production credential change and a one-way door.

Leaving this ready-for-human for Ben's call on whether the fix lands as a session or a swarm ticket. Gateway 168.144.172.20 is still up if anyone wants to read more before it is reaped.

**Item 1 ANSWERED from the live gateway, under ADR 0174 (Ben approved the redeploy; I did NOT run it — read why).** The handover asked: *read the journal at the point request (`14:58:37Z`) — was `AcmeChallenge` non-empty?* **It was empty, and here is the mechanism.** ## The gateway never obtained an acme-dns fulldomain — and said it succeeded Gateway `168.144.172.20` (droplet `595628182`) is still standing. `acme-dns-register.service`, the unit whose whole job is to register the account and publish `IDSS_ACMEDNS_*` for Caddy (ADR 0014): ``` Active: active (exited) since Thu 2026-08-27 14:58:36 UTC Main PID: 2209 (code=exited, status=0/SUCCESS) 14:58:34 Starting Register the gateway acme-dns account and publish IDSS_ACMEDNS_* … 14:58:35 acme-dns-register-start[2240]: curl: (7) Failed to connect to 127.0.0.1 port 8081 after 0 ms 14:58:36 Finished Register the gateway acme-dns account and publish IDSS_ACMEDNS_* … ``` It could not reach acme-dns, registered nothing, **and exited 0/SUCCESS**. `/run/acme-dns-env` does not exist on the box; `IDSS_ACMEDNS_*` was never published. The point request went out **one second later**, at `14:58:37Z`, carrying an empty `AcmeChallenge` — so the broker wrote its fallback and the zone reads exactly as this ticket describes. ## Why the curl failed — a readiness race, not a broken service `acme-dns` is **active right now** and listening: `LISTEN 127.0.0.1:8081 users:(("acme-dns",pid=2206))`. And the ordering is declared correctly — `acme-dns-register` has both `After=` and `Wants/Requires=acme-dns.service`. Note the PIDs: acme-dns is **2206**, the register is **2209**. acme-dns *had* been started; it had not yet **bound its socket**. `After=` on a plain (non-`Type=notify`, non-socket-activated) service guarantees only that the unit was started, never that it is accepting connections. This is GOTCHAS #2's family and the exact shape of #691 — *"DigitalOcean's `active` is not proof sshd is up"* — one layer down. ## Live zone state, confirming the consequence | name | type | value | verdict | |---|---|---|---| | `rehearsal-c.idss.nz` | A | `168.144.172.20` | correct | | `*.rehearsal-c` | CNAME | `rehearsal-c.idss.nz.` | correct | | `_acme-challenge.rehearsal-c` | CNAME | `rehearsal-c.idss.nz.` | **wrong target** (should be the acme-dns fulldomain) | | `acme.rehearsal-c` | NS | — | **absent** | | `acme-dns.rehearsal-c` | A | → `168.144.172.20` | present | DNS-01 can never validate, Caddy waits on `:443` forever, neither door answers — which is precisely the `anyLive == false` shape `1ae38ba0` just taught the deploy to report honestly. ## Why I did not run the approved redeploy **"Redeploy at the five-record `PutRecords`, overwrite don't skip" would write the same wrong record again.** There is still no fulldomain to point `_acme-challenge` at — the gateway never obtained one. Re-pointing DNS treats the symptom; the record is wrong because its input was empty. Ben approved the redeploy on the ticket's framing; the live evidence changes what the right action is, so I stopped rather than execute it. ## What actually needs fixing 1. **`acme-dns-register` must wait for the socket to accept, not merely for the unit to start** — poll until connect succeeds, with a bounded budget. The repo already has this shape twice: `vm.Manager.WaitReady`/`pollReady`, and DDR 0192's `CarrierConfig.ConnectTimeout`/`ConnectPoll` added for the identical #691 race. (Alternatively make acme-dns `Type=notify` or socket-activated, which fixes it at the source for every future consumer.) 2. **It must fail loud (ADR 0100).** A registration that publishes nothing must not exit 0. Today's silent success is what let an empty `AcmeChallenge` reach the broker and a wrong CNAME reach the zone, with no red anywhere until a deploy died 648 s later at a leg five stages downstream. 3. Only then does the zone need re-pointing — and it will be written correctly by the normal point path, needing no manual `PutRecords` at all. Item 2 (the DigitalOcean token's `403 Forbidden` on `/v1/gateways/renew`, visible in the broker journal as `DELETE /v2/tags/idss-rental-expires-…` refused) is untouched and remains Ben's — it is a production credential change and a one-way door. Leaving this `ready-for-human` for Ben's call on whether the fix lands as a session or a swarm ticket. Gateway `168.144.172.20` is still up if anyone wants to read more before it is reaped.
Owner

CORRECTION from the watch — my earlier comment's diagnosis was WRONG. Ignore it. The acme-dns registration SUCCEEDED.

I claimed acme-dns-register silently failed to register and published nothing. That is not what happened, and anyone picking this up on my say-so would look in the wrong place.

What the gateway actually holds (168.144.172.20, /var/lib/idss-acmedns/, all written 14:58):

-rw-------  caddy.env          IDSS_ACMEDNS_{USERNAME,PASSWORD,SUBDOMAIN,SERVER_URL} all set
-rw-r--r--  fulldomain         07feca20-5f4c-4c51-a570-24c0f7fc4c70.acme.rehearsal-c.idss.nz
-rw-r--r--  registration.json

The registration worked and the fulldomain fact exists. Two mistakes on my part:

  1. I checked /run/acme-dns-env, which is not the path — the unit writes to its StateDirectory, /var/lib/idss-acmedns/ (acmednsStateDir = "idss-acmedns").
  2. I read the single curl: (7) Failed to connect to 127.0.0.1 port 8081 at 14:58:35 as the failure. It is the health poll's first iteration. #431 already fixed this race: the script polls $api/health for up to 300s and exit 1s if it never binds. One refused probe, success one second later, then registration — the retry loop working exactly as designed. status=0/SUCCESS was honest.

So there is no readiness race and no fail-loud violation here. #431's fix holds.

The real fault is one layer out, and it is a design gap rather than a bug: ChallengeSource.AcmeChallenge (internal/fleetwire/challenge.go:81) reads the fulldomain fact over SSH from the gateway, and returns honest-absent "" — never an error — in three cases: no SSH forward yet, gateway unreachable, or fact not yet written. The point request went out at 14:58:37, one second after the registration finished at 14:58:36. It read empty, so the broker wired the name with A + wildcard only and no delegation — which is exactly what the zone shows: _acme-challenge.rehearsal-c is a CNAME to the apex, and acme.rehearsal-c NS is absent, while the gateway has held a valid fulldomain the whole time.

The comment at that function says "a missing challenge only decorates the name-wiring, so it must never abort it". For DNS-01 that is precisely backwards: without the delegation the door can never get a certificate, so the "decoration" is load-bearing. And nothing re-points once the fact does appear — the absent delegation is permanent for the life of that name.

Filed as its own swarm ticket per Ben. Item 2 (the DO token) is DONE — see the separate note; the broker is running a new credential with delete scope and has logged zero 403s since 22:34:58Z.

**CORRECTION from the watch — my earlier comment's diagnosis was WRONG. Ignore it. The acme-dns registration SUCCEEDED.** I claimed `acme-dns-register` silently failed to register and published nothing. That is not what happened, and anyone picking this up on my say-so would look in the wrong place. **What the gateway actually holds** (`168.144.172.20`, `/var/lib/idss-acmedns/`, all written 14:58): ``` -rw------- caddy.env IDSS_ACMEDNS_{USERNAME,PASSWORD,SUBDOMAIN,SERVER_URL} all set -rw-r--r-- fulldomain 07feca20-5f4c-4c51-a570-24c0f7fc4c70.acme.rehearsal-c.idss.nz -rw-r--r-- registration.json ``` The registration worked and the fulldomain fact exists. Two mistakes on my part: 1. I checked `/run/acme-dns-env`, which is not the path — the unit writes to its `StateDirectory`, `/var/lib/idss-acmedns/` (`acmednsStateDir = "idss-acmedns"`). 2. I read the single `curl: (7) Failed to connect to 127.0.0.1 port 8081` at 14:58:35 as *the* failure. It is the **health poll's first iteration**. `#431` already fixed this race: the script polls `$api/health` for up to 300s and `exit 1`s if it never binds. One refused probe, success one second later, then registration — the retry loop working exactly as designed. `status=0/SUCCESS` was honest. So there is **no readiness race and no fail-loud violation here.** #431's fix holds. **The real fault is one layer out**, and it is a design gap rather than a bug: `ChallengeSource.AcmeChallenge` (`internal/fleetwire/challenge.go:81`) reads the fulldomain fact **over SSH from the gateway**, and returns honest-absent `""` — never an error — in three cases: no SSH forward yet, gateway unreachable, or fact not yet written. The point request went out at **14:58:37**, one second after the registration finished at 14:58:36. It read empty, so the broker wired the name with **A + wildcard only and no delegation** — which is exactly what the zone shows: `_acme-challenge.rehearsal-c` is a CNAME to the apex, and `acme.rehearsal-c` NS is **absent**, while the gateway has held a valid fulldomain the whole time. The comment at that function says *"a missing challenge only decorates the name-wiring, so it must never abort it"*. For DNS-01 that is precisely backwards: **without the delegation the door can never get a certificate**, so the "decoration" is load-bearing. And nothing re-points once the fact does appear — the absent delegation is permanent for the life of that name. Filed as its own swarm ticket per Ben. **Item 2 (the DO token) is DONE** — see the separate note; the broker is running a new credential with delete scope and has logged zero 403s since 22:34:58Z.
Owner

Closing — both halves of the handover are resolved. #854 is re-pointed at #915.

This ticket's human handover named three items. Where each landed:

  1. The broker's zone records / DNS-01 delegation → #915, filed as a swarm ticket at Ben's direction, with the corrected diagnosis (the gateway's acme-dns registration succeeds and holds a valid fulldomain; the point request reads the fact one second after it is written, gets honest-absent "", wires the name with no delegation, and nothing ever re-points). My first reading of this — a readiness race in acme-dns-register — was wrong and is corrected above; #431's 300 s health gate holds.
  2. The DigitalOcean token's authorization → DONE. The token was not dead, it was missing delete scope only: GET /v2/droplets 200 and POST /v2/tags 201, but DELETE /v2/tags/… 403 — which is why /v1/gateways/renew failed every pass, SSH-key reaping failed, and the standing gateway accumulated 93 idss-rental-expires-* tags (one created per renew, none removable — the signature of create-yes/delete-no). Ben issued a replacement; it was probed before install (droplet read 200, snapshot read 200, ssh_key read 200, ssh_key create→delete 201→204, tag create→delete 201→204), installed to /etc/idss-broker/do-token with the previous file backed up as do-token.bak-20260827T223403Z, and the broker restarted at 22:34:58Z. It has logged zero 403s since. Probe artifacts cleaned up.
  3. Re-check the zone before the next device drive → carried on #915's acceptance criteria, where it belongs.

Residue, non-blocking: the 93 orphaned expiry tags will not self-clean — Retag removes only the tag it replaces. They are not a reaper hazard: the earliest deadline decodes to 2026-08-28 14:45Z, ~16 h ahead of the fix, so no premature reap. They go with the droplet.

#854 now blocks on #915 alone. Worth a fresh drive once that lands — the token fix on its own may change how far it gets, since renew and reap were failing on every previous pass.

**Closing — both halves of the handover are resolved. #854 is re-pointed at #915.** This ticket's human handover named three items. Where each landed: 1. **The broker's zone records / DNS-01 delegation** → **#915**, filed as a swarm ticket at Ben's direction, with the corrected diagnosis (the gateway's acme-dns registration succeeds and holds a valid fulldomain; the point request reads the fact one second after it is written, gets honest-absent `""`, wires the name with no delegation, and **nothing ever re-points**). My first reading of this — a readiness race in `acme-dns-register` — was **wrong** and is corrected above; #431's 300 s health gate holds. 2. **The DigitalOcean token's authorization** → **DONE.** The token was not dead, it was missing **delete** scope only: `GET /v2/droplets` 200 and `POST /v2/tags` 201, but `DELETE /v2/tags/…` 403 — which is why `/v1/gateways/renew` failed every pass, SSH-key reaping failed, and the standing gateway accumulated 93 `idss-rental-expires-*` tags (one created per renew, none removable — the signature of create-yes/delete-no). Ben issued a replacement; it was probed before install (droplet read 200, snapshot read 200, ssh_key read 200, ssh_key create→delete 201→204, tag create→delete 201→204), installed to `/etc/idss-broker/do-token` with the previous file backed up as `do-token.bak-20260827T223403Z`, and the broker restarted at **22:34:58Z**. It has logged **zero 403s since**. Probe artifacts cleaned up. 3. **Re-check the zone before the next device drive** → carried on #915's acceptance criteria, where it belongs. **Residue, non-blocking:** the 93 orphaned expiry tags will not self-clean — `Retag` removes only the tag it replaces. They are **not** a reaper hazard: the earliest deadline decodes to 2026-08-28 14:45Z, ~16 h ahead of the fix, so no premature reap. They go with the droplet. `#854` now blocks on **#915** alone. Worth a fresh drive once that lands — the token fix on its own may change how far it gets, since renew and reap were failing on every previous pass.
ben closed this issue 2026-08-28 03:05:08 +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#905
No description provided.