{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/core/rust.rs#L255-L291","documentation":"When resolving the default rustup profile for a Rust tool version, mise runs `rustup show` with rustup-managed environment variables and treats a non-zero exit as fatal, embedding rustup's stderr. This guards install-satisfaction checks and installs against a broken or misbehaving rustup toolchain manager.","triggerScenarios":"Calling install_version_ or is_install_satisfied for a rust tool version when the spawned `rustup show profile` command exits non-zero — e.g. rustup not functioning, a broken RUSTUP_HOME, corrupt toolchain metadata, or rustup emitting an error to stderr.","commonSituations":"Corrupt or partial rustup installation in RUSTUP_HOME; incompatible rustup version; environment variables pointing at a stale rustup home; rustup update in progress or failed mid-upgrade leaving bad state.","solutions":["Run `rustup show` manually with the same environment to see the underlying stderr and fix rustup","Repair or reinstall rustup (`rustup self update`, or re-run rustup-init)","Check that RUSTUP_HOME/CARGO_HOME used by mise's rustup_env point to valid, complete directories"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const { execSync } = require('child_process');\ntry { execSync('rustup show', { stdio: 'pipe' }); } catch { console.error('rustup is broken; repair before mise install'); }","typeGuard":null,"tryCatchPattern":"try { await miseInstall('rust', version); } catch (e) { if (String(e).includes('rustup show profile failed')) { console.error('Run `rustup show` manually and repair rustup:', e.message); } else throw e; }","preventionTips":["Keep rustup updated with `rustup self update`","Verify RUSTUP_HOME/CARGO_HOME point to complete directories","Run `rustup show` after system upgrades or rustup changes before relying on mise rust installs"],"tags":["rust","rustup","subprocess-failure","core-plugin"],"backgroundTag":"command-failed","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"}