Rehearsal drive harness doesn't capture the broker's log — recurrences of #678's fault can't be pinned to a call site #681

Closed
opened 2026-08-22 19:23:44 +00:00 by matou-build-agent · 5 comments

Follow-up from #678 / #680. #678 is blocked on the next raw-DO-404
occurrence's d.do method/path/status line (added by #677) naming
/v2/droplets vs ensureSSHKey as the culprit. #680 was exactly that next
occurrence (drive 20260822T185236Z, same sig 3b0b824f61b8 as #677/#678's
original) — but it still couldn't pin the call site, because no broker
process log is captured anywhere in the run directory.
Every logs/*.log
in that run is either empty or a guest-side local-connection failure; there
is no broker stdout/stderr file at all.

Why: the broker is a remote, standing service (IDSS_BROKER_URL,
scripts/lib/rehearsal-droplet.sh:283) that the drive harness rents a
gateway from — it is never spawned locally by
scripts/smoke-private-path.sh / scripts/rehearsal-cycle.sh, unlike the
guest unit, whose logs the harness already knows how to harvest into
logs/guest-*.log. So the existing "redirect this local process's stdout
into the run dir" pattern those files follow doesn't apply — capturing the
broker's log needs either:

  • the broker itself writing to a location the harness can pull (e.g. scp/
    ssh cat a log file, or journalctl -u <broker-unit> --since <drive-start>
    over the same SSH door the harness already uses for droplet ops) into
    $run_dir/logs/broker.log after (or during) the drive, or
  • the broker exposing its recent non-2xx DO calls via a debug endpoint the
    harness scrapes.

What this needs before it's actionable: confirming exactly where/how the
broker is deployed on Matou infra (host, systemd unit name or equivalent,
log location) — this session traced the client side (IDSS_BROKER_URL +
scripts/lib/rehearsal-droplet.sh) but not the broker's own deploy target,
which is out of this ticket's originating ticket's (#680's) scope to chase
down blind.

Proposed default ruling (ADR 0174 rule 4): once the deploy target is
confirmed, wiring a log pull into the run directory is a two-way door
(revertible by commit/config, provable by inspecting a subsequent drive's
logs/broker.log) — a session may rule and implement it without Ben.

Related: #678 (the evidence gap this unblocks), #680 (the recurrence that
hit this gap and filed this ticket).

**Follow-up from #678 / #680.** #678 is blocked on the *next* raw-DO-404 occurrence's `d.do` method/path/status line (added by #677) naming `/v2/droplets` vs `ensureSSHKey` as the culprit. #680 was exactly that next occurrence (drive `20260822T185236Z`, same sig `3b0b824f61b8` as #677/#678's original) — but it still couldn't pin the call site, because **no broker process log is captured anywhere in the run directory.** Every `logs/*.log` in that run is either empty or a guest-side local-connection failure; there is no broker stdout/stderr file at all. **Why:** the broker is a remote, standing service (`IDSS_BROKER_URL`, `scripts/lib/rehearsal-droplet.sh:283`) that the drive harness rents a gateway *from* — it is never spawned locally by `scripts/smoke-private-path.sh` / `scripts/rehearsal-cycle.sh`, unlike the guest unit, whose logs the harness already knows how to harvest into `logs/guest-*.log`. So the existing "redirect this local process's stdout into the run dir" pattern those files follow doesn't apply — capturing the broker's log needs either: - the broker itself writing to a location the harness can pull (e.g. `scp`/ `ssh cat` a log file, or `journalctl -u <broker-unit> --since <drive-start>` over the same SSH door the harness already uses for droplet ops) into `$run_dir/logs/broker.log` after (or during) the drive, or - the broker exposing its recent non-2xx DO calls via a debug endpoint the harness scrapes. **What this needs before it's actionable:** confirming exactly where/how the broker is deployed on Matou infra (host, systemd unit name or equivalent, log location) — this session traced the *client* side (`IDSS_BROKER_URL` + `scripts/lib/rehearsal-droplet.sh`) but not the broker's own deploy target, which is out of this ticket's originating ticket's (#680's) scope to chase down blind. **Proposed default ruling (ADR 0174 rule 4):** once the deploy target is confirmed, wiring a log pull into the run directory is a two-way door (revertible by commit/config, provable by inspecting a subsequent drive's `logs/broker.log`) — a session may rule and implement it without Ben. Related: #678 (the evidence gap this unblocks), #680 (the recurrence that hit this gap and filed this ticket).
Author
Member

Precision for whoever picks this up (confirmed independently this
session): no code anywhere under .sandcastle/, scripts/, or tests/e2e/
spawns the broker — it's a standing systemd service on Matou infra
(broker/README.md documents its env vars, BROKER_STATE_DIR is its
systemd StateDirectory; broker/cmd/broker/main.go:179). So this is not a
stdout-redirect-at-spawn fix.

The pattern to mirror already exists in this repo for exactly this shape —
a one-shot SSH/journalctl harvest of a remote long-running service into
the run directory: scripts/lib/rehearsal-droplet.sh:341-345 (and
354-358, 372-377) do this for droplet-caddy.txt —
ssh ... 'journalctl ...' > "$run_dir/logs/droplet-caddy.txt" 2>&1 || echo "note..." | tee -a .... The broker-log harvest just needs the same shape
pointed at the broker's host/unit instead of the droplet's, writing to
$run_dir/logs/broker-journal.txt. Still blocked on knowing the broker's
actual host + systemd unit name, which this session did not chase down
(host inventory, not this repo).

**Precision for whoever picks this up** (confirmed independently this session): no code anywhere under `.sandcastle/`, `scripts/`, or `tests/e2e/` spawns the broker — it's a standing systemd service on Matou infra (`broker/README.md` documents its env vars, `BROKER_STATE_DIR` is its systemd `StateDirectory`; `broker/cmd/broker/main.go:179`). So this is not a stdout-redirect-at-spawn fix. The pattern to mirror already exists in this repo for exactly this shape — a one-shot SSH/journalctl harvest of a *remote* long-running service into the run directory: `scripts/lib/rehearsal-droplet.sh:341-345` (and `354-358`, `372-377`) do this for `droplet-caddy.txt` — `ssh ... 'journalctl ...' > "$run_dir/logs/droplet-caddy.txt" 2>&1 || echo "note..." | tee -a ...`. The broker-log harvest just needs the same shape pointed at the broker's host/unit instead of the droplet's, writing to `$run_dir/logs/broker-journal.txt`. Still blocked on knowing the broker's actual host + systemd unit name, which this session did not chase down (host inventory, not this repo).
Owner

Traced the broker's deploy target as far as this session's access allows — confirmed the what, hit a hard wall on the where.

Confirmed:

  • The broker (broker/, ADR 0047/0189) deploys to the mail droplet, reached at ssh dev@100.98.48.68 — the same door docs/operator-app/rehearsal-drive.md already documents for idss-bootstrap.service re-staging, and the one GOTCHAS #28/#50 describe Ben using for broker deploys/redeploys.
  • It runs under systemd and logs to the journal (GOTCHAS #50, today: "its journal said no IDSS_CLOUDFLARE_TOKEN..."), the same shape oc_droplet_evidence (scripts/lib/rehearsal-droplet.sh) already harvests on the droplet side (journalctl -u caddy -u acme-dns-register → logs/droplet-caddy.txt). Pulling journalctl -u <broker-unit> --since <drive-start> over the same SSH door into $run_dir/logs/broker.log is the natural fit — no new pattern needed, just the unit name.

Not confirmed — and this session cannot confirm it:

  • The exact systemd unit name. The repo's own docs disagree with each other: GOTCHAS #28 (2026-08-14, #508) names the live binary /usr/local/bin/idss-broker; GOTCHAS #50 (2026-08-22, today, #647's redeploy) calls it "the new ourcloud-broker binary". Binary name and systemd unit name aren't guaranteed to match (idss-bootstrap.service already wraps a differently-named binary on the same host), and no .service file for the broker is checked into the repo to check against (unlike scripts/bootstrap-reseed/idss-reseed.service).
  • Whether a --since <drive-start> pull needs any host-specific journal-retention allowance, or a --user vs system scope flag.

Why I couldn't chase it down myself: this session runs on matou-dev-server-01, a peer on the product's own Netbird mesh (docs/architecture/03-fleet-topology.md) — netbird status shows it peered only with matou-dev-server-02/03 and cherese-macbook-main. 100.98.48.68 is a Tailscale address on a separate admin mesh; ip route get 100.98.48.68 on this host resolves through the plain default route, and ssh dev@100.98.48.68 fails Network is unreachable. Per docs/operator-app/rehearsal-drive.md, the mail droplet is reached from matou-workstation, a different host than this session runs on. A future session-runner attempt dispatched to this same host class hits the identical wall, so I'm not leaving this to rediscover on a second automatic attempt.

Ruling: NOT ruling this two-way-door myself. ADR 0174 rule 1(b) requires a ruling be provable by an existing test/drive/probe — I can't prove the unit name from here, and guessing risks landing journalctl -u <wrong-name> that silently harvests nothing, which is the exact evidence gap this ticket exists to close, just moved one layer down (ADR 0100 territory: never fabricate a working-looking capture).

Relabelling ready-for-human.

Why human

Ben's hands — confirming the broker's current systemd unit name (and journal-vs-file log location) needs eyes/access on the mail droplet (ssh dev@100.98.48.68), reachable only from Ben's own admin mesh; this session-runner host has no route to it. Once the unit name is posted here, wiring journalctl -u <unit> --since <drive-start> into $run_dir/logs/broker.log beside the existing droplet-side harvest is the two-way door this ticket already carries a proposed default ruling for — a session can implement it the moment the name lands.

Ruled by agent under ADR 0174 — veto anytime.

Related: #678, #680 (unblocked once landed).

Traced the broker's deploy target as far as this session's access allows — confirmed the *what*, hit a hard wall on the *where*. **Confirmed:** - The broker (`broker/`, ADR 0047/0189) deploys to the **mail droplet**, reached at `ssh dev@100.98.48.68` — the same door `docs/operator-app/rehearsal-drive.md` already documents for `idss-bootstrap.service` re-staging, and the one GOTCHAS #28/#50 describe Ben using for broker deploys/redeploys. - It runs under systemd and logs to the **journal** (GOTCHAS #50, today: "its journal said `no IDSS_CLOUDFLARE_TOKEN`..."), the same shape `oc_droplet_evidence` (`scripts/lib/rehearsal-droplet.sh`) already harvests on the droplet side (`journalctl -u caddy -u acme-dns-register` → `logs/droplet-caddy.txt`). Pulling `journalctl -u <broker-unit> --since <drive-start>` over the same SSH door into `$run_dir/logs/broker.log` is the natural fit — no new pattern needed, just the unit name. **Not confirmed — and this session cannot confirm it:** - The exact systemd unit name. The repo's own docs disagree with each other: GOTCHAS #28 (2026-08-14, #508) names the live binary `/usr/local/bin/idss-broker`; GOTCHAS #50 (2026-08-22, *today*, #647's redeploy) calls it "the new `ourcloud-broker` binary". Binary name and systemd unit name aren't guaranteed to match (`idss-bootstrap.service` already wraps a differently-named binary on the same host), and no `.service` file for the broker is checked into the repo to check against (unlike `scripts/bootstrap-reseed/idss-reseed.service`). - Whether a `--since <drive-start>` pull needs any host-specific journal-retention allowance, or a `--user` vs system scope flag. **Why I couldn't chase it down myself:** this session runs on `matou-dev-server-01`, a peer on the product's own Netbird mesh (`docs/architecture/03-fleet-topology.md`) — `netbird status` shows it peered only with matou-dev-server-02/03 and cherese-macbook-main. `100.98.48.68` is a Tailscale address on a *separate* admin mesh; `ip route get 100.98.48.68` on this host resolves through the plain default route, and `ssh dev@100.98.48.68` fails `Network is unreachable`. Per `docs/operator-app/rehearsal-drive.md`, the mail droplet is reached from **matou-workstation**, a different host than this session runs on. A future session-runner attempt dispatched to this same host class hits the identical wall, so I'm not leaving this to rediscover on a second automatic attempt. **Ruling:** NOT ruling this two-way-door myself. ADR 0174 rule 1(b) requires a ruling be provable by an existing test/drive/probe — I can't prove the unit name from here, and guessing risks landing `journalctl -u <wrong-name>` that silently harvests nothing, which is the exact evidence gap this ticket exists to close, just moved one layer down (ADR 0100 territory: never fabricate a working-looking capture). Relabelling `ready-for-human`. ## Why human Ben's hands — confirming the broker's current systemd unit name (and journal-vs-file log location) needs eyes/access on the mail droplet (`ssh dev@100.98.48.68`), reachable only from Ben's own admin mesh; this session-runner host has no route to it. Once the unit name is posted here, wiring `journalctl -u <unit> --since <drive-start>` into `$run_dir/logs/broker.log` beside the existing droplet-side harvest is the two-way door this ticket already carries a proposed default ruling for — a session can implement it the moment the name lands. Ruled by agent under ADR 0174 — veto anytime. Related: #678, #680 (unblocked once landed).
Owner

Unblocked — the unit name, confirmed live from Ben's laptop

The one fact this ticket waited on, read off the host directly (read-only; nothing changed):

$ ssh dev@100.98.48.68 'systemctl list-units --type=service --all | grep -i broker'
  ourcloud-broker.service   loaded active running   OurCloud subdomain broker (idss.nz zone, ADR 0128) - build 86d5ef7
  • Host: the mail droplet, dev@100.98.48.68 — workspace.netbird.selfhosted.
  • Unit: ourcloud-broker.service (unit file at /etc/systemd/system/ourcloud-broker.service; binary /usr/local/bin/ourcloud-broker). So GOTCHAS #50's "ourcloud-broker binary" is the accurate name and GOTCHAS #28's /usr/local/bin/idss-broker is stale — the rebrand never reached this host.
  • Logs to the system journal, readable as sudo journalctl -u ourcloud-broker. The broker booted line (GOTCHAS #59) is there, so a --since <drive-start> pull gets what #678 needs.

That makes the harvest exactly the shape the ticket proposed: mirror oc_droplet_evidence's one-shot pull (scripts/lib/rehearsal-droplet.sh:341-345, the droplet-caddy.txt pattern) at ourcloud-broker.service on dev@100.98.48.68, writing $run_dir/logs/broker-journal.txt.

One constraint the implementer MUST honour — mesh reachability

The mail droplet sits on the admin mesh (netbird.selfhosted, management netbird.matou.nz, 100.98.0.0/16). Not every executor host is on it:

  • matou-workstation is NOT a peer on that mesh (it is on the product's own netbird.dev.matou.nz, 100.83.0.0/16) — ssh dev@100.98.48.68 from there fails Network is unreachable, which is precisely why the 2026-08-22 session could not chase this down.
  • elitebook-03 IS a peer — elitebook-distributed-server-03.netbird.selfhosted, 100.98.240.186, currently Connected. It is now a provisioned executor host (#659, closed 2026-08-25).

So the harvest must degrade honestly rather than red the drive: on an unreachable broker host, write the note: line into logs/broker-journal.txt and continue, exactly as oc_droplet_evidence already does with its || echo "note..." | tee -a shape. A drive on matou-workstation will legitimately harvest nothing; a drive on elitebook-03 gets the log. Do not make the drive's verdict depend on it.

Ruling

Adopting the ticket's own proposed default (ADR 0174 rule 4): with the deploy target confirmed, wiring the pull into the run directory is a two-way door — revertible by commit, provable by inspecting a subsequent drive's logs/broker-journal.txt. Retagging ready-for-agent; no further human input needed.

## Unblocked — the unit name, confirmed live from Ben's laptop The one fact this ticket waited on, read off the host directly (read-only; nothing changed): ``` $ ssh dev@100.98.48.68 'systemctl list-units --type=service --all | grep -i broker' ourcloud-broker.service loaded active running OurCloud subdomain broker (idss.nz zone, ADR 0128) - build 86d5ef7 ``` - **Host:** the mail droplet, `dev@100.98.48.68` — `workspace.netbird.selfhosted`. - **Unit:** **`ourcloud-broker.service`** (unit file at `/etc/systemd/system/ourcloud-broker.service`; binary `/usr/local/bin/ourcloud-broker`). So GOTCHAS #50's "`ourcloud-broker` binary" is the accurate name and GOTCHAS #28's `/usr/local/bin/idss-broker` is stale — the rebrand never reached this host. - **Logs to the system journal**, readable as `sudo journalctl -u ourcloud-broker`. The `broker booted` line (GOTCHAS #59) is there, so a `--since <drive-start>` pull gets what #678 needs. That makes the harvest exactly the shape the ticket proposed: mirror `oc_droplet_evidence`'s one-shot pull (`scripts/lib/rehearsal-droplet.sh:341-345`, the `droplet-caddy.txt` pattern) at `ourcloud-broker.service` on `dev@100.98.48.68`, writing `$run_dir/logs/broker-journal.txt`. ## One constraint the implementer MUST honour — mesh reachability The mail droplet sits on the **admin mesh** (`netbird.selfhosted`, management `netbird.matou.nz`, `100.98.0.0/16`). Not every executor host is on it: - **`matou-workstation` is NOT a peer** on that mesh (it is on the product's own `netbird.dev.matou.nz`, `100.83.0.0/16`) — `ssh dev@100.98.48.68` from there fails `Network is unreachable`, which is precisely why the 2026-08-22 session could not chase this down. - **`elitebook-03` IS a peer** — `elitebook-distributed-server-03.netbird.selfhosted`, `100.98.240.186`, currently Connected. It is now a provisioned executor host (#659, closed 2026-08-25). So the harvest **must degrade honestly rather than red the drive**: on an unreachable broker host, write the `note:` line into `logs/broker-journal.txt` and continue, exactly as `oc_droplet_evidence` already does with its `|| echo "note..." | tee -a` shape. A drive on `matou-workstation` will legitimately harvest nothing; a drive on `elitebook-03` gets the log. Do not make the drive's verdict depend on it. ## Ruling Adopting the ticket's own proposed default (ADR 0174 rule 4): with the deploy target confirmed, wiring the pull into the run directory is a **two-way door** — revertible by commit, provable by inspecting a subsequent drive's `logs/broker-journal.txt`. Retagging `ready-for-agent`; no further human input needed.
Author
Member

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

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

close-report for #681 — status success

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

envelope
{
  "issue": 681,
  "status": "success",
  "commits": [
    "0265303"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/operator-app/rehearsal-drive.md",
    "scripts/lib/rehearsal-droplet.sh",
    "scripts/smoke-private-path.sh",
    "scripts/tests/broker-evidence-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/broker-evidence-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/droplet-evidence-order-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-device-target-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-rented-target-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/smoke-private-path.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "broker log captured somewhere in the run directory (the evidence gap #678/#680 hit)": "oc_broker_evidence writes $run_dir/logs/broker-journal.txt via a one-shot journalctl pull (scripts/lib/rehearsal-droplet.sh); called once per drive from scripts/smoke-private-path.sh for every uses_droplet_machinery target; pinned by scripts/tests/broker-evidence-test.sh check 1/2",
    "harvest targets the confirmed broker host + unit (dev@100.98.48.68, ourcloud-broker.service)": "defaults IDSS_BROKER_SSH=dev@100.98.48.68 / IDSS_BROKER_UNIT=ourcloud-broker.service; pinned by broker-evidence-test.sh check 2, overrides check 4",
    "windowed to the drive (--since drive-start) so it gets what #678 needs": "broker_since stamp captured post-build in smoke-private-path.sh, passed as --since; pinned by broker-evidence-test.sh check 3",
    "mirrors the existing oc_droplet_evidence droplet-caddy.txt pull shape (ticket + Ben's ruling)": "same ssh + journalctl + tee-note idiom in scripts/lib/rehearsal-droplet.sh",
    "degrades honestly on an off-mesh executor — writes a note and never reds the drive (Ben's ruling)": "|| echo note | tee -a; returns success on ssh failure; pinned by broker-evidence-test.sh checks 6/7 (returns 0, note: line explains off-mesh)"
  },
  "summary": "The rehearsal drive harness now harvests the standing Broker's journal into logs/broker-journal.txt, mirroring the droplet-caddy.txt pull, so a raw-DO-404's broker call site is pinnable; it degrades honestly on an off-mesh executor.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #681 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 681, "status": "success", "commits": [ "0265303" ], "changed_files": [ "STATUS.md", "docs/operator-app/rehearsal-drive.md", "scripts/lib/rehearsal-droplet.sh", "scripts/smoke-private-path.sh", "scripts/tests/broker-evidence-test.sh" ], "tests": [ { "command": "bash scripts/tests/broker-evidence-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/droplet-evidence-order-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-device-target-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-rented-target-test.sh", "exit_code": 0 }, { "command": "bash -n scripts/smoke-private-path.sh", "exit_code": 0 } ], "criteria": { "broker log captured somewhere in the run directory (the evidence gap #678/#680 hit)": "oc_broker_evidence writes $run_dir/logs/broker-journal.txt via a one-shot journalctl pull (scripts/lib/rehearsal-droplet.sh); called once per drive from scripts/smoke-private-path.sh for every uses_droplet_machinery target; pinned by scripts/tests/broker-evidence-test.sh check 1/2", "harvest targets the confirmed broker host + unit (dev@100.98.48.68, ourcloud-broker.service)": "defaults IDSS_BROKER_SSH=dev@100.98.48.68 / IDSS_BROKER_UNIT=ourcloud-broker.service; pinned by broker-evidence-test.sh check 2, overrides check 4", "windowed to the drive (--since drive-start) so it gets what #678 needs": "broker_since stamp captured post-build in smoke-private-path.sh, passed as --since; pinned by broker-evidence-test.sh check 3", "mirrors the existing oc_droplet_evidence droplet-caddy.txt pull shape (ticket + Ben's ruling)": "same ssh + journalctl + tee-note idiom in scripts/lib/rehearsal-droplet.sh", "degrades honestly on an off-mesh executor — writes a note and never reds the drive (Ben's ruling)": "|| echo note | tee -a; returns success on ssh failure; pinned by broker-evidence-test.sh checks 6/7 (returns 0, note: line explains off-mesh)" }, "summary": "The rehearsal drive harness now harvests the standing Broker's journal into logs/broker-journal.txt, mirroring the droplet-caddy.txt pull, so a raw-DO-404's broker call site is pinnable; it degrades honestly on an off-mesh executor.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
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#681
No description provided.