{"record":{"id":"e66124b9311cb218","repo":"jdx/mise","slug":"rustup-show-profile-failed-for","errorCode":null,"errorMessage":"rustup show profile failed for {}: {}","messagePattern":"rustup show profile failed for (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/core/rust.rs","lineNumber":273,"sourceCode":"                .map(String::from)\n                .collect(),\n        ))\n    }\n\n    /// Returns the profile rustup applies when an install omits `--profile`.\n    fn rustup_default_profile(&self, tv: &ToolVersion, runtime: &RustRuntime) -> Result<String> {\n        let args = vec![\"show\".to_string(), \"profile\".to_string()];\n        let mut cmd = cmd(runtime.bin_dir.join(RUSTUP_BIN), args)\n            .env(\"PATH\", rustup_path_env(runtime)?)\n            .stdout_capture()\n            .stderr_capture()\n            .unchecked();\n        for (key, value) in rustup_env(&runtime.homes, &tv.version) {\n            cmd = cmd.env(key, value);\n        }\n        let output = cmd.run()?;\n        if !output.status.success() {\n            bail!(\n                \"rustup show profile failed for {}: {}\",\n                tv.style(),\n                String::from_utf8_lossy(&output.stderr).trim()\n            );\n        }\n        let profile = String::from_utf8_lossy(&output.stdout).trim().to_string();\n        if profile.is_empty() {\n            bail!(\n                \"rustup show profile returned an empty profile for {}\",\n                tv.style()\n            );\n        }\n        Ok(profile)\n    }\n\n    fn missing_components(\n        &self,\n        requested: &[String],","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/plugins/core/rust.rs#L255-L291","documentation":"Before reading the default rustup profile, mise runs `rustup show profile` with rustup-specific env and requires the command to exit successfully. If the process exits non-zero, the error propagates rustup's trimmed stderr so the user can see why rustup failed (missing toolchain, broken install, corrupted settings).","triggerScenarios":"Called from is_install_satisfied or install_version_ via rustup_default_profile when `rustup show profile` exits non-zero: rustup not properly installed, RUSTUP_HOME corrupted, toolchain config unreadable, or rustup env (homes/version) pointing at a broken install.","commonSituations":"rustup partially uninstalled or home directory moved; RUSTUP_HOME/CARGO_HOME env conflicts; running inside a sandbox/CI container where rustup's settings.toml is missing or unwritable; a rustup update in progress.","solutions":["Run `rustup show profile` manually and fix the underlying rustup error reported in stderr.","Reinstall or repair rustup (`rustup self update`, or reinstall from rustup.rs).","Verify RUSTUP_HOME/CARGO_HOME point to a valid, readable rustup installation; unset conflicting overrides in mise config.","Ensure a default toolchain exists (`rustup toolchain install stable && rustup default stable`)."],"exampleFix":"// before: broken RUSTUP_HOME override in mise.toml\n[env]\nRUSTUP_HOME = \"/nonexistent\"\n// after: remove the override or point at the real rustup home\n[env]\n# RUSTUP_HOME removed — use system default","handlingStrategy":"try-catch","validationCode":"let ok = std::process::Command::new(\"rustup\").args([\"show\", \"profile\"]).output().map(|o| o.status.success());\nif !ok.unwrap_or(false) { eprintln!(\"rustup is broken or missing; run `rustup show profile` to diagnose\"); }","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"rustup show profile failed\") => {\n        eprintln!(\"repair rustup first: {}\", e);\n        // run `rustup show profile` manually / reinstall rustup\n    }\n    ...\n}","preventionTips":["Keep rustup up to date with `rustup self update`.","Avoid overriding RUSTUP_HOME/CARGO_HOME in mise [env] unless intentional.","Ensure a default toolchain is installed before using mise's rust plugin.","In CI, install rustup before running mise install for rust."],"tags":["rust","rustup","subprocess","stderr"],"backgroundTag":"command-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"}