{"record":{"id":"20557f873039f996","repo":"zed-industries/zed","slug":"failed-to-run-command-command-20557f","errorCode":null,"errorMessage":"failed to run command {command:?}: {}","messagePattern":"failed to run command (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/remote/src/transport/ssh.rs","lineNumber":1395,"sourceCode":"        if !allow_pseudo_tty {\n            command.arg(\"-T\");\n        }\n        command.arg(to_run);\n        log::debug!(\"ssh {:?}\", command);\n        command\n    }\n\n    async fn run_command(\n        &self,\n        shell_kind: ShellKind,\n        program: &str,\n        args: &[impl AsRef<str>],\n        allow_pseudo_tty: bool,\n    ) -> Result<String> {\n        let mut command = self.ssh_command(shell_kind, program, args, allow_pseudo_tty);\n        let output = command.output().await?;\n        log::debug!(\"{:?}: {:?}\", command, output);\n        anyhow::ensure!(\n            output.status.success(),\n            \"failed to run command {command:?}: {}\",\n            String::from_utf8_lossy(&output.stderr)\n        );\n        Ok(String::from_utf8_lossy(&output.stdout).to_string())\n    }\n\n    fn ssh_options<'a>(\n        &self,\n        command: &'a mut util::command::Command,\n        include_port_forwards: bool,\n        deny_args: Option<&[&str]>,\n    ) -> &'a mut util::command::Command {\n        let mut args = if include_port_forwards {\n            self.connection_options.additional_args()\n        } else {\n            self.connection_options.additional_args_for_scp()\n        };","sourceCodeStart":1377,"sourceCodeEnd":1413,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/remote/src/transport/ssh.rs#L1377-L1413","documentation":"In SshRemoteConnection::run_command: the assembled `ssh` command exited non-zero; ensure! raises this error embedding the command and its output. Covers any failing remote shell invocation (probe, os version, shell detection, etc.).","triggerScenarios":"Thrown at crates/remote/src/transport/ssh.rs:1395 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify SSH connectivity and credentials to the host","Inspect the included output for the remote error","Check that the remote shell isn't blocking non-interactive commands"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}