linera-io/linera-protocol · error
unknown output format `{other}` (expected json|yaml|md|brief
Error message
unknown output format `{other}` (expected json|yaml|md|brief) What it means
The format token of an --output spec is not one of the four supported formats. Each spec is FORMAT:TARGET and the format must be exactly json, yaml, md, or brief (case-sensitive); anything else fails before the target path is touched.
Source
Thrown at linera-service/src/cli/validator_benchmark/report.rs:75
}
if out.is_empty() {
return Err(anyhow!("--output specified but resolved to no entries"));
}
Ok(out)
}
fn parse_one(s: &str) -> Result<OutputSpec> {
let (fmt_str, target) = match s.split_once(':') {
Some((f, p)) => (f, Target::File(PathBuf::from(p))),
None => (s, Target::Stdout),
};
let format = match fmt_str {
"json" => Format::Json,
"yaml" => Format::Yaml,
"md" => Format::Md,
"brief" => Format::Brief,
other => {
return Err(anyhow!(
"unknown output format `{other}` (expected json|yaml|md|brief)"
))
}
};
Ok(OutputSpec { format, target })
}
}
/// Top-level benchmark report.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Report {
pub metadata: Metadata,
pub layers: Layers,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Metadata {
pub tool_version: String,View on GitHub (pinned to 6c226ddcb3)
Solutions
- Use one of the exact lowercase tokens: json, yaml, md, brief.
- Remember yml is not accepted — spell it yaml.
- Keep the FORMAT:TARGET shape with a single colon (a path with a drive letter or extra colons will confuse the split).
- Check the flag for stray whitespace between the format and the colon.
Example fix
# before --output csv:report.csv --output JSON:report.json # after --output json:report.json --output md:report.md
Defensive patterns
Strategy: type-guard
Validate before calling
fn is_known_output_format(s: &str) -> bool {
matches!(s, "json" | "yaml" | "md" | "brief")
} Type guard
fn is_known_output_format(s: &str) -> bool {
matches!(s, "json" | "yaml" | "md" | "brief")
} Prevention
- Use exact lowercase tokens; note yml is invalid — it is yaml.
- Keep the FORMAT:TARGET shape with exactly one colon before the path.
When it happens
Trigger: `--output csv:report.csv`, capitalized tokens like `JSON:report.json`, or a spec missing its separator so the whole string lands in the format slot.
Common situations: Assuming a generic format list; copy-pasting output flags from a different tool; typos like 'yml' instead of 'yaml' or 'markdown' instead of 'md'.
Related errors
- --output specified but resolved to no entries
- Validator spec must be in format: public_key,account_key,add
- --bulk-height-range must be `auto` or `FROM:TO`
- expected query to start with 'query', got: {s}
- expected whitespace after 'query' keyword
AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22).
Data as JSON: /api/errors/7dc5c56c4b2213dc.
Report an issue: GitHub.