{"record":{"id":"e3e0ac7e7202b720","repo":"zed-industries/zed","slug":"command-failed","errorCode":null,"errorMessage":"Command '{:?}' failed: {}","messagePattern":"Command '(.+?)' failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/remote/src/transport/wsl.rs","lineNumber":713,"sourceCode":"    let wsl_path_str = wsl_path.to_string_lossy().to_string();\n    let command = wsl_command_impl(options, \"wslpath\", &[\"-w\", &wsl_path_str], true);\n    async move {\n        let windows_path = run_wsl_command_impl(command).await?;\n        Ok(PathBuf::from(windows_path))\n    }\n}\n\nfn run_wsl_command_impl(\n    mut command: util::command::Command,\n) -> impl Future<Output = Result<String>> {\n    async move {\n        let output = command\n            .output()\n            .await\n            .with_context(|| format!(\"Failed to run command '{:?}'\", command))?;\n\n        if !output.status.success() {\n            return Err(anyhow!(\n                \"Command '{:?}' failed: {}\",\n                command,\n                String::from_utf8_lossy(&output.stderr).trim()\n            ));\n        }\n\n        Ok(String::from_utf8_lossy(&output.stdout).trim().to_owned())\n    }\n}\n\n/// Creates a new `wsl.exe` command that runs the given program with the given arguments.\n///\n/// If `exec` is true, the command will be executed in the WSL environment without spawning a new shell.\nfn wsl_command_impl(\n    options: &WslConnectionOptions,\n    program: &str,\n    args: &[impl AsRef<OsStr>],\n    exec: bool,","sourceCodeStart":695,"sourceCodeEnd":731,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/remote/src/transport/wsl.rs#L695-L731","documentation":"In run_wsl_command_impl: the `wsl.exe` invocation either failed to spawn (context 'Failed to run command') or exited with a non-success status; the error embeds the command and stderr/stdout. Underlies all WSL helper commands (wslpath, cp, etc.).","triggerScenarios":"Thrown at crates/remote/src/transport/wsl.rs:713 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the WSL distro is installed and running","Inspect the included output for the wsl.exe error"],"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"}