{"record":{"id":"b296aa4422f67036","repo":"jdx/mise","slug":"is-not-available-reason","errorCode":null,"errorMessage":"{} is not available: {reason}","messagePattern":"(.+?) is not available: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/system/prune.rs","lineNumber":82,"sourceCode":"            \"brew\" => self.run_brew().await,\n            \"brew-cask\" => self.run_brew_cask().await,\n            _ => self.run_plugin().await,\n        }\n    }\n\n    async fn run_plugin(self) -> Result<()> {\n        let discovered = system::packages::all_managers()\n            .into_iter()\n            .find(|manager| manager.name() == self.manager)\n            .ok_or_else(|| eyre::eyre!(\"unknown bootstrap package manager '{}'\", self.manager))?;\n        if !discovered.is_plugin() {\n            bail!(\n                \"package manager '{}' does not support pruning\",\n                self.manager\n            );\n        }\n        if let Some(reason) = discovered.unavailable_reason_async().await {\n            bail!(\"{} is not available: {reason}\", self.manager);\n        }\n        let manager = PackagePluginManager::new(self.manager.clone())?;\n        let config = Config::get().await?;\n        let configured = system::package_requests_for_manager_from_config_and_tracked_config_files(\n            &config,\n            &self.manager,\n        )\n        .await?;\n        let plan = manager.prune_plan(&configured).await?;\n        if plan.is_empty() {\n            if !self.dry_run {\n                manager.apply_prune_plan(&plan).await?;\n            }\n            info!(\"{}: nothing to prune\", self.manager);\n            return Ok(());\n        }\n        if !manager.supports_uninstall() {\n            bail!(","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/system/prune.rs#L64-L100","documentation":"After confirming the manager is a prune-capable plugin, `run_plugin` calls `unavailable_reason_async()` to check whether the underlying package manager tool is usable. If the plugin reports an availability problem (binary missing, unsupported platform, broken installation), mise aborts pruning with `'<manager>' is not available: <reason>`.","triggerScenarios":"Running `mise bootstrap packages prune --manager <plugin-manager>` when the manager's required executable cannot be found or initialized — e.g. the tool the plugin wraps is not installed or not on PATH.","commonSituations":"Plugin configured in `[bootstrap.packages]` but its backing CLI was uninstalled; running prune in a CI/container environment lacking the manager binary; PATH differences between the shell where install worked and where prune runs.","solutions":["Install the underlying package manager (or restore it to PATH) so the plugin reports available.","Run `mise bootstrap packages` / doctor-style checks to see the plugin's availability reason and fix that specific cause.","Prune from an environment where the manager works (same PATH/shell used for installs)."],"exampleFix":"// before\n$ mise bootstrap packages prune --manager myplugin\nerror: myplugin is not available: fooctl not found on PATH\n\n// after\n$ export PATH=\"$PATH:/opt/fooctl/bin\"\n$ mise bootstrap packages prune --manager myplugin","handlingStrategy":"fallback","validationCode":"# Ensure the manager's tool is reachable before pruning\ncommand -v \"$MANAGER_TOOL\" >/dev/null 2>&1 || { echo \"$MANAGER_TOOL missing\"; exit 1; }","typeGuard":null,"tryCatchPattern":"try {\n  await run(\"mise\", [\"bootstrap\",\"packages\",\"prune\",\"--manager\", m]);\n} catch (e) {\n  if (/is not available:/.test(e.message)) {\n    // read the reason after the colon and install/repair the tool\n  } else throw e;\n}","preventionTips":["Install the plugin's backing CLI in every environment where prune runs.","Run prune with the same PATH/shell profile used for installs.","Add availability checks to CI before prune steps."],"tags":["prune","plugin","dependency","cli"],"backgroundTag":"missing-dependency","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"}