{"record":{"id":"e570df7771405e16","repo":"jdx/mise","slug":"remote-command-on-name-failed-with","errorCode":null,"errorMessage":"remote command on '{name}' failed with {}: {}","messagePattern":"remote command on '(.+?)' failed with (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":2139,"sourceCode":"            .args([\"-O\", \"exit\"])\n            .arg(self.host.destination())\n            .stdout(Stdio::null())\n            .stderr(Stdio::null());\n        let status =\n            tokio::time::timeout(std::time::Duration::from_secs(2), command.status()).await;\n        if !matches!(status, Ok(Ok(status)) if status.success()) {\n            debug!(\n                \"SSH control connection for {} did not confirm closure (failed or timed out)\",\n                self.host.name\n            );\n        }\n    }\n}\n\nfn checked_output(output: Output, name: &str) -> Result<String> {\n    if !output.status.success() {\n        let stderr = String::from_utf8_lossy(&output.stderr);\n        bail!(\n            \"remote command on '{name}' failed with {}: {}\",\n            output.status,\n            stderr.trim()\n        );\n    }\n    Ok(String::from_utf8(output.stdout)?)\n}\n\nfn resolve_local_path(base: &Path, path: Option<&Path>) -> Result<Option<PathBuf>> {\n    path.map(|path| {\n        let path = crate::file::replace_path(path);\n        let path = if path.is_absolute() {\n            path\n        } else {\n            base.join(path)\n        };\n        absolutize(&path)\n    })","sourceCodeStart":2121,"sourceCodeEnd":2157,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote.rs#L2121-L2157","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the stderr portion of the message — it contains the remote error (e.g. permission denied, not found) and fix that specific cause","Confirm the remote machine's architecture/OS matches the uploaded binary (`uname -m` on the host)","Test the failing command manually over `ssh <host> <cmd>` to reproduce and debug outside mise"],"exampleFix":"// before\nError: remote command on 'host' failed with exit status: 126: /tmp/mise-bootstrap.abc/mise: cannot execute binary file: Exec format error\n# -> uploaded x86_64 binary onto aarch64 host\n// after\n# upload the matching build or let mise download the right one on the host\nssh host uname -m   # aarch64\nmise remote-upload --arch aarch64 ssh://host","handlingStrategy":"try-catch","validationCode":"# reproduce the remote command manually before running mise\nssh \"$host\" 'mktemp -d /tmp/mise-bootstrap.XXXXXX' || exit 1\nssh \"$host\" 'uname -m'   # confirm arch matches the uploaded binary","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"failed with\") => {\n        // message carries remote stderr — surface it directly\n        eprintln!(\"remote step failed: {e}\");\n        std::process::exit(1);\n    }\n    other => other?,\n}","preventionTips":["Match the uploaded mise binary to the remote arch/OS (`uname -m`)","Test restrictive shells (rbash, limited sudo) beforehand","Keep remote shell profiles quiet so stderr reflects real errors"],"tags":["remote","ssh","process-exit","command-execution"],"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"}