{"record":{"id":"0f929d430efff9da","repo":"gitbutlerapp/gitbutler","slug":"invalid-version-format-version-version-must-co-0f929d","errorCode":null,"errorMessage":"Invalid version format: {version}. Version must contain at least one alphanumeric character.","messagePattern":"Invalid version format: (.+?)\\. Version must contain at least one alphanumeric character\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-installer/src/config.rs","lineNumber":67,"sourceCode":"\n        // Reject if it looks like a flag\n        if version.starts_with('-') {\n            bail!(\"Invalid version: {version}. Usage: but-installer [version|nightly]\");\n        }\n\n        // Only allow semver-compatible characters\n        if !version\n            .chars()\n            .all(|c| c.is_alphanumeric() || c == '.' || c == '-' || c == '+')\n        {\n            bail!(\n                \"Invalid version format: {version}. Version must contain only alphanumeric characters, dots, hyphens, and plus signs.\"\n            );\n        }\n\n        // Must contain at least one alphanumeric character\n        if !version.chars().any(|c| c.is_alphanumeric()) {\n            bail!(\n                \"Invalid version format: {version}. Version must contain at least one alphanumeric character.\"\n            );\n        }\n\n        Ok(())\n    }\n\n    /// Get the version string as a &str\n    pub fn as_str(&self) -> &str {\n        &self.0\n    }\n}\n\nimpl AsRef<str> for Version {\n    fn as_ref(&self) -> &str {\n        &self.0\n    }\n}","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-installer/src/config.rs#L49-L85","documentation":"After the character whitelist passes, validate requires at least one alphanumeric character so pure punctuation strings like `...`, `---`, or `+` are rejected. The message echoes the input and explains the requirement.","triggerScenarios":"Passing a version consisting only of separators/dots, e.g. `but-installer ...` from a glob expansion that failed, `but-installer --` (caught earlier), or a variable expanded to `.`/`..`/`-` by a misconfigured script.","commonSituations":"Shell scripts where a glob like `v*.*` did not match and stayed literal; tab-completion inserting `..`; templated CI configs where the substitution evaluated to a placeholder of dots.","solutions":["Provide a real version containing digits or letters, e.g. `0.14.2`.","Check that any glob/variable feeding the argument actually expanded (add `set -u`/`shopt -s failglob`).","Validate the value in CI before invoking: `[[ $V =~ [A-Za-z0-9] ]] || exit 1`.","Use `nightly` as a safe default when no concrete version is known."],"exampleFix":"// before\nbut-installer ...\n// after\nbut-installer 0.14.2","handlingStrategy":"validation","validationCode":"assert!(version.chars().any(|c| c.is_alphanumeric()), \"version needs at least one letter or digit: got '{version}'\");","typeGuard":null,"tryCatchPattern":"match InstallerConfig::new() {\n    Err(e) if e.to_string().contains(\"at least one alphanumeric\") => {\n        eprintln!(\"{e}\");\n        std::process::exit(2);\n    }\n    Err(e) => return Err(e),\n    Ok(cfg) => run(cfg),\n}","preventionTips":["Ensure globs/variables feeding the argument actually expanded (enable failglob/unbound checks)","Reject separator-only strings like '...' or '---' in wrapper scripts","Sanity-check the version matches something like ^[v]?[0-9] before invoking","Fall back to `nightly` when no concrete version resolves"],"tags":["installer","cli","validation","version"],"backgroundTag":"invalid-argument-format","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}