{"record":{"id":"9e266abc0d85b194","repo":"jdx/mise","slug":"remote-cleanup-failed-with-status","errorCode":null,"errorMessage":"remote cleanup failed with {status}","messagePattern":"remote cleanup failed with (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/system/remote.rs","lineNumber":2105,"sourceCode":"                    shell_quote(remote)\n                ),\n            ],\n            file,\n        )\n        .await\n    }\n\n    async fn cleanup(&self, path: &str) -> Result<()> {\n        validate_staging_path(path)?;\n        let mut command = tokio::process::Command::new(&self.ssh);\n        command\n            .args(self.args(false, &[\"rm\", \"-rf\", \"--\", path]))\n            .kill_on_drop(true);\n        let status = tokio::time::timeout(std::time::Duration::from_secs(5), command.status())\n            .await\n            .map_err(|_| eyre!(\"remote cleanup timed out\"))??;\n        if !status.success() {\n            bail!(\"remote cleanup failed with {status}\");\n        }\n        Ok(())\n    }\n\n    async fn close(&self) {\n        let Some(control_path) = &self.control_path else {\n            return;\n        };\n        let mut command = tokio::process::Command::new(&self.ssh);\n        command\n            .kill_on_drop(true)\n            .args([\"-S\"])\n            .arg(control_path)\n            .args([\"-O\", \"exit\"])\n            .arg(self.host.destination())\n            .stdout(Stdio::null())\n            .stderr(Stdio::null());\n        let status =","sourceCodeStart":2087,"sourceCodeEnd":2123,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/remote.rs#L2087-L2123","documentation":"After running bootstrap work on the remote host, mise cleans up its staging directory with a remote `rm -rf` that is wrapped in a 5-second timeout. This error fires when the cleanup command exits non-zero within the timeout.","triggerScenarios":"The remote `rm -rf -- <staging path>` command (under `self.args(false, ...)`, i.e. without the interactive flag) returns a non-zero status — for example the staging path was already removed, permissions changed, or the SSH session is failing.","commonSituations":"Concurrent jobs deleting the same /tmp/mise-bootstrap.* directory, remote filesystem issues, or an SSH connection that is half-broken (auth works for some commands but the channel dies).","solutions":["Check whether the staging directory still exists remotely: `ssh <host> ls -d /tmp/mise-bootstrap.*` — if it is already gone, the failure is cosmetic.","Verify the remote user can delete its own /tmp/mise-bootstrap.* directories (sticky-bit /tmp ownership).","Inspect SSH health (`ssh <host> true`) and re-run; a transient connection drop is the usual cause.","Manually remove leftovers: `ssh <host> rm -rf /tmp/mise-bootstrap.*`."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match cleanup_remote().await {\n    Err(e) if e.to_string().contains(\"remote cleanup failed\") => {\n        // usually benign (already removed); optionally force-clean:\n        let _ = ssh(&[host, \"rm\", \"-rf\", \"/tmp/mise-bootstrap.*\"]).await;\n    }\n    other => other?,\n}","preventionTips":["Avoid running concurrent bootstrap jobs for the same host and user","Ensure the remote user owns its /tmp/mise-bootstrap.* directories","Keep SSH sessions healthy; re-run once on transient failures"],"tags":["ssh","remote-execution","cleanup"],"backgroundTag":"command-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}