{"record":{"id":"2a140579b02f503f","repo":"jdx/mise","slug":"remote-upload-to-failed-with-status","errorCode":null,"errorMessage":"remote upload to '{}' failed with {status}","messagePattern":"remote upload to '(.+?)' failed with (.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":1538,"sourceCode":"        let status = Command::new(&self.ssh).args(args).status()?;\n        if !status.success() {\n            bail!(\n                \"remote command on '{}' failed with {status}\",\n                self.host.name\n            );\n        }\n        Ok(())\n    }\n\n    fn status_with_stdin(&self, remote_argv: &[&str], input: File) -> Result<()> {\n        let args = self.args(false, remote_argv);\n        info!(\"$ {} {}\", self.ssh.display(), shell_words::join(&args));\n        let status = Command::new(&self.ssh)\n            .args(args)\n            .stdin(Stdio::from(input))\n            .status()?;\n        if !status.success() {\n            bail!(\"remote upload to '{}' failed with {status}\", self.host.name);\n        }\n        Ok(())\n    }\n\n    fn upload_executable(&self, local: &Path, remote: &str) -> Result<()> {\n        let file = File::open(local)\n            .wrap_err_with(|| format!(\"failed to open mise binary {}\", local.display()))?;\n        self.status_with_stdin(\n            &[\n                \"sh\",\n                \"-c\",\n                &format!(\n                    \"cat > {} && chmod 700 {}\",\n                    shell_quote(remote),\n                    shell_quote(remote)\n                ),\n            ],\n            file,","sourceCodeStart":1520,"sourceCodeEnd":1556,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/remote.rs#L1520-L1556","documentation":"Thrown by SshSession::status_with_stdin when the binary-upload pipeline ('ssh host sh -c \"cat > <remote path> ...\"' with the file on stdin) exits non-zero. The upload is a streamed cat over ssh, so failures come from the remote side of that pipeline: unwritable/missing target directory, full disk, quota, connection drops mid-stream, or ssh-level auth/network errors.","triggerScenarios":"Remote staging directory does not exist or lacks write permission for the SSH user; remote filesystem full (exit from cat/dd); connection reset during a large binary transfer; ssh 255 because keys/BatchMode blocked auth.","commonSituations":"First deploy to a fresh host without the expected directory layout; small VPS disks filling up; restrictive umask/ACLs on shared hosts; flaky networks truncating long uploads.","solutions":["Check the remote preconditions: ssh <host> 'test -w <dir> && df -h <dir>' for the target directory and free space","Fix permissions/ownership of the remote target path for the configured SSH user","For ssh 255, resolve auth/connectivity (identity_file, port, ConnectTimeout) before retrying the upload","Retry after freeing disk space — mid-stream drops are transient on unstable links"],"exampleFix":"# before: upload target missing/unwritable\nssh deploy@web-1 'ls -ld /home/deploy/.local/share/mise'  # No such file or directory\n\n# fix on remote\nssh deploy@web-1 'mkdir -p ~/.local/share/mise && chmod u+w ~/.local/share/mise'\n\n# then re-run: mise bootstrap --host web-1","handlingStrategy":"retry","validationCode":"# Pre-flight the upload destination before triggering provisioning:\nssh deploy@web-1 'DIR=\"$(dirname /path/to/target)\"; test -d \"$DIR\" && test -w \"$DIR\" && df -h \"$DIR\" || echo PRECONDITION-FAILED'","typeGuard":null,"tryCatchPattern":"let mut attempt = 0;\nloop {\n    attempt += 1;\n    match session.upload_executable(&local, remote_path).await {\n        Err(e) if attempt < 3 && e.to_string().contains(\"remote upload\") => {\n            tokio::time::sleep(std::time::Duration::from_secs(2u64 * attempt)).await; // transient reset: backoff and retry\n        }\n        other => break other?,\n    }\n}","preventionTips":["Ensure the SSH user owns/can write the remote staging directory before first deploy","Monitor remote disk space; uploads fail mid-stream when full","Distinguish auth/255 failures (fix config) from mid-stream drops (safe to retry)"],"tags":["mise","ssh","file-upload","disk-full","permissions","remote-bootstrap"],"backgroundTag":"remote-file-upload-failed","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}