{"record":{"id":"502c0d9d19956dd6","repo":"jdx/mise","slug":"unable-to-determine-version","errorCode":null,"errorMessage":"unable to determine {} version","messagePattern":"unable to determine (.+?) version","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/daemons/presets.rs","lineNumber":190,"sourceCode":"    }\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() {\n        bail!(\"unable to determine {} version\", preset.binary);\n    }\n    let major = major(preset_name, &String::from_utf8(output.stdout)?)?;\n    let marker = format!(\"{preset_name}:{major}\\n\");\n    if data.exists() {\n        let existing = std::fs::read_to_string(data.join(\".mise-daemon-version\"))\n            .wrap_err(\"daemon data was not initialized completely; inspect it and migrate or reset it explicitly\")?;\n        if existing != marker {\n            bail!(\n                \"incompatible {preset_name} data in {} (stored {}, current {}); migrate or reset it explicitly\",\n                data.display(),\n                existing.trim(),\n                marker.trim()\n            );\n        }\n        if preset_name == \"postgres\"\n            && std::fs::read_to_string(data.join(\"PG_VERSION\"))\n                .wrap_err(\"daemon data was not initialized completely; missing PG_VERSION\")?\n                .trim()","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/daemons/presets.rs#L172-L208","documentation":"initialize runs `<preset binary> --version` to determine the major version used for the version marker file; if the command exits with a non-success status, mise cannot determine the binary's version and bails out.","triggerScenarios":"The preset binary exists but `--version` exits non-zero (crash, bad install, missing libraries, permission problem) during daemon data initialization.","commonSituations":"Broken or partially installed postgres in the mise tool directory; binary fails due to missing shared libraries; wrong binary resolved on PATH.","solutions":["Run `<binary> --version` manually to see the actual failure and fix the installation","Reinstall the tool version providing the binary (e.g. `mise install postgres`)","Fix PATH so a working binary is selected"],"exampleFix":"// before: broken install\n$ postgres --version && echo ok  # exits non-zero\n// after\nmise install postgres@16 && mise daemon start","handlingStrategy":"try-catch","validationCode":"# pre-check the binary works\n\"$HOME/.local/share/mise/installs/postgres/*/bin/postgres\" --version || echo 'binary broken'","typeGuard":null,"tryCatchPattern":"catch (e) { if (/unable to determine .* version/.test(e.message)) { reinstallTool(); } }","preventionTips":["Run `mise doctor` if tools misbehave","Reinstall tool versions after OS upgrades","Don't shadow mise-installed binaries with broken wrappers"],"tags":["daemon","command-failed","version-detection"],"backgroundTag":"command-not-found","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"}