jdx/mise · error · eyre::Report

remote command on '{}' failed with {status}

Error message

remote command on '{}' failed with {status}

What it means

Thrown by SshSession::status after an ssh-invoked remote command exits with a non-zero status. This is a pass-through: the status is whatever the remote command (or ssh itself) returned — a failing remote mise invocation, a missing remote executable, or ssh-level failures such as authentication errors and connection timeouts (ssh conventionally exits 255). The message names the configured host and the raw exit status.

Source

Thrown at src/system/remote.rs:1522

        }
        args.push(self.host.destination());
        args.push(shell_words::join(remote_argv));
        args
    }

    fn output(&self, remote_argv: &[&str]) -> Result<String> {
        let args = self.args(false, remote_argv);
        info!("$ {} {}", self.ssh.display(), shell_words::join(&args));
        let output = Command::new(&self.ssh).args(&args).output()?;
        checked_output(output, &self.host.name)
    }

    fn status(&self, remote_argv: &[&str], tty: bool) -> Result<()> {
        let args = self.args(tty, remote_argv);
        info!("$ {} {}", self.ssh.display(), shell_words::join(&args));
        let status = Command::new(&self.ssh).args(args).status()?;
        if !status.success() {
            bail!(
                "remote command on '{}' failed with {status}",
                self.host.name
            );
        }
        Ok(())
    }

    fn status_with_stdin(&self, remote_argv: &[&str], input: File) -> Result<()> {
        let args = self.args(false, remote_argv);
        info!("$ {} {}", self.ssh.display(), shell_words::join(&args));
        let status = Command::new(&self.ssh)
            .args(args)
            .stdin(Stdio::from(input))
            .status()?;
        if !status.success() {
            bail!("remote upload to '{}' failed with {status}", self.host.name);
        }
        Ok(())

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Reproduce manually to see stderr: ssh <user@host> '<the same command>' — mise only surfaces the exit code here
  2. If ssh itself failed (255), fix connectivity/auth: check port, identity_file, ConnectTimeout, and BatchMode=yes (no password prompt when stderr is not a TTY)
  3. If the remote command legitimately failed, fix the remote side; the exit code is faithfully propagated, not a mise bug
  4. Run 'mise --version' equivalent on the remote (ssh host 'mise version') to confirm the remote install is healthy

Example fix

# diagnose: the error only carries the exit status
ssh -o ConnectTimeout=10 deploy@web-1 'mise exec -- node -v'
# e.g. output: bash: mise: command not found  -> remote_mise path wrong

# fix (mise.toml)
[bootstrap.remote.hosts.web]
host = "deploy@web-1"
remote_mise = "/usr/local/bin/mise"  # absolute path that exists on the remote
Defensive patterns

Strategy: try-catch

Validate before calling

# Pre-flight the exact remote command and ssh auth before automating:
ssh -o ConnectTimeout=10 -o BatchMode=yes deploy@web-1 'mise version && <your-command> --dry-run' || {
  echo "remote precondition failed; fix auth/installation first"
}

Try / catch

match session.status(&argv, tty) {
    Err(e) => {
        let msg = e.to_string();
        if let Some(code) = msg.rsplit(' ').next().and_then(|s| s.trim().parse::<i32>().ok()) {
            if code == 255 {
                return Err(e.wrap_err("ssh itself failed (auth/connectivity), not the remote command"));
            }
            std::process::exit(code); // propagate the remote command's real exit code
        }
        return Err(e);
    }
    Ok(()) => {}
}

Prevention

When it happens

Trigger: Any remote command mise runs on your behalf failing: the actual task command exiting non-zero (intended propagation), 'remote_mise version' failing because the remote mise is broken, or ssh exiting 255 on unreachable host / bad key / refused connection.

Common situations: Deployed command genuinely fails on the remote; remote mise installation broken after bootstrap; wrong port/identity_file in the host config; sshd rate limits or DNS problems surfacing as 255.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/e1b246a1ec584611. Report an issue: GitHub.