{"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":"validation","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/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/generate/tool_stub.rs#L752-L788","documentation":"This error is thrown by `lock_stub` when the stub output file (`--output` path) does not exist at the time `mise generate tool-stub --lock` runs. Locking pins checksums into an existing stub file, so the file must already have been generated.","triggerScenarios":"Running `mise generate tool-stub <tool> --lock` without first generating the stub, or with an --output path that differs from where the stub was written.","commonSituations":"Typos in the --output path; running --lock from a different directory with a relative path; deleting or renaming the stub after generation and then attempting to lock.","solutions":["Generate the stub first: mise generate tool-stub <tool> --url ... (without --lock), then run --lock","Verify the --output path matches the actual stub file location (use an absolute path)","cd to the directory containing the stub or fix the relative path"],"exampleFix":"// before\nmise generate tool-stub mytool --lock  # stub never generated\n// after\nmise generate tool-stub mytool --url https://example.com/mytool.tar.gz\nmise generate tool-stub mytool --lock","handlingStrategy":"validation","validationCode":"STUB_PATH=\"stubs/mytool.toml\"\nif [[ ! -f \"$STUB_PATH\" ]]; then\n  echo \"stub missing; generate it first\" >&2\n  mise generate tool-stub mytool --url \"$URL\" --output \"$STUB_PATH\"\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate the stub before running --lock","Use absolute --output paths to avoid cwd-related mismatches","Don't rename or move stub files between generation and locking steps"],"tags":["tool-stub","file-not-found","cli"],"backgroundTag":"file-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"}