{"record":{"id":"06886a80a9b7fe15","repo":"jdx/mise","slug":"no-usable-shell-completion-for","errorCode":null,"errorMessage":"no usable {shell} completion for {}: {}","messagePattern":"no usable (.+?) completion for (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/packslip.rs","lineNumber":1267,"sourceCode":"            }\n        };\n        match attempt {\n            Ok(script) if script.trim().is_empty() => {\n                skipped.push(\"nothing was printed\".to_string())\n            }\n            Ok(script) => {\n                if ran_tool\n                    && let Some(dir) = cache.parent()\n                    && file::create_dir_all(dir).is_ok()\n                {\n                    let _ = file::write_atomic(&cache, &script);\n                }\n                return Ok(script);\n            }\n            Err(err) => skipped.push(err.to_string()),\n        }\n    }\n    bail!(\n        \"no usable {shell} completion for {}: {}\",\n        tv.style(),\n        skipped.join(\"; \")\n    )\n}\n\n/// Take turns generating, so that of the shells completing one command at\n/// once the first runs the tool and the rest read what it cached. The lock\n/// lives beside the cache, shared by every process that shares the install,\n/// and is taken off the runtime's threads.\n///\n/// A read-only install cannot be locked and does not need to be: nothing\n/// will be cached there either, so each shell generates its own script\n/// rather than being refused a completion.\nasync fn lock_generation(cache: &Path) -> Option<fslock::LockFile> {\n    let lock_path = cache.with_extension(\"lock\");\n    let taken = tokio::task::spawn_blocking(move || -> Result<fslock::LockFile> {\n        if let Some(dir) = lock_path.parent() {","sourceCodeStart":1249,"sourceCodeEnd":1285,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/packslip.rs#L1249-L1285","documentation":"completion_script tries every declared completion source in order (cached file, completion files, cli-spec derivation, exec generators). Each failed attempt is recorded; if every source fails or produces empty output, mise bails with this aggregate error listing all the individual skip reasons joined by '; '. It is the terminal error of the whole completion lookup.","triggerScenarios":"Running `mise completion <shell> --tool <tool>` when every declared source fails: cached file empty, completion files unreadable, spec format unsupported, exec generator returning nothing or erroring (e.g. the tool's completion subcommand missing).","commonSituations":"A tool whose completion generator command changed between versions; exec generator crashing; spec parse failures ('invalid usage specification'); read-only installs where files are unreadable; multiple simultaneous shells racing on generation.","solutions":["Read the joined reasons in the message to find the root cause of each failed source.","Reinstall the tool version to repopulate missing resources: `mise uninstall <tool> && mise install <tool>`.","Run the tool's own completion command manually to see if it errors (e.g. `<tool> --completion bash`).","Clear any stale/empty cache: remove resources/completions-v2/<bin>/ under the install path and retry.","Report or fix the packslip if its declared sources are all broken for this release."],"exampleFix":"// before\ncargo build  # tool renamed its completion command; exec source prints nothing\n// after: pin a release whose generator works, or add a static completion file\n[[resource]]\ntype = \"completion\"\npath = \"completions/mytool.bash\"","handlingStrategy":"try-catch","validationCode":"// Pre-check the cheapest source before invoking mise:\nlet tool_ok = std::process::Command::new(tool).arg(\"--help\").output().is_ok();","typeGuard":null,"tryCatchPattern":"match completion_script(&config, tool, shell) {\n    Ok(script) => install(script),\n    Err(e) => {\n        // e already lists every failed source, joined by \"; \"\n        eprintln!(\"completion generation failed: {e}\");\n        install_fallback_completion(tool, shell);\n    }\n}","preventionTips":["Read the joined per-source reasons in the message; they pinpoint the failing sources.","Keep completion generator commands stable across tool releases or declare static completion files.","Clear the completions-v2 cache if an interrupted generation left an empty file.","Avoid concurrent first-time completion generation across many shells on the same read-only install."],"tags":["completions","packslip","aggregate-error"],"backgroundTag":"empty-result-set","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"}