GeezerVison is showing github.com — fleet: serve <broker-role> silently ignores all trailing arguments — a typo'd flag starts the daemon instead of erroring · Issue #5568 · developing-today/code
fleet: serve <broker-role> silently ignores all trailing arguments — a typo'd flag starts the daemon instead of erroring #5568DescriptionProblem
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: for serve + queue-broker it calls fleet_queue::queue_broker::run() and for secrets-broker fleet_queue::secrets_broker::run(), never inspecting args[1..]. The argv0-alias route (queue-broker / secrets-broker as argv0) lands in the same run_domain after 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> and fleet 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 / help still 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 bare fleet serve <role> still starts the daemon.
- A pinning unit test covers the rejection (in the style of the existing
wants_domain_help tests in crates/fleet/src/main.rs).
cargo test -p fleet passes on the laptop or in CI.
Activitydeveloping-today commented on Nov 4, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests app/fleetpkgs/fleet multicall binary + platform crates on Nov 4, 2026dezren39 commented on Nov 4, 2026 dezren39 commented on Nov 4, 2026 🤖 Agent note · picked up
- Agent: new-issue-creator job (new-issue-creator-code-a)
- Session / ID: new-issue-creator-code-a run 2026-11-04T15:35Z
- Found via: self-assigned during new-issue-creator-code-a run (guarded self-solve, lifecycle protocol §4 — filed this run, trivial, no safety labels)
- Task: reject trailing args after the queue-broker/secrets-broker roles in run_domain (exit 2 usage error) + pinning test; branch creator-a/5568-serve-broker-args; queue task 9662 cancelled as self-assigned in the same pass.
- Expectation: effort/xs — done = PR merged with cargo test -p fleet green on the laptop and the fixed binary re-probed (junk → exit 2, --help → exit 0, bare role → daemon path).
- Links: task 9662 (cancelled, self-assigned)
dezren39 commented on Nov 4, 2026 🤖 Agent note · handed off
- Agent: new-issue-creator job (new-issue-creator-code-a)
- Session / ID: new-issue-creator-code-a run 2026-11-04T15:35Z
- Found via: filed this run
- Task: Stand-down correction to my "picked up" note above: the guarded self-solve takeover raced a queue claim — task 9662 was already claimed by the queue worker when the cancel ran (
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).
- Expectation: effort/xs — the claiming worker implements the acceptance criteria in the issue body.
- Links: task 9662 (claimed, repo-health-code-pilot)
dezren39 commented on 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 while repo-worker-code-w posts progress markers; after 30 minutes of silence any other worker may pick this up.) dezren39 commented on 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 merge dezren39 commented on 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 merge dezren39 commented on Nov 7, 2026 🤖 Agent note · done (fixed_merged)
- Agent: repo-worker-code, lane code-w (fallback mode — queue backend down, code#6619)
- Task: small-fix issue fleet: serve <broker-role> silently ignores all trailing arguments — a typo'd flag starts the daemon instead of erroring #5568 —
fleet serve <broker-role> silently ignored trailing arguments.
- What happened: the fix already existed as PR fix(fleet): reject stray broker role arguments #6323 (single commit 633c630, Codex round 1 clean) but the branch had diverged 384 commits behind main and was conflicted in
pkgs/fleet/crates/fleet/src/main.rs (both sides added a helper after wants_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.
- Verification:
cargo test -p fleet on the laptop — 15 unit + 7 integration passed, including the pinning test broker_roles_reject_trailing_args_through_serve_and_argv0_aliases and main's new search_serve tests; rustfmt --check clean. 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.
- Outcome: PR fix(fleet): reject stray broker role arguments #6323 MERGED, merge commit 5edd83a; issue fleet: serve <broker-role> silently ignores all trailing arguments — a typo'd flag starts the daemon instead of erroring #5568 auto-closed. Acceptance criteria met: extra args after either broker role (serve form and argv0 aliases) exit 2 naming the argument before daemon startup,
--help/-h/help still exit 0, bare role unchanged, pinning test included.
- Terminal: fallback release, outcome done (fixed_merged).
dezren39 commented on 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
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|