{"record":{"id":"18702a3869ebb218","repo":"jdx/mise","slug":"daemon-requires-tool-version-but-tools-selects","errorCode":null,"errorMessage":"daemon {} requires {tool}@{version} ({}), but [tools] selects {}","messagePattern":"daemon (.+?) requires (.+?)@(.+?) \\((.+?)\\), but \\[tools\\] selects (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/daemons/runtime.rs","lineNumber":425,"sourceCode":"            .contains(&actual.version);\n        if compatible {\n            continue;\n        }\n        let requested = ToolRequest::new(\n            ba.into(),\n            version,\n            ToolSource::MiseTomlDaemon(daemon.source.clone()),\n        )?\n        .resolve(\n            config,\n            &crate::toolset::ResolveOptions {\n                offline: true,\n                ..Default::default()\n            },\n        )\n        .await?;\n        if actual.version != requested.version {\n            bail!(\n                \"daemon {} requires {tool}@{version} ({}), but [tools] selects {}\",\n                daemon.name,\n                requested.version,\n                actual.version\n            );\n        }\n    }\n    Ok(())\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    #[test]\n    #[cfg(unix)]\n    fn symlinked_roots_share_namespace_and_state() {\n        let tmp = tempfile::tempdir().unwrap();\n        let root = tmp.path().join(\"project\");","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/daemons/runtime.rs#L407-L443","documentation":"When the toolset's selected version for a daemon's tool does not satisfy the daemon's pinned version request, mise resolves the request offline and compares the concrete versions. If the selected version differs from what the daemon requires, it bails explaining exactly which daemon needs which version and what [tools] currently selects. This prevents daemons from silently running against a wrong major/minor of their backing tool.","triggerScenarios":"validate_tools finds ts.versions for the tool, but the first selected version fails `list_installed_versions_matching(version)` and offline ToolRequest::resolve yields a requested.version != actual.version — e.g. daemon pins postgres@16 while [tools] selects postgres = \"17\".","commonSituations":"Upgrading a tool in [tools] without updating the daemon's pinned version, or vice versa; two config files ([tools] in one, daemons in another) drifting apart; a teammate pinning a different major than your installed one.","solutions":["Align the daemon's version pin with [tools]: set both to the same version (e.g. postgres = \"16\" everywhere).","Run `mise install` so the required version is actually installed, then `mise ls postgres` to verify.","If the daemon pin is stale, update the [daemons] entry to the new version.","Check other config layers (global mise.toml, .tool-versions) that may be overriding the version selection."],"exampleFix":"// before\n[tools]\npostgres = \"17\"\n[daemons.db]\nversion = \"16\"\n\n// after\n[tools]\npostgres = \"17\"\n[daemons.db]\nversion = \"17\"","handlingStrategy":"validation","validationCode":"# Ensure [tools] version satisfies the daemon pin before starting\nmise ls postgres  # installed version must match the [daemons] version pin","typeGuard":null,"tryCatchPattern":"try {\n  await mise.daemons.start();\n} catch (e) {\n  const m = String(e).match(/daemon (\\S+) requires (\\S+)@(\\S+) \\((\\S+)\\), but \\[tools\\] selects (\\S+)/);\n  if (m) console.error(`Set ${m[2]} = \"${m[3]}\" in [tools] (or update the daemon pin).`);\n}","preventionTips":["Keep daemon version pins and [tools] versions in the same file/change","After tool upgrades, update daemon pins in the same commit","Audit global/config-layer overrides with `mise ls` when versions seem off"],"tags":["daemon","version-mismatch","mise-toml"],"backgroundTag":"version-mismatch","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"}