{"record":{"id":"3f5a78961f7cece9","repo":"jdx/mise","slug":"unrecognized-preset-version-version","errorCode":null,"errorMessage":"unrecognized {preset} version: {version}","messagePattern":"unrecognized (.+?) version: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/daemons/presets.rs","lineNumber":171,"sourceCode":"        preset: Some(preset_name.into()),\n        tool: Some((tool, version.into())),\n        exports,\n    })\n}\n\n/// Database compatibility is preset-specific; tool request strings remain opaque.\nfn major(preset: &str, output: &str) -> Result<String> {\n    let version = match preset {\n        \"postgres\" => output.trim().strip_prefix(\"postgres (PostgreSQL) \"),\n        \"redis\" => output\n            .split_whitespace()\n            .find_map(|part| part.strip_prefix(\"v=\")),\n        _ => None,\n    }\n    .ok_or_else(|| eyre::eyre!(\"unrecognized {preset} version output: {output}\"))?;\n    let major = version.split('.').next().unwrap_or_default();\n    if major.is_empty() || !major.chars().all(|c| c.is_ascii_digit()) {\n        bail!(\"unrecognized {preset} version: {version}\");\n    }\n    Ok(major.into())\n}\n\npub(crate) fn initialize(preset_name: &str, data: &Path, database: &str) -> Result<()> {\n    crate::config::Settings::get().ensure_experimental(\"daemon presets\")?;\n    crate::config::Settings::ensure_not_safe(\"initializing daemon data\")?;\n    if cfg!(windows) {\n        bail!(\"daemon presets are not supported on Windows yet\");\n    }\n    let preset = preset(preset_name)?;\n    let parent = data\n        .parent()\n        .ok_or_else(|| eyre::eyre!(\"daemon data must have a parent directory\"))?;\n    std::fs::create_dir_all(parent)?;\n    let _lock = crate::lock_file::LockFile::new(data).lock()?;\n    let output = Command::new(&preset.binary).arg(\"--version\").output()?;\n    if !output.status.success() {","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/daemons/presets.rs#L153-L189","documentation":"major() parses the `--version` output of a preset's binary to extract the major version; it first strips a `v=` (or similar) prefix from the output, then requires the major segment to be non-empty and all digits. If the version string does not match, the output is considered unrecognized for that preset.","triggerScenarios":"Running a preset binary's --version whose stdout lacks a parseable version (builds without version info, custom/patched binaries printing unexpected text), called during daemon initialize.","commonSituations":"A PATH-shimmed or wrapper postgres binary printing a custom banner; a very old or nonstandard build whose version line format differs; locale-modified output.","solutions":["Ensure the real preset binary (not a wrapper) is on PATH and prints a standard version like 'x.y.z' or 'v=x.y.z'","Fix PATH so mise resolves the official binary","Check the binary runs correctly outside mise (`<binary> --version`)"],"exampleFix":"// shell before: postgres --version prints \"custom build\"\n// after: resolve official binary so output is e.g. \"postgres (PostgreSQL) 16.3\"\nPATH=/usr/lib/postgresql/16/bin:$PATH mise daemon start","handlingStrategy":"validation","validationCode":"# verify the binary reports a parseable version first\n<binary> --version | grep -Eo '[0-9]+\\.[0-9]+' || echo 'unparseable version output'","typeGuard":null,"tryCatchPattern":"catch (e) { if (/unrecognized .* version/.test(e.message)) { checkBinaryOnPath(); } }","preventionTips":["Keep wrappers/shims out of PATH for daemon binaries","Test `<binary> --version` output after changing tool versions","Use official tool builds"],"tags":["daemon","version-parsing","preset"],"backgroundTag":"unexpected-response-shape","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}