{"record":{"id":"a05907dcee24dbfd","repo":"zed-industries/zed","slug":"cannot-sandbox-a-command-whose-paths-mix-wsl-distr","errorCode":null,"errorMessage":"cannot sandbox a command whose paths mix WSL distros `{}` and `{}`","messagePattern":"cannot sandbox a command whose paths mix WSL distros `(.+?)` and `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/sandbox/src/windows_wsl.rs","lineNumber":690,"sourceCode":"    }\n\n    Ok((cwd, writable_paths, resolved.flatten().collect()))\n}\n\nfn select_distro<'a>(\n    cwd: Option<&PathMapping>,\n    paths: impl IntoIterator<Item = &'a PathMapping>,\n) -> Result<Option<String>> {\n    let mut distro = cwd.and_then(|mapping| mapping.distro().map(str::to_string));\n    for mapping in paths {\n        let Some(path_distro) = mapping.distro() else {\n            continue;\n        };\n        match distro.as_deref() {\n            // A bad request, not an environment problem: the model (or\n            // project layout) asked for paths spanning two distros, which a\n            // single bwrap invocation can't serve.\n            Some(distro) => ensure!(\n                distro == path_distro,\n                \"cannot sandbox a command whose paths mix WSL distros `{}` and `{}`\",\n                distro,\n                path_distro\n            ),\n            None => distro = Some(path_distro.to_string()),\n        }\n    }\n    Ok(distro)\n}\n\n/// What [`probe_environment`] learned about a WSL distro.\n#[derive(Clone, Debug, Eq, PartialEq)]\nstruct EnvironmentProbe {\n    /// Whether the WSL interop socket directory (`/run/WSL`) exists and so\n    /// must (and can) be masked — see [`build_bwrap_args`].\n    mask_interop_dir: bool,\n    /// Absolute path of the `bwrap` binary the smoke test validated. The real","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/sandbox/src/windows_wsl.rs#L672-L708","documentation":"The command's cwd and writable paths resolve to different WSL distros; a single bwrap invocation cannot bind paths across distros. This is a bad request (model/project layout), not an environment problem.","triggerScenarios":"Thrown at crates/sandbox/src/windows_wsl.rs:690 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the cwd and all granted paths live in the same WSL distro","Explicitly select one distro and convert the offending paths before sandboxing"],"exampleFix":null,"handlingStrategy":"validation","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"}