{"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":649,"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":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/plugins/core/rust.rs#L631-L667","documentation":"In outdated_info, mise runs `rustup check` unchecked because exit code 100 means 'updates available', not failure. Any other non-zero exit code (and any unknown/null exit code, treated as -1) is a real failure and is wrapped in this error along with rustup's trimmed stderr.","triggerScenarios":"Running `mise outdated` / version-check paths for rust when `rustup check` exits with a code other than 0 or 100: rustup binary missing/broken, network failure reaching the release server, corrupted RUSTUP_HOME, or rustup killed by a signal (null exit code → -1).","commonSituations":"Offline CI runners where rustup check cannot reach static.rust-lang.org; broken rustup installs; proxy/firewall blocking rustup's telemetry; a non-rustup `rustup` shim on PATH that exits with an unexpected code.","solutions":["Read the stderr in the message and run `rustup check` manually to reproduce the failure.","Fix network/proxy access to rust's release servers (set HTTPS_PROXY or allowlist static.rust-lang.org).","Repair or reinstall rustup (`rustup self update`, or fresh install).","Ensure the `rustup` on PATH is the real rustup, not a shim returning unexpected exit codes."],"exampleFix":"// before: offline CI\n$ mise outdated\ncommand [\"rustup\", \"check\"] exited with code 1. stderr: error: could not download...\n// after: configure proxy in CI\nexport HTTPS_PROXY=http://proxy.internal:8080\n$ mise outdated","handlingStrategy":"try-catch","validationCode":"match std::process::Command::new(\"rustup\").arg(\"check\").output() {\n    Ok(o) if o.status.code().map_or(true, |c| c != 0 && c != 100) => {\n        eprintln!(\"rustup check unhealthy: {}\", String::from_utf8_lossy(&o.stderr));\n    }\n    _ => {}\n}","typeGuard":null,"tryCatchPattern":"match outcome {\n    Err(e) if e.to_string().contains(\"command [\\\"rustup\\\", \\\"check\\\"]\") => {\n        eprintln!(\"fix rustup/network before checking outdated rust: {}\", e);\n        // check connectivity to static.rust-lang.org, reinstall rustup\n    }\n    ...\n}","preventionTips":["Ensure CI has network/proxy access to static.rust-lang.org.","Run `rustup check` in your environment before `mise outdated` to catch breakage early.","Keep rustup healthy with periodic `rustup self update`.","Don't shadow the real rustup binary with shims returning odd exit codes."],"tags":["rust","rustup","network","exit-code","subprocess"],"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"}