Repository navigation
Description
Problem
fleet serve <broker-role> <anything> silently discards every argument after the role and starts the daemon anyway. The broker entry points take no arguments at all, so there is nothing for a stray argument to bind to — a typo'd flag or an extra word does not produce an error, it produces a running queue-broker / secrets-broker.
This is the un-fixed remainder of #5488: that fix intercepted a help flag in the one position after the role (wants_domain_help), but any non-help argument in the same position — and any argument at all through the argv0 aliases — still flows straight into the daemon entry point.
Evidence (verified this run, laptop primary at e844ed1)
Code:
pkgs/fleet/crates/fleet/src/main.rs—run_domain: forserve+queue-brokerit callsfleet_queue::queue_broker::run()and forsecrets-brokerfleet_queue::secrets_broker::run(), never inspectingargs[1..]. The argv0-alias route (queue-broker/secrets-brokeras argv0) lands in the samerun_domainafter the implied role arg is prepended, so it has the same hole.pkgs/fleet/crates/fleet-queue/src/queue_broker.rs:589—pub fn run() -> i32(no args).pkgs/fleet/crates/fleet-queue/src/secrets_broker.rs:189—pub fn run() -> i32(no args).
Probe (fleet binary rebuilt on the laptop from e844ed1, Source rev: e844ed152dd1; HOME pointed at an empty dir so the daemon dies at its first startup step — the token-file read — proving which path was entered):
| invocation | result |
|---|---|
fleet serve queue-broker --help |
domain help, exit 0 (control — #5488 fix works) |
fleet serve queue-broker |
queue-broker: cannot read token file …, exit 3 (daemon startup) |
fleet serve queue-broker --bogus-junk |
identical token-file error, exit 3 |
fleet serve queue-broker frobnicate |
identical token-file error, exit 3 |
fleet serve secrets-broker --bogus-junk |
secrets-broker: cannot read token file …, exit 3 |
queue-broker --bogus-junk (argv0 alias) |
identical token-file error, exit 3 |
With the real token files present the same invocations proceed past the token read to binding the broker port (observed with the pre-fix binary: cannot bind 100.99.113.103:4801: Address already in use — it had entered run() far enough to attempt the bind).
Why it matters
These brokers hold the queue's service-role credentials path and the secrets resolver. A systemd unit, wrapper script, or operator invocation with a typo'd or stale flag (e.g. a removed --bind option, exactly the shape #5488's test comment worries about) silently starts a daemon with default bind/token settings instead of failing loudly — the same fail-open shape the fleet has been stamping out in #5560 (dispatch status), #5460 (fleet-config) and the deploy-script series (#3287/#3297/#3296).
Acceptance criteria
fleet serve queue-broker <any extra arg>andfleet serve secrets-broker <any extra arg>exit 2 with a usage error naming the unexpected argument, before any daemon startup (no token-file read, no bind attempt).- The argv0 aliases behave identically:
queue-broker <extra>/secrets-broker <extra>exit 2. fleet serve <role> --help/-h/helpstill prints domain help with exit 0 (fleet: serve <role> --help (and the queue-broker/secrets-broker argv0 aliases) starts the daemon instead of printing help #5488 behavior preserved), and a barefleet serve <role>still starts the daemon.- A pinning unit test covers the rejection (in the style of the existing
wants_domain_helptests incrates/fleet/src/main.rs). cargo test -p fleetpasses on the laptop or in CI.
Activity
developing-today commentedon Nov 4, 2026
CODE-1376
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 4, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 4, 2026
🤖 Agent note · handed off
cancel_repo_task: task 9662 is not queued or parked). Per lifecycle protocol §6 Duty 4, the first holder keeps the item: the queue worker holds task 9662; I am NOT self-solving. Labels reset to the claimed state (queue/claimed + work/assigned + status/in-progress).48 remaining items
dezren39 commentedon Nov 7, 2026
Picked up by
repo-worker-code-w— working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live whilerepo-worker-code-wposts progress markers; after 30 minutes of silence any other worker may pick this up.)dezren39 commentedon Nov 7, 2026
Progress from
repo-worker-code-w: verified: PR #6323 implements fix, Codex clean, but branch diverged/conflicted vs current main; resolving conflict on laptop, re-running cargo test -p fleet, then mergedezren39 commentedon Nov 7, 2026
Progress from
repo-worker-code-w: implementation_complete: PR #6323 conflict resolved (merge 375b717, both helpers kept), cargo test -p fleet 15 unit + 7 integration passed on laptop, rustfmt clean, PR mergeable; checking Codex/checks on new head then mergedezren39 commentedon Nov 7, 2026
🤖 Agent note · done (fixed_merged)
fleet serve <broker-role>silently ignored trailing arguments.pkgs/fleet/crates/fleet/src/main.rs(both sides added a helper afterwants_domain_help). I resolved the conflict on the laptop keeping both helpers (broker_argument_error+search_serve_tail), merge commit 375b717 pushed to the PR branch.cargo test -p fleeton the laptop — 15 unit + 7 integration passed, including the pinning testbroker_roles_reject_trailing_args_through_serve_and_argv0_aliasesand main's newsearch_servetests;rustfmt --checkclean. Codex re-review of the new head 375b717 completed with no findings. PR CI checks were still QUEUED at merge (slow infra, noted fleet-wide this shift); merged under the standing merge authority after the laptop verification.--help/-h/helpstill exit 0, bare role unchanged, pinning test included.dezren39 commentedon Nov 7, 2026
Released by
repo-worker-code-w(outcome: done). fixed_merged: PR #6323 merged 5edd83a (conflict vs main resolved in merge 375b717 keeping both helpers; cargo test -p fleet 15 unit + 7 integration passed on laptop, rustfmt clean, Codex re-review of new head clean); issue #5568 closed by merge; note #5568 (comment) heartbeat chain