{"record":{"id":"849997085dc2a4b8","repo":"jdx/mise","slug":"tool-stub-file-does-not-exist","errorCode":null,"errorMessage":"Tool stub file does not exist: {}","messagePattern":"Tool stub file does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/tool_stub.rs","lineNumber":770,"sourceCode":"        // Strategy 3: If there's only one executable total, use it\n        if executables.len() == 1 {\n            return Ok(executables[0].clone());\n        }\n\n        // No good match found, provide helpful error message\n        let mut exe_list = executables.to_vec();\n        exe_list.sort();\n\n        bail!(\n            \"Could not determine which executable to use for '{}'. Available executables:\\n  {}\\n\\nUse --bin to specify the correct binary path.\",\n            tool_name,\n            exe_list.join(\"\\n  \")\n        );\n    }\n\n    async fn lock_stub(&self) -> Result<String> {\n        if !self.output.exists() {\n            bail!(\n                \"Tool stub file does not exist: {}\",\n                display_path(&self.output)\n            );\n        }\n\n        let mut stub = ToolStubFile::from_file(&self.output)?;\n        let config = Config::get().await?;\n\n        // Allow --version to override the version in the stub for bumping\n        if self.version != \"latest\" {\n            stub.version = self.version.clone();\n        }\n\n        // Create tool request and resolve version\n        let request = stub.to_tool_request(&self.output)?;\n        let backend = request.ba().backend()?;\n        let resolve_opts = ResolveOptions {\n            use_locked_version: false,","sourceCodeStart":752,"sourceCodeEnd":788,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/generate/tool_stub.rs#L752-L788","documentation":"`mise generate tool-stub --lock` (lock_stub) resolves and pins exact versions plus per-platform lock info into an existing tool stub file. It requires the output stub file to already exist because locking is an update operation, not a creation step. mise bails with this error when the --output path does not exist on disk.","triggerScenarios":"Running `mise generate tool-stub --lock --output <path>` (or the tool-stub lock code path) where self.output does not exist on disk — i.e. locking before ever generating the stub, or pointing --output at a wrong/typo'd path.","commonSituations":"Developers run `generate tool-stub --lock` on a fresh project without first generating the stub; the stub was deleted or moved after generation; the --output flag points at a path different from where the stub was actually written.","solutions":["First run `mise generate tool-stub --output <path>` without --lock to create the stub, then rerun with --lock.","Check the --output path for typos or a changed working directory; pass the exact existing stub path.","If the stub was deleted, regenerate it rather than trying to lock a missing file."],"exampleFix":"// before (fails: no stub yet)\nmise generate tool-stub --lock --output ./bin/tool\n// after\nmise generate tool-stub --output ./bin/tool\nmise generate tool-stub --lock --output ./bin/tool","handlingStrategy":"validation","validationCode":"# shell: check the stub exists before locking\n[ -f \"./bin/tool\" ] || mise generate tool-stub --output ./bin/tool\nmise generate tool-stub --lock --output ./bin/tool","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always generate the stub before running --lock or --checksums.","Use a single variable for the stub path across generate steps to avoid path drift.","In CI, order steps: generate -> lock -> fetch-checksums, each with the same --output."],"tags":["cli","tool-stub","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}