{"record":{"id":"52dfbaa57dd6b323","repo":"jdx/mise","slug":"bail-msg-dynamic-message-uninstalled-tool-mes","errorCode":null,"errorMessage":"bail!(msg) — dynamic message: uninstalled tool message from which.rs uninstalled_tool_message()","messagePattern":"bail!\\(msg\\) — dynamic message: uninstalled tool message from which\\.rs uninstalled_tool_message\\(\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/which.rs","lineNumber":75,"sourceCode":"        }\n        let ts = self.get_toolset(&config).await?;\n\n        let bin_name = self.bin_name.clone().unwrap();\n        match ts.which(&config, &bin_name).await {\n            Some((p, tv)) => {\n                if self.version {\n                    miseprintln!(\"{}\", tv.version);\n                } else if self.plugin {\n                    miseprintln!(\"{p}\");\n                } else {\n                    let path = p.which(&config, &tv, &bin_name).await?;\n                    miseprintln!(\"{}\", path.unwrap().display());\n                }\n                Ok(())\n            }\n            None => {\n                if let Some(msg) = self.uninstalled_tool_message(&config, &ts) {\n                    bail!(msg);\n                }\n                if let Some(msg) =\n                    crate::shims::unavailable_configured_tool_message(&config, &ts, &bin_name)\n                {\n                    bail!(msg);\n                }\n                if self.has_shim(&bin_name) {\n                    bail!(\n                        \"{bin_name} is a mise bin however it is not currently active. Use `mise use` to activate it in this directory.\"\n                    )\n                } else {\n                    bail!(\"{bin_name} is not a mise bin. Perhaps you need to install it first.\",)\n                }\n            }\n        }\n    }\n    async fn complete(&self, config: &Arc<Config>) -> Result<()> {\n        let ts = self.get_toolset(config).await?;","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/which.rs#L57-L93","documentation":"mise's `mise which <bin>` failed because the binary resolves to a configured tool version that is not installed on disk. Rather than saying 'not a tool', mise detects that the toolset pins the tool and emits a targeted message (from uninstalled_tool_message()) telling the user the tool exists in config but has never been installed. This is a user-environment error, not an internal bug.","triggerScenarios":"Running `mise which <bin>` (or a shim calling which) when config (mise.toml/.tool-versions) pins a tool version whose install directory does not exist, e.g. after cloning a repo with a mise.toml on a fresh machine, after deleting ~/.local/share/mise/installs, or with MISE_XX_VERSION pinned to an uninstalled version.","commonSituations":"Fresh checkout of a project without running `mise install`; CI containers with config files but no installed tools; moving/cleaning the mise data directory; disk cleanup removing installs while config still references them.","solutions":["Run `mise install` to install all tools pinned in the active config files.","Run `mise install <tool>@<version>` to install just the tool mentioned in the message.","Run `mise ls` to compare installed vs configured versions and spot gaps.","If the version in config is no longer wanted, update mise.toml/.tool-versions to an installed version."],"exampleFix":"// shell: before (fresh clone)\nmise which node\n# error: node@22.1.0 is not installed\n// after\nmise install\nmise which node\n# /home/user/.local/share/mise/installs/node/22.1.0/bin/node","handlingStrategy":"validation","validationCode":"# before relying on `mise which <bin>`\nmise ls --installed | grep '<tool>' || mise install","typeGuard":null,"tryCatchPattern":"if ! out=$(mise which \"$bin\" 2>/dev/null); then mise install; fi","preventionTips":["Run `mise install` immediately after cloning a repo with mise.toml.","Include `mise install` as the first CI step before any tool invocation.","Avoid manually deleting ~/.local/share/mise/installs entries."],"tags":["cli","tools","not-installed","environment"],"backgroundTag":"resource-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}