consent: join dies on update-ca-certificates exit 10 — a cloud-init dpkg race #1033

Closed
opened 2026-08-30 12:51:52 +00:00 by matou-build-agent · 2 comments

What failed

Leg consent. verdict.json gives "firstRedLeg": "consent", {"total": 6, "green": 5, "red": 1, "skip": 0}.

This is not the KNOWN own-VPS carrier frontier. That frontier is pairing, and legs.json carries no skip reasons at all ("skip": 0) — the drive died four legs upstream of it, at consent, on a defect this drive has not seen before.

Consent itself worked. The transcript records the whole consent contract completing:

> 1
Type WIPE to consent, anything else to stop: WIPE
✓ consent recorded — the wipe runs at first deploy
probing: linux · x86_64 · 2 threads · 3 GB memory · 76 GB disk
✓ connection request sent to 
waiting for the operator's decision…

and the operator app agreed — the Playwright page snapshot in error-context.md shows ✓ node-req-0001 connected. 2 vCPU · 4 GB · 76 GB — meets the gateway minimum. The join then aborted in a step after consent.

The failing line

From artifacts/legs.json / artifacts/consent-transcript.txt:

time=2026-08-30T12:18:03.086Z level=ERROR msg="enroll did not complete" component=agent
  err="join: install certs: trust: refresh system trust store: update-ca-certificates []: exit status 10:
  Updating certificates in /etc/ssl/certs...
  rehash: error: skipping Certigna.pem, cannot open file
  rehash: error: skipping CommScope_Public_Trust_ECC_Root-01.pem, cannot open file
  rehash: error: skipping DigiCert_High_Assurance_EV_Root_CA.pem, cannot open file
  rehash: error: skipping Entrust.net_Premium_2048_Secure_Server_CA.pem, cannot open file
  rehash: error: skipping GTS_Root_R2.pem, cannot open file
  rehash: error: skipping QuoVadis_Root_CA_2.pem, cannot open file
  rehash: error: skipping QuoVadis_Root_CA_3.pem, cannot open file
  rehash: error: skipping Security_Communication_Root_CA.pem, cannot open file
  rehash: error: skipping Starfield_Class_2_CA.pem, cannot open file
  rehash: error: skipping SwissSign_Gold_CA_-_G2.pem, cannot open file
  rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
  rehash: warning: skipping idss-community.pem,it does not contain exactly one certificate or CRL"

exit status 10 is not a failure code — it is a count. openssl rehash (which update-ca-certificates shells out to) exits with the number of files it could not process. There are exactly 10 error: … cannot open file lines. The two warning: lines are not counted. So exit 10 means, literally, "ten dangling symlinks in /etc/ssl/certs" — nothing about the IDSS cert.

logs/droplet-journal.txt names it. cloud-init was still running, and was mid-dpkg on ca-certificates, at the exact second the agent refreshed the trust store:

12:17:47 systemd[1]: Starting cloud-final.service - Cloud-init: Final Stage...
12:17:58 systemd[1]: Started idss-agent.service - IDSS agent (ADR 0053).
12:18:02 cloud-init[1247]: Unpacking ca-certificates (20260601~24.04.1) over (20240203) ...
12:18:02 cloud-init[1247]: Setting up ca-certificates (20260601~24.04.1) ...
         >>> 12:18:03.086Z  agent's update-ca-certificates → exit status 10 <<<
12:18:05 cloud-init[1247]: Updating certificates in /etc/ssl/certs...
12:18:07 cloud-init[1247]: rehash: warning: skipping idss-community.pem,it does not contain exactly one certificate or CRL
12:18:07 cloud-init[1247]: 14 added, 10 removed; done.
12:18:10 cloud-init[1247]: Processing triggers for ca-certificates (20260601~24.04.1) ...
12:18:11 cloud-init[1247]: 0 added, 0 removed; done.
12:18:36 cloud-init[1247]: Cloud-init v. 26.1 ... finished ... Up 64.21 seconds

The Unpacking … over (20240203) at 12:18:02 removed the old source PEMs out from under the /etc/ssl/certs symlinks. One second later the agent rehashed that half-torn directory and hit the dangling links. Then cloud-init's own update-ca-certificates cleaned up: 14 added, 10 removed — the same ten.

Two further facts from those lines settle the diagnosis:

  • The condition was transient and self-healing. By 12:18:11 the store is clean: 0 added, 0 removed; done. A retry three seconds later would have passed.
  • The agent's cert was installed successfully. cloud-init's own rehash at 12:18:07 sees idss-community.pem sitting in /etc/ssl/certs. The work succeeded; only the exit code of the refresh killed the join.

Suspected layer

Product (primary) — idss-agent's join: install certs step. It treats any non-zero exit from update-ca-certificates as fatal to enrolment. But that exit code is a per-file error count for pre-existing, third-party, unrelated entries in /etc/ssl/certs — entries IDSS did not write and is not responsible for. Any member machine whose unattended-upgrades, apt, or cloud-init happens to touch ca-certificates during a join gets a hard "enroll did not complete", on a box where the community cert is in fact correctly installed. This is not rehearsal-only.

Harness (contributor). The drive drives curl -sSf https://get.idss.nz | sh and the terminal join at ~25 s after boot, inside cloud-init's window — cloud-final.service did not finish until 12:18:36, 38 s after idss-agent.service started. The rehearsal reliably reproduces a race it should be gating out.

Infra: not implicated. logs/droplet-do-forensics.txt shows one create action and nothing else (a power_cycle/resize/migration here is DO's doing — there is none), 0% packet loss, and the box answering on tcp/22.

What plugging it needs

  1. Make the trust-store refresh tolerant of unrelated rehash errors. In the agent's trust: refresh system trust store path, stop treating update-ca-certificates' non-zero exit as fatal on its own. Verify the outcome instead of the exit code: after the run, confirm the community cert is present and parses (and/or that it made it into ca-certificates.crt), and only fail the join if that check fails. Log the rehash noise at WARN. Optionally scope the check to files IDSS wrote.
  2. Retry once on a dirty store. Because the condition clears itself in seconds, a single backoff-retry of the refresh would also have turned this drive green — but do it in addition to (1), not instead of it: (1) is what protects a real member's machine.
  3. Gate the rehearsal on cloud-init. Before the install-command leg, wait for cloud-init status --wait (or for cloud-init.target) on the fresh droplet. That removes the harness's own contribution and stops this masking later legs.

Live box

No live-box section was appended to this brief, so I diagnosed from the harvested logs alone. The droplet is in fact still up — logs/droplet-do-forensics.txt reads tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did and status: active — but I was given no access line for it and did not touch it. Nothing in this diagnosis needs it: the journal already carries the concurrent dpkg run, and the store repaired itself at 12:18:11 so a live look now would show a clean /etc/ssl/certs and tell us nothing.

Adjacent findings, not the red

  • idss-community.pem never gets a hash symlink. Both the agent's rehash and cloud-init's warn skipping idss-community.pem, it does not contain exactly one certificate or CRL — the agent writes a multi-cert bundle into a directory that requires one certificate per file. It still lands in ca-certificates.crt, so most TLS works, but anything doing hashed-directory lookup (openssl -CApath, some Go/curl configurations) will not find it. Worth splitting into one file per certificate. Independent of this red, but in the same code path.
  • Blank community name in the join UI. The transcript renders idss-agent unknown · joining and ✓ connection request sent to with an empty slot where the community label belongs — cosmetic, but it is the first thing a member reads while consenting to a full-disk wipe.
  • 12:18:29 "resumed join did not land" … enroll-relay.sock: read: connection reset by peer (journal line 1259) is downstream, not a second cause: the harness had already recorded its verdict at 12:18:03.790 and torn the relay socket down.

Corroboration that nothing else ran

Enrolment aborted before any deploy, and the harvested state is consistent with that: droplet-units.txt shows only sshd and systemd-resolved listening and Unit nginx.service could not be found; droplet-keri.txt shows no KERI units; clan-config-snapshot.log reads no config repo … nothing to snapshot (a drive that never built one). broker-journal.txt harvested nothing (the broker host dev@100.98.48.68 is unreachable from this executor) — expected off-mesh behaviour under ADR 0208/#681, and the verdict does not depend on it.

drive 20260830T121643Z red at consent: the terminal join exited 1 --- transcript --- Warning: Permanently added '209.38.92.217' (ED25519) to the list of known hosts. idss-agent unknown · joining How should this machine contribute? [1] Ful
evidence: /home/dev/swarm/Matou/idss/test-results/drive-idip/20260830T121643Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## What failed Leg `consent`. `verdict.json` gives `"firstRedLeg": "consent"`, `{"total": 6, "green": 5, "red": 1, "skip": 0}`. **This is not the KNOWN own-VPS carrier frontier.** That frontier is pairing, and `legs.json` carries **no skip reasons at all** (`"skip": 0`) — the drive died four legs upstream of it, at `consent`, on a defect this drive has not seen before. Consent itself worked. The transcript records the whole consent contract completing: ``` > 1 Type WIPE to consent, anything else to stop: WIPE ✓ consent recorded — the wipe runs at first deploy probing: linux · x86_64 · 2 threads · 3 GB memory · 76 GB disk ✓ connection request sent to waiting for the operator's decision… ``` and the operator app agreed — the Playwright page snapshot in `error-context.md` shows `✓ node-req-0001 connected. 2 vCPU · 4 GB · 76 GB — meets the gateway minimum.` The join then aborted in a step *after* consent. ## The failing line From `artifacts/legs.json` / `artifacts/consent-transcript.txt`: ``` time=2026-08-30T12:18:03.086Z level=ERROR msg="enroll did not complete" component=agent err="join: install certs: trust: refresh system trust store: update-ca-certificates []: exit status 10: Updating certificates in /etc/ssl/certs... rehash: error: skipping Certigna.pem, cannot open file rehash: error: skipping CommScope_Public_Trust_ECC_Root-01.pem, cannot open file rehash: error: skipping DigiCert_High_Assurance_EV_Root_CA.pem, cannot open file rehash: error: skipping Entrust.net_Premium_2048_Secure_Server_CA.pem, cannot open file rehash: error: skipping GTS_Root_R2.pem, cannot open file rehash: error: skipping QuoVadis_Root_CA_2.pem, cannot open file rehash: error: skipping QuoVadis_Root_CA_3.pem, cannot open file rehash: error: skipping Security_Communication_Root_CA.pem, cannot open file rehash: error: skipping Starfield_Class_2_CA.pem, cannot open file rehash: error: skipping SwissSign_Gold_CA_-_G2.pem, cannot open file rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL rehash: warning: skipping idss-community.pem,it does not contain exactly one certificate or CRL" ``` **`exit status 10` is not a failure code — it is a count.** `openssl rehash` (which `update-ca-certificates` shells out to) exits with the number of files it could not process. There are exactly **10** `error: … cannot open file` lines. The two `warning:` lines are not counted. So `exit 10` means, literally, "ten dangling symlinks in `/etc/ssl/certs`" — nothing about the IDSS cert. ## Who made those ten links dangle `logs/droplet-journal.txt` names it. cloud-init was still running, and was mid-`dpkg` on `ca-certificates`, at the exact second the agent refreshed the trust store: ``` 12:17:47 systemd[1]: Starting cloud-final.service - Cloud-init: Final Stage... 12:17:58 systemd[1]: Started idss-agent.service - IDSS agent (ADR 0053). 12:18:02 cloud-init[1247]: Unpacking ca-certificates (20260601~24.04.1) over (20240203) ... 12:18:02 cloud-init[1247]: Setting up ca-certificates (20260601~24.04.1) ... >>> 12:18:03.086Z agent's update-ca-certificates → exit status 10 <<< 12:18:05 cloud-init[1247]: Updating certificates in /etc/ssl/certs... 12:18:07 cloud-init[1247]: rehash: warning: skipping idss-community.pem,it does not contain exactly one certificate or CRL 12:18:07 cloud-init[1247]: 14 added, 10 removed; done. 12:18:10 cloud-init[1247]: Processing triggers for ca-certificates (20260601~24.04.1) ... 12:18:11 cloud-init[1247]: 0 added, 0 removed; done. 12:18:36 cloud-init[1247]: Cloud-init v. 26.1 ... finished ... Up 64.21 seconds ``` The `Unpacking … over (20240203)` at 12:18:02 removed the old source PEMs out from under the `/etc/ssl/certs` symlinks. One second later the agent rehashed that half-torn directory and hit the dangling links. Then cloud-init's own `update-ca-certificates` cleaned up: **`14 added, 10 removed`** — *the same ten*. Two further facts from those lines settle the diagnosis: - The condition was **transient and self-healing**. By `12:18:11` the store is clean: `0 added, 0 removed; done.` A retry three seconds later would have passed. - The agent's cert **was installed successfully**. cloud-init's own rehash at 12:18:07 sees `idss-community.pem` sitting in `/etc/ssl/certs`. The work succeeded; only the exit code of the refresh killed the join. ## Suspected layer **Product (primary) — `idss-agent`'s `join: install certs` step.** It treats any non-zero exit from `update-ca-certificates` as fatal to enrolment. But that exit code is a per-file error count for pre-existing, third-party, unrelated entries in `/etc/ssl/certs` — entries IDSS did not write and is not responsible for. Any member machine whose `unattended-upgrades`, `apt`, or cloud-init happens to touch `ca-certificates` during a join gets a hard "enroll did not complete", on a box where the community cert is in fact correctly installed. This is not rehearsal-only. **Harness (contributor).** The drive drives `curl -sSf https://get.idss.nz | sh` and the terminal join at ~25 s after boot, inside cloud-init's window — `cloud-final.service` did not finish until `12:18:36`, 38 s *after* `idss-agent.service` started. The rehearsal reliably reproduces a race it should be gating out. **Infra:** not implicated. `logs/droplet-do-forensics.txt` shows one `create` action and nothing else (`a power_cycle/resize/migration here is DO's doing` — there is none), 0% packet loss, and the box answering on tcp/22. ## What plugging it needs 1. **Make the trust-store refresh tolerant of unrelated rehash errors.** In the agent's `trust: refresh system trust store` path, stop treating `update-ca-certificates`' non-zero exit as fatal on its own. Verify the outcome instead of the exit code: after the run, confirm the community cert is present and parses (and/or that it made it into `ca-certificates.crt`), and only fail the join if *that* check fails. Log the rehash noise at WARN. Optionally scope the check to files IDSS wrote. 2. **Retry once on a dirty store.** Because the condition clears itself in seconds, a single backoff-retry of the refresh would also have turned this drive green — but do it in addition to (1), not instead of it: (1) is what protects a real member's machine. 3. **Gate the rehearsal on cloud-init.** Before the `install-command` leg, wait for `cloud-init status --wait` (or for `cloud-init.target`) on the fresh droplet. That removes the harness's own contribution and stops this masking later legs. ## Live box **No live-box section was appended to this brief**, so I diagnosed from the harvested logs alone. The droplet is in fact still up — `logs/droplet-do-forensics.txt` reads `tcp/22: a FRESH connect succeeded — the box answers, whatever ssh did` and `status: active` — but I was given no access line for it and did not touch it. Nothing in this diagnosis needs it: the journal already carries the concurrent dpkg run, and the store repaired itself at 12:18:11 so a live look now would show a clean `/etc/ssl/certs` and tell us nothing. ## Adjacent findings, not the red - **`idss-community.pem` never gets a hash symlink.** Both the agent's rehash and cloud-init's warn `skipping idss-community.pem, it does not contain exactly one certificate or CRL` — the agent writes a multi-cert bundle into a directory that requires one certificate per file. It still lands in `ca-certificates.crt`, so most TLS works, but anything doing hashed-directory lookup (`openssl -CApath`, some Go/curl configurations) will not find it. Worth splitting into one file per certificate. Independent of this red, but in the same code path. - **Blank community name in the join UI.** The transcript renders `idss-agent unknown · joining ` and `✓ connection request sent to ` with an empty slot where the community label belongs — cosmetic, but it is the first thing a member reads while consenting to a full-disk wipe. - **`12:18:29 "resumed join did not land" … enroll-relay.sock: read: connection reset by peer`** (journal line 1259) is downstream, not a second cause: the harness had already recorded its verdict at `12:18:03.790` and torn the relay socket down. ## Corroboration that nothing else ran Enrolment aborted before any deploy, and the harvested state is consistent with that: `droplet-units.txt` shows only `sshd` and `systemd-resolved` listening and `Unit nginx.service could not be found`; `droplet-keri.txt` shows no KERI units; `clan-config-snapshot.log` reads `no config repo … nothing to snapshot (a drive that never built one)`. `broker-journal.txt` harvested nothing (`the broker host dev@100.98.48.68 is unreachable from this executor`) — expected off-mesh behaviour under ADR 0208/#681, and the verdict does not depend on it. drive `20260830T121643Z` red at `consent`: `the terminal join exited 1 --- transcript --- Warning: Permanently added '209.38.92.217' (ED25519) to the list of known hosts. idss-agent unknown · joining How should this machine contribute? [1] Ful` evidence: `/home/dev/swarm/Matou/idss/test-results/drive-idip/20260830T121643Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 28ff46f6d26f -->
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=14534
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=14534 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1033 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1033,
  "status": "success",
  "commits": [
    "f3b1697"
  ],
  "changed_files": [
    "STATUS.md",
    "agent/internal/trust/trust.go",
    "agent/internal/trust/trust_test.go",
    "app/tests/e2e/journey.idip.spec.ts",
    "docs/GOTCHAS.md"
  ],
  "tests": [
    {
      "command": "go test ./agent/internal/trust/",
      "exit_code": 0
    },
    {
      "command": "go test ./agent/... ./internal/join/... ./internal/install/...",
      "exit_code": 0
    },
    {
      "command": "go build ./... && go vet ./...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l (whole module, clean)",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./agent/internal/trust/...",
      "exit_code": 0
    },
    {
      "command": "npx eslint app/tests/e2e/journey.idip.spec.ts",
      "exit_code": 0
    },
    {
      "command": "npx prettier --check app/tests/e2e/journey.idip.spec.ts",
      "exit_code": 0
    },
    {
      "command": "pre-push gate (nix develop .#go-ci: gofmt/build/vet/go test ./...)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Make the trust-store refresh tolerant of unrelated rehash errors — verify the outcome instead of the exit code; log rehash noise at WARN": "agent/internal/trust/trust.go refreshTrustStore + verifyCommunityTrust: a non-zero, non-ErrNotFound exit is not fatal; it greps the community CA out of /etc/ssl/certs/ca-certificates.crt and, if present, logs the exit at slog.Warn and proceeds. Proven by TestTrust_TolerantOfUnrelatedRehashErrors (commit f3b1697).",
    "Retry once on a dirty store, in ADDITION to outcome verification": "refreshTrustStore backs off RefreshRetryEvery (3 s) and re-runs update-ca-certificates only when the CA has NOT landed. Proven by TestTrust_RetriesAndHealsDirtyStore (heals on retry) and TestTrust_FailsWhenCommunityCANeverLands (exactly one retry then fails loud).",
    "A genuinely absent update-ca-certificates still fails loud (ADR 0100)": "ErrNotFound short-circuits before any verify/retry; TestTrust_MissingUpdateCACertificatesFailsLoud asserts a single attempt, no verify, loud failure.",
    "Gate the rehearsal on cloud-init before the install/join leg": "app/tests/e2e/journey.idip.spec.ts agent-install leg runs `cloud-init status --wait || true` over SSH before pasting the install one-liner; eslint/prettier clean.",
    "Update STATUS.md and record the hazard": "STATUS.md header carries the #1033 landing; docs/GOTCHAS.md #136 records the exit-is-a-count hazard (commit f3b1697)."
  },
  "summary": "The agent's trust-store refresh now judges its outcome (did the community CA land in the bundle?) instead of update-ca-certificates' exit code, so a fresh box's cloud-init dpkg race on ca-certificates can no longer red a join whose trust is correctly installed.",
  "reason": "",
  "blockers": []
}
**close-report** for #1033 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1033, "status": "success", "commits": [ "f3b1697" ], "changed_files": [ "STATUS.md", "agent/internal/trust/trust.go", "agent/internal/trust/trust_test.go", "app/tests/e2e/journey.idip.spec.ts", "docs/GOTCHAS.md" ], "tests": [ { "command": "go test ./agent/internal/trust/", "exit_code": 0 }, { "command": "go test ./agent/... ./internal/join/... ./internal/install/...", "exit_code": 0 }, { "command": "go build ./... && go vet ./...", "exit_code": 0 }, { "command": "gofmt -l (whole module, clean)", "exit_code": 0 }, { "command": "golangci-lint run ./agent/internal/trust/...", "exit_code": 0 }, { "command": "npx eslint app/tests/e2e/journey.idip.spec.ts", "exit_code": 0 }, { "command": "npx prettier --check app/tests/e2e/journey.idip.spec.ts", "exit_code": 0 }, { "command": "pre-push gate (nix develop .#go-ci: gofmt/build/vet/go test ./...)", "exit_code": 0 } ], "criteria": { "Make the trust-store refresh tolerant of unrelated rehash errors — verify the outcome instead of the exit code; log rehash noise at WARN": "agent/internal/trust/trust.go refreshTrustStore + verifyCommunityTrust: a non-zero, non-ErrNotFound exit is not fatal; it greps the community CA out of /etc/ssl/certs/ca-certificates.crt and, if present, logs the exit at slog.Warn and proceeds. Proven by TestTrust_TolerantOfUnrelatedRehashErrors (commit f3b1697).", "Retry once on a dirty store, in ADDITION to outcome verification": "refreshTrustStore backs off RefreshRetryEvery (3 s) and re-runs update-ca-certificates only when the CA has NOT landed. Proven by TestTrust_RetriesAndHealsDirtyStore (heals on retry) and TestTrust_FailsWhenCommunityCANeverLands (exactly one retry then fails loud).", "A genuinely absent update-ca-certificates still fails loud (ADR 0100)": "ErrNotFound short-circuits before any verify/retry; TestTrust_MissingUpdateCACertificatesFailsLoud asserts a single attempt, no verify, loud failure.", "Gate the rehearsal on cloud-init before the install/join leg": "app/tests/e2e/journey.idip.spec.ts agent-install leg runs `cloud-init status --wait || true` over SSH before pasting the install one-liner; eslint/prettier clean.", "Update STATUS.md and record the hazard": "STATUS.md header carries the #1033 landing; docs/GOTCHAS.md #136 records the exit-is-a-count hazard (commit f3b1697)." }, "summary": "The agent's trust-store refresh now judges its outcome (did the community CA land in the bundle?) instead of update-ca-certificates' exit code, so a fresh box's cloud-init dpkg race on ca-certificates can no longer red a join whose trust is correctly installed.", "reason": "", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#1033
No description provided.