{"record":{"id":"1176721d5d7692ed","repo":"jdx/mise","slug":"command-rustup-check-exited-with-code-s","errorCode":null,"errorMessage":"command [\"rustup\", \"check\"] exited with code {}. stderr: {}","messagePattern":"command \\[\"rustup\", \"check\"\\] exited with code (.+?)\\. stderr: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/core/rust.rs","lineNumber":651,"sourceCode":"        let v_re = regex!(r#\"Update available : (.*) -> (.*)\"#);\n        if regex!(r\"(\\d+)\\.(\\d+)\\.(\\d+)\").is_match(&tv.version) {\n            let oi = OutdatedInfo::resolve(config, tv.clone(), bump, opts).await?;\n            Ok(oi)\n        } else {\n            let ts = config.get_toolset().await?;\n            let runtime = RustRuntime::resolve_recorded_for_tool_version(config, tv).await?;\n            let mut cmd = cmd(runtime.bin_dir.join(RUSTUP_BIN), [\"check\"])\n                .env(\"PATH\", self.path_env_for_cmd(config, tv).await?);\n            for (k, v) in self.exec_env(config, ts, tv).await? {\n                cmd = cmd.env(k, v);\n            }\n            // rustup check returns exit code 100 when updates are available\n            // This is not an error, so we use unchecked() and check status manually\n            let result = cmd.stdout_capture().stderr_capture().unchecked().run()?;\n            let exit_code = result.status.code().unwrap_or(-1);\n            if exit_code != 0 && exit_code != 100 {\n                let stderr = String::from_utf8_lossy(&result.stderr);\n                eyre::bail!(\n                    \"command [\\\"rustup\\\", \\\"check\\\"] exited with code {}. stderr: {}\",\n                    exit_code,\n                    stderr.trim()\n                );\n            }\n            let out = String::from_utf8_lossy(&result.stdout);\n            for line in out.lines() {\n                if line.starts_with(&self.target_triple(tv))\n                    && let Some(_cap) = v_re.captures(line)\n                {\n                    // let requested = cap.get(1).unwrap().as_str().to_string();\n                    // let latest = cap.get(2).unwrap().as_str().to_string();\n                    let oi = OutdatedInfo::new(config, tv.clone(), tv.version.clone())?;\n                    return Ok(Some(oi));\n                }\n            }\n            Ok(None)\n        }","sourceCodeStart":633,"sourceCodeEnd":669,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/core/rust.rs#L633-L669","documentation":"mise runs `rustup check` to compute outdated info for Rust toolchains. rustup exits 100 when updates are merely available, so mise tolerates 0 and 100; any other exit code is treated as a real failure and reported with rustup's stderr, aborting the outdated-info query.","triggerScenarios":"Calling outdated_info (e.g. `mise outdated rust` or equivalent internal path) when `rustup check` exits with an unexpected code — rustup binary missing/corrupt, network-triggered rustup internal errors, or a broken toolchain config causing rustup to error (typically exit 1 or 2).","commonSituations":"rustup not installed or on PATH but broken; damaged RUSTUP_HOME; rustup failing on a nonexistent pinned toolchain referenced by the project; transient rustup internal errors.","solutions":["Run `rustup check` manually to see the stderr message and fix the underlying rustup error","Reinstall/update rustup (`rustup self update` or re-run rustup-init)","Remove or fix toolchain references that rustup errors on (e.g. stale entries in rustup settings or missing toolchains)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const { execSync } = require('child_process');\ntry { execSync('rustup check'); } catch (e) { console.error('rustup check fails; fix rustup before querying mise outdated'); }","typeGuard":null,"tryCatchPattern":"try { await miseOutdated('rust'); } catch (e) { if (String(e).includes('rustup\", \"check\"')) { console.error('rustup itself is failing:', e.message); } else throw e; }","preventionTips":["Keep rustup healthy and updated","Clean stale toolchain references that rustup errors on","Run `rustup check` periodically to catch breakage early"],"tags":["rust","rustup","subprocess-failure","exit-code"],"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"}