{"record":{"id":"5d714d1e427bc298","repo":"cross-rs/cross","slug":"unexpected-progress-type-expected-plain-auto-or-tty-and-got","errorCode":null,"errorMessage":"unexpected progress type: expected plain, auto, or tty and got {s}","messagePattern":"unexpected progress type: expected plain, auto, or tty and got (.+?)","errorType":"validation","errorClass":"eyre::ErrReport","httpStatus":null,"severity":"error","filePath":"src/docker/build.rs","lineNumber":24,"sourceCode":"use crate::errors::*;\nuse crate::shell::Verbosity;\n\n#[derive(Debug, PartialEq, Eq, Clone, Copy)]\npub enum Progress {\n    Plain,\n    Auto,\n    Tty,\n}\n\nimpl FromStr for Progress {\n    type Err = eyre::ErrReport;\n\n    fn from_str(progress: &str) -> Result<Self> {\n        Ok(match progress {\n            \"plain\" => Progress::Plain,\n            \"auto\" => Progress::Auto,\n            \"tty\" => Progress::Tty,\n            s => eyre::bail!(\"unexpected progress type: expected plain, auto, or tty and got {s}\"),\n        })\n    }\n}\n\nimpl From<Progress> for &str {\n    fn from(progress: Progress) -> Self {\n        match progress {\n            Progress::Plain => \"plain\",\n            Progress::Auto => \"auto\",\n            Progress::Tty => \"tty\",\n        }\n    }\n}\n\npub trait BuildCommandExt {\n    fn invoke_build_command(&mut self) -> &mut Self;\n    fn progress(&mut self, progress: Option<Progress>) -> Result<&mut Self>;\n    fn verbose(&mut self, verbosity: Verbosity) -> &mut Self;","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/cross-rs/cross/blob/8c1a8aa4b661711f4b7b6ac07c2e8929ce2f7d27/src/docker/build.rs#L6-L42","documentation":"`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.","triggerScenarios":"Passing an unrecognized value for the progress option, e.g. a `--progress` CLI flag set to \"tty1\", \"Plain\", \"\", or \"verbose\".","commonSituations":"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.","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."],"exampleFix":"// before\nlet p = Progress::from_str(\"TTY\")?; // fails\n// after\nlet p = Progress::from_str(\"tty\")?;","handlingStrategy":"validation","validationCode":"const VALID: [&str; 3] = [\"plain\", \"auto\", \"tty\"];\nif !VALID.contains(&progress) { return Err(format!(\"progress must be one of {VALID:?}, got {progress}\")); }","typeGuard":"fn is_progress(s: &str) -> bool { matches!(s, \"plain\" | \"auto\" | \"tty\") }","tryCatchPattern":null,"preventionTips":["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."],"tags":["docker","cli","parsing","invalid-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"8c1a8aa4b661711f4b7b6ac07c2e8929ce2f7d27","analyzedAt":"2026-09-13T15:10:43.988Z","contentChangedAt":"2026-09-13T15:10:43.988Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}