GeezerVison is showing github.com — fleet-config: empty/blank config-file strings are used verbatim — broker_socket="" resolves to the home directory itself, and a blank dispatch url overrides as Some("") · Issue #6405 · developing-today/code
fleet-config: empty/blank config-file strings are used verbatim — broker_socket="" resolves to the home directory itself, and a blank dispatch url overrides as Some("") #6405Descriptionfleet-config: empty/blank config-file strings are used verbatim — broker_socket="" resolves to the home directory itself, and a blank dispatch url overrides as Some("")
Summary
fleet-config is careful about empty environment values: env_path filters them out (#5473), and dispatch_url()'s own doc says of FLEET_DISPATCH_URL that "empty counts as unset, as with every env path here". Empty or blank config-file strings get no such treatment: the accessors use them verbatim. A fleet.toml with broker_socket = "" makes the broker socket path the home directory itself; token_file = "" does the same to the secrets token-file path; [dispatch] url = "" (or all-whitespace) is returned as a configured URL, Some(""); token_name = "", target_host = "", and connect_udp_listen = "" likewise surface as empty values instead of their documented defaults.
This breaks the crate's stated config policy (crate docs, lib.rs:14-16): "a malformed file is a loud error, never a silent fallback". An empty string in a path/URL/name field is a misspelling-class error — a templated config rendering a variable that came out empty — and every env-side equivalent in this same crate is already treated as unset for exactly that reason.
Distinct from the filed siblings: #6397 covers [[proxy.services]] row values (duplicate/zero ports, empty service names); #6396/#5737 cover env-base resolution. No filed issue covers the scalar string fields of [proxy]/[secrets]/[dispatch].
Evidence (file:line, origin/main @ 2871969; fleet-config lib.rs is byte-identical between laptop HEAD 1dae17e and origin/main, md5-verified this run)
pkgs/fleet/crates/fleet-config/src/lib.rs:302-320 — broker_socket_from: the env source goes through env_path (empty filtered), but Some(p) => resolve_under(home, &PathBuf::from(p)) for the config value has no empty check; resolve_under(home, "") is home itself.
pkgs/fleet/crates/fleet-config/src/lib.rs:430-436 — secrets_token_file: Some(p) => resolve_under_home(p) — same empty-to-home resolution.
pkgs/fleet/crates/fleet-config/src/lib.rs:390-396 — dispatch_url: the env branch trims and rejects empty (Ok(v) if !v.trim().is_empty()), the config branch is self.dispatch.url.clone() verbatim.
pkgs/fleet/crates/fleet-config/src/lib.rs:324-330 — target_host: as_deref().unwrap_or(DEFAULT_TARGET_HOST) — Some("") wins over the default.
pkgs/fleet/crates/fleet-config/src/lib.rs:350-356 — connect_udp_listen: same shape against DEFAULT_CONNECT_UDP_LISTEN.
pkgs/fleet/crates/fleet-config/src/lib.rs:398-403 — dispatch_token_name: same shape against DEFAULT_DISPATCH_TOKEN_NAME.
- Contrast inside the same file:
search_url() (:415-421) and search_via() (:406-412) do trim/filter their config values — the scalar fields above are the inconsistent remainder.
Verification (this run, laptop, real fleet-config crate)
Probe ~/git/fleet/probe-fleet-config-empty-rel (cfg bin; path-depends on the real fleet-config crate; HOME=/home/tester; each case is a real Config::load_from on a written temp fleet.toml):
empty broker_socket -> "/home/tester/" (the home directory itself)
empty secrets token_file -> "/home/tester/" (the home directory itself)
empty dispatch url -> Some("")
blank dispatch url " " -> Some(" ")
empty dispatch token_name -> ""
empty target_host -> ""
empty connect_udp_listen -> ""
control broker_socket "sock/b.sock" -> "/home/tester/sock/b.sock"
control dispatch url "http://127.0.0.1:9" -> Some("http://127.0.0.1:9")
control dispatch token_name "tok.name" -> "tok.name"
Every empty/blank case loads with no error and surfaces the empty value; every control resolves as documented.
Why it matters
- A templated or generated
fleet.toml that renders a variable empty (the routine failure the env-side filtering exists for) does not fail loudly: the session broker tries to use the operator's home directory as a Unix socket path, the secrets flow names a directory as its token file, and the dispatch client is handed an empty base URL that outranks the working default — each surfacing later as an opaque connect/read error far from the config mistake, or, for target_host = "", as a dial to an empty host.
- The crate already decided this question for env values and for
[search]; the remaining fields are an inconsistency, not a design choice.
Acceptance criteria
- Empty or all-whitespace values for
broker_socket, secrets.token_file, dispatch.url, dispatch.token_name, proxy.target_host, and proxy.connect_udp_listen in the config file are either treated as unset (falling back to the documented default, matching the env-side rule) or rejected at load with a loud ConfigError — one consistent shape, triage's call.
- No accessor can return the home directory itself as a socket/token-file path, an empty string as a configured dispatch URL, or an empty token name / target host / listen address.
- Pinning tests cover empty and blank spellings for each affected accessor alongside the existing
dispatch_settings_* / proxy_settings_* tests; valid values resolve exactly as before.
- No change to env-var handling (already correct) or to valid configs.
Activitydeveloping-today commented on Nov 6, 2026 dezren39 commented on Nov 6, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (new-issue-creator-code-a)
- Session / ID: cron new-issue-creator-code-a run 2026-11-05 18:35 CST
- Found via: filed this run
- Task: Filed after verifying on the laptop with probe ~/git/fleet/probe-fleet-config-empty-rel (real fleet-config crate): empty/blank config-file strings are used verbatim — broker_socket="" and token_file="" resolve to the home directory itself, dispatch url=""/" " surfaces as Some(""), and token_name/target_host/connect_udp_listen "" override their defaults — while every env-side equivalent in the same crate is filtered as unset.
- Expectation: effort s — triage via the enqueued repo-task/v1 packet; done = one consistent empty/blank shape (treat as unset or loud load error) with pinning tests, per the issue's acceptance criteria.
- Links: queue packet packet-6405-triage.json (repo-health-code-pilot)
dezren39 commented on Nov 6, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 11, 2026 agent-note:v1
🤖 Triage complete — Task 10832 completed. Source review and recommended validation approach are recorded above; implementation follow-up task 14872 is queued. The executable probe was not rerun during triage. dezren39 commented on Nov 11, 2026 🤖 Agent note · done
- Agent: repo queue worker, lane code-a (repo-worker-code)
- Task: task 14872 for issue fleet-config: empty/blank config-file strings are used verbatim — broker_socket="" resolves to the home directory itself, and a blank dispatch url overrides as Some("") #6405 — outcome: fixed_merged.
- Fix: PR fix(fleet-config): reject blank scalar config values at load (#6405) #8550 merged (0599d5f).
Config::validate in pkgs/fleet/crates/fleet-config/src/lib.rs now rejects an empty or whitespace-only config-file value for [proxy] broker_socket, [proxy] target_host, [proxy] connect_udp_listen, [secrets] token_file, [dispatch] url, and [dispatch] token_name at load with a field-naming ConfigError::Parse — the same misspelling-class treatment as the fleet-config: zero numeric values are never validated — egress_proxy_port=0 and dispatch port=0 dial port 0, and idle_exit_secs=0 makes the broker exit within seconds #6412 zero rule. The configured value is never echoed in the error. Env behavior, nonblank values, and defaults are unchanged; [[proxy.services]] rows (fleet-config: [[proxy.services]] is never validated — duplicate ports silently collapse last-wins in the broker's routing map, and port 0 / empty names load #6397) untouched.
- Verification: new regression test
blank_scalar_strings_are_a_loud_error covers both spellings of all six fields plus valid and omitted controls; cargo test -p fleet-config — 45 passed, 0 failed; cargo fmt clean. Codex review on PR fix(fleet-config): reject blank scalar config values at load (#6405) #8550 completed with zero findings. PR checks were queued in the fleet runner backlog at merge (no failures); merged under standing merge authority on the local verification.
- Closure: acceptance met (all six fields reject blank with a field-naming error at load; controls preserved) — closing this issue.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|