jdx/mise · error

command ["rustup", "check"] exited with code

Error message

command ["rustup", "check"] exited with code {}. stderr: {}

What it means

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.

Solutions

  1. Run `rustup check` manually to see the stderr message and fix the underlying rustup error
  2. Reinstall/update rustup (`rustup self update` or re-run rustup-init)
  3. Remove or fix toolchain references that rustup errors on (e.g. stale entries in rustup settings or missing toolchains)
Defensive patterns

Strategy: try-catch

Validate before calling

const { execSync } = require('child_process');
try { execSync('rustup check'); } catch (e) { console.error('rustup check fails; fix rustup before querying mise outdated'); }

Try / catch

try { await miseOutdated('rust'); } catch (e) { if (String(e).includes('rustup", "check"')) { console.error('rustup itself is failing:', e.message); } else throw e; }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/1176721d5d7692ed. Report an issue: GitHub.

Appendix: source

Thrown at src/plugins/core/rust.rs:651

        let v_re = regex!(r#"Update available : (.*) -> (.*)"#);
        if regex!(r"(\d+)\.(\d+)\.(\d+)").is_match(&tv.version) {
            let oi = OutdatedInfo::resolve(config, tv.clone(), bump, opts).await?;
            Ok(oi)
        } else {
            let ts = config.get_toolset().await?;
            let runtime = RustRuntime::resolve_recorded_for_tool_version(config, tv).await?;
            let mut cmd = cmd(runtime.bin_dir.join(RUSTUP_BIN), ["check"])
                .env("PATH", self.path_env_for_cmd(config, tv).await?);
            for (k, v) in self.exec_env(config, ts, tv).await? {
                cmd = cmd.env(k, v);
            }
            // rustup check returns exit code 100 when updates are available
            // This is not an error, so we use unchecked() and check status manually
            let result = cmd.stdout_capture().stderr_capture().unchecked().run()?;
            let exit_code = result.status.code().unwrap_or(-1);
            if exit_code != 0 && exit_code != 100 {
                let stderr = String::from_utf8_lossy(&result.stderr);
                eyre::bail!(
                    "command [\"rustup\", \"check\"] exited with code {}. stderr: {}",
                    exit_code,
                    stderr.trim()
                );
            }
            let out = String::from_utf8_lossy(&result.stdout);
            for line in out.lines() {
                if line.starts_with(&self.target_triple(tv))
                    && let Some(_cap) = v_re.captures(line)
                {
                    // let requested = cap.get(1).unwrap().as_str().to_string();
                    // let latest = cap.get(2).unwrap().as_str().to_string();
                    let oi = OutdatedInfo::new(config, tv.clone(), tv.version.clone())?;
                    return Ok(Some(oi));
                }
            }
            Ok(None)
        }

View on GitHub (pinned to 533346cc37)