cross-rs/cross · error · eyre::ErrReport
unexpected progress type: expected plain, auto, or tty and…
Error message
unexpected progress type: expected plain, auto, or tty and got {s} What it means
`Progress::from_str` parses a Docker progress output type and only accepts the exact strings "plain", "auto", or "tty". Any other value (including empty or mixed case) fails with this message naming the offending input.
Solutions
- Use exactly one of: plain, auto, tty (lowercase).
- Remove the progress override to fall back to the default (auto).
- If the value comes from a script/CI variable, echo it and fix the casing/spelling.
Example fix
// before
let p = Progress::from_str("TTY")?; // fails
// after
let p = Progress::from_str("tty")?; Defensive patterns
Strategy: validation
Validate before calling
const VALID: [&str; 3] = ["plain", "auto", "tty"];
if !VALID.contains(&progress) { return Err(format!("progress must be one of {VALID:?}, got {progress}")); } Type guard
fn is_progress(s: &str) -> bool { matches!(s, "plain" | "auto" | "tty") } Prevention
- Whitelist-check CLI/env inputs against plain|auto|tty before constructing Progress.
- Never mix case; lowercase user input and reject anything not exactly matching.
- Default to Progress::Auto when the value is empty or absent.
When it happens
Trigger: Passing an unrecognized value for the progress option, e.g. a `--progress` CLI flag set to "tty1", "Plain", "", or "verbose".
Common situations: Typo in the progress flag, copying a value from a different Docker client version that supports other modes, environment variables with stale progress settings, or case-sensitivity mistakes.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Refusing to push without tag or branch. Specify a…
- invalid platform specified
- unknown container state: got
- cannot make definite Image from unqualified PossibleImage
- unsupported os in target, abi
AI-assisted analysis of cross-rs/cross@8c1a8aa4b6 (2026-09-13).
Data as JSON: /api/errors/5d714d1e427bc298.
Report an issue: GitHub.
Appendix: source
Thrown at src/docker/build.rs:24
use crate::errors::*;
use crate::shell::Verbosity;
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Progress {
Plain,
Auto,
Tty,
}
impl FromStr for Progress {
type Err = eyre::ErrReport;
fn from_str(progress: &str) -> Result<Self> {
Ok(match progress {
"plain" => Progress::Plain,
"auto" => Progress::Auto,
"tty" => Progress::Tty,
s => eyre::bail!("unexpected progress type: expected plain, auto, or tty and got {s}"),
})
}
}
impl From<Progress> for &str {
fn from(progress: Progress) -> Self {
match progress {
Progress::Plain => "plain",
Progress::Auto => "auto",
Progress::Tty => "tty",
}
}
}
pub trait BuildCommandExt {
fn invoke_build_command(&mut self) -> &mut Self;
fn progress(&mut self, progress: Option<Progress>) -> Result<&mut Self>;
fn verbose(&mut self, verbosity: Verbosity) -> &mut Self;View on GitHub (pinned to 8c1a8aa4b6)