You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: stdout output accepts input-only formats like cri/raw/auto during validation #1060
output.type: stdout currently accepts input-side formats such as cri, raw, and auto during --validate, even though the stdout sink only meaningfully supports json and console.
tl;dr: Issue #1060 is valid and reproducible — stdout output currently accepts input-only formats (cri/raw/auto) during --validate because output-format compatibility is not checked, and unsupported stdout formats silently fall back to text output.
Recommendation
Add explicit stdout-format validation in config validation and remove the silent fallback path in sink construction so invalid stdout.format values fail fast at validation time.
Findings
Shared format enum allows input-only variants on outputs
crates/logfwd-config/src/lib.rs:201-210 defines Format with Cri, Raw, Auto, etc.
Add tests that assert Config::load_str(...) fails for output.type: stdout with format: cri/raw/auto (and optionally logfmt/syslog).
Add/clarify valid stdout format tests (json, console, unset/default).
Add CLI-level validation regression test
Add an integration test in existing CLI/integration test location to assert --validate exits with config error for invalid stdout.format.
Docs alignment
Update stdout format docs in README.md / book/src/config/reference.md (or current source of truth) to list only supported stdout formats and default behavior.
Related Items
Type
Link
Relevance
Issue
#1060
Current bug report
Issue
#499
Prior format-validation gap (input-side silent fallthrough)
Issue
#158
Startup validation umbrella work; this fits that theme
Issue
#573
Earlier format-handling refactor context
File
crates/logfwd-config/src/lib.rs
Config schema + validation gap
File
crates/logfwd-output/src/lib.rs
Stdout fallback behavior
Note
🔒 Integrity filtering filtered 3 items
Integrity filtering activated and filtered the following items during workflow execution.
This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.
Validation: CONFIRMED — shared root cause with all silent-ignore config issues
Both InputConfig and OutputConfig are single flat structs (#[serde(deny_unknown_fields)]) with fields shared across all input/output types. Config::validate() checks that required fields are present for each type but does not reject extraneous optional fields that have no meaning for the selected type.
crates/logfwd-output/src/lib.rs: runtime builders use match cfg.output_type and silently ignore fields not consumed by the selected arm.
crates/logfwd-config/src/lib.rsConfig::validate(): validates required fields per type but has no reject-if-present checks for inapplicable optional fields.
Unified fix — add per-type field rejection to Config::validate():
// Example for OutputConfig:match output.output_type{OutputType::Stdout | OutputType::Null => {if output.endpoint.is_some(){warn_or_err("endpoint not used by this output type");}if output.index.is_some(){warn_or_err("index not used by this output type");}if output.compression.is_some(){warn_or_err("compression not used by this output type");}if output.auth.is_some(){warn_or_err("auth not used by this output type");}// etc.}OutputType::Elasticsearch => {if output.protocol.is_some(){warn_or_err("protocol not used by elasticsearch");}// etc.}// ...}
A single pass over all output types covering all optional fields fixes all 12 related issues at once.
Activity
github-actions commentedon Apr 5, 2026
tl;dr: Issue
#1060is valid and reproducible —stdoutoutput currently accepts input-only formats (cri/raw/auto) during--validatebecause output-format compatibility is not checked, and unsupported stdout formats silently fall back to text output.Recommendation
Add explicit
stdout-format validation in config validation and remove the silent fallback path in sink construction so invalidstdout.formatvalues fail fast at validation time.Findings
Shared format enum allows input-only variants on outputs
crates/logfwd-config/src/lib.rs:201-210definesFormatwithCri,Raw,Auto, etc.crates/logfwd-config/src/lib.rs:250-260usesOutputConfig.format: Option(Format).Config validation does not constrain
stdoutformatcrates/logfwd-config/src/lib.rs:748hasOutputType::Stdout | OutputType::Null => {}(no format checks).Runtime silently coerces unsupported stdout formats to text
crates/logfwd-output/src/lib.rs:770-774:json->StdoutFormat::Jsonconsole->StdoutFormat::Console_->StdoutFormat::Text(silent fallback)Coverage gap exists in current tests
crates/logfwd-config/src/lib.rs:1204-1222tests unimplemented input formats only.crates/logfwd-config/src/lib.rs:1236-1250tests output types, but no stdout format validity matrix.Verification
I reproduced the behavior locally with the built binary:
Observed output:
Relevant existing tests pass but do not cover this case:
Detailed Action Plan
Add stdout format guard in config validation
crates/logfwd-config/src/lib.rs(inside output loop nearOutputType::Stdout | OutputType::Nullbranch).OutputType::Stdout, allow only supported values (json,console, and whichever default behavior is intended whenformatis unset).cri/raw/auto/logfmt/syslogwith a clear error message: pipeline name, output label, and allowed values.Fail closed in sink factory
crates/logfwd-output/src/lib.rs:769-775._ => StdoutFormat::Textwith explicit accepted mappings and returnErr(...)for unsupported values.Add regression tests in config crate
crates/logfwd-config/src/lib.rstests section.Config::load_str(...)fails foroutput.type: stdoutwithformat: cri/raw/auto(and optionallylogfmt/syslog).json,console, unset/default).Add CLI-level validation regression test
--validateexits with config error for invalidstdout.format.Docs alignment
README.md/book/src/config/reference.md(or current source of truth) to list only supported stdout formats and default behavior.Related Items
#1060#499#158#573crates/logfwd-config/src/lib.rscrates/logfwd-output/src/lib.rsNote
🔒 Integrity filtering filtered 3 items
Integrity filtering activated and filtered the following items during workflow execution.
This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)pull_request_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)What is this? | From workflow: Issue Triage
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
strawgate commentedon Apr 5, 2026
Validation: CONFIRMED — shared root cause with all silent-ignore config issues
Both
InputConfigandOutputConfigare single flat structs (#[serde(deny_unknown_fields)]) with fields shared across all input/output types.Config::validate()checks that required fields are present for each type but does not reject extraneous optional fields that have no meaning for the selected type.This bug is one of ~12 confirmed instances of the same pattern (see also #1057, #1058, #1060, #1064, #1065, #1066, #1070, #1071, #1072, #1073, #1075, #1077, #1078).
Root cause confirmed:
crates/logfwd-output/src/lib.rs: runtime builders usematch cfg.output_typeand silently ignore fields not consumed by the selected arm.crates/logfwd-config/src/lib.rsConfig::validate(): validates required fields per type but has no reject-if-present checks for inapplicable optional fields.Unified fix — add per-type field rejection to
Config::validate():A single pass over all output types covering all optional fields fixes all 12 related issues at once.
strawgate commentedon Apr 5, 2026
Fixed on
masterin PR #1153 (a20b1ac0abc635914ee267103d466926401c3fb4).I rechecked
origin/master; stdout validation/default behavior now matches this issue, so this looks stale and safe to close.