jdx/mise · error

remote command on ' ' failed with

Error message

remote command on '{name}' failed with {}: {}

What it means

`checked_output` runs a remote command over SSH and, if the process exits non-success, bails with the status and trimmed stderr of the remote command. It is the generic 'your remote command failed' error for all remote-exec interactions in the remote bootstrap flow.

Solutions

  1. Read the stderr portion of the message — it contains the remote error (e.g. permission denied, not found) and fix that specific cause
  2. Confirm the remote machine's architecture/OS matches the uploaded binary (`uname -m` on the host)
  3. Test the failing command manually over `ssh <host> <cmd>` to reproduce and debug outside mise

Example fix

// before
Error: remote command on 'host' failed with exit status: 126: /tmp/mise-bootstrap.abc/mise: cannot execute binary file: Exec format error
# -> uploaded x86_64 binary onto aarch64 host
// after
# upload the matching build or let mise download the right one on the host
ssh host uname -m   # aarch64
mise remote-upload --arch aarch64 ssh://host
Defensive patterns

Strategy: try-catch

Validate before calling

# reproduce the remote command manually before running mise
ssh "$host" 'mktemp -d /tmp/mise-bootstrap.XXXXXX' || exit 1
ssh "$host" 'uname -m'   # confirm arch matches the uploaded binary

Try / catch

match result {
    Err(e) if e.to_string().contains("failed with") => {
        // message carries remote stderr — surface it directly
        eprintln!("remote step failed: {e}");
        std::process::exit(1);
    }
    other => other?,
}

Prevention

When it happens

Trigger: Any remote command executed via the SSH transport (mktemp, mv, chmod, the mise bootstrap itself) exits non-zero; stderr from the remote host is surfaced in the message after the status.

Common situations: Remote mktemp missing or restricted TMPDIR; `mv`/`chmod` denied due to permissions; the uploaded mise binary failing to run remotely (wrong arch, missing interpreter); restrictive remote shell profiles emitting errors.

Related errors


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

Appendix: source

Thrown at src/system/remote.rs:2139

            .args(["-O", "exit"])
            .arg(self.host.destination())
            .stdout(Stdio::null())
            .stderr(Stdio::null());
        let status =
            tokio::time::timeout(std::time::Duration::from_secs(2), command.status()).await;
        if !matches!(status, Ok(Ok(status)) if status.success()) {
            debug!(
                "SSH control connection for {} did not confirm closure (failed or timed out)",
                self.host.name
            );
        }
    }
}

fn checked_output(output: Output, name: &str) -> Result<String> {
    if !output.status.success() {
        let stderr = String::from_utf8_lossy(&output.stderr);
        bail!(
            "remote command on '{name}' failed with {}: {}",
            output.status,
            stderr.trim()
        );
    }
    Ok(String::from_utf8(output.stdout)?)
}

fn resolve_local_path(base: &Path, path: Option<&Path>) -> Result<Option<PathBuf>> {
    path.map(|path| {
        let path = crate::file::replace_path(path);
        let path = if path.is_absolute() {
            path
        } else {
            base.join(path)
        };
        absolutize(&path)
    })

View on GitHub (pinned to 533346cc37)