{"record":{"id":"69e20d0712457d01","repo":"zed-industries/zed","slug":"windows-sandboxing-via-wsl-can-only-grant-existing","errorCode":null,"errorMessage":"Windows sandboxing via WSL can only grant existing files or directories: {}","messagePattern":"Windows sandboxing via WSL can only grant existing files or directories: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/sandbox/src/windows_wsl.rs","lineNumber":1433,"sourceCode":"    ]);\n}\n\nfn directory_to_wsl(path: &Path) -> Result<PathMapping> {\n    ensure!(\n        path.is_dir(),\n        \"Windows sandboxing via WSL can only use an existing directory as cwd: {}\",\n        path.display()\n    );\n    map_path_to_wsl(path)\n}\n\nfn path_to_wsl(path: &Path) -> Result<PathMapping> {\n    let path_string = path.to_string_lossy();\n    if let Ok(path) = parse_wsl_absolute_path(&path_string) {\n        return Ok(PathMapping::Wsl(path));\n    }\n\n    ensure!(\n        path.is_dir() || path.is_file(),\n        \"Windows sandboxing via WSL can only grant existing files or directories: {}\",\n        path.display()\n    );\n    map_path_to_wsl(path)\n}\n\nfn path_to_wsl_allowing_missing(path: &Path) -> Result<PathMapping> {\n    let path_string = path.to_string_lossy();\n    if let Ok(path) = parse_wsl_absolute_path(&path_string) {\n        return Ok(PathMapping::Wsl(path));\n    }\n    map_path_to_wsl(path)\n}\n\nfn map_path_to_wsl(path: &Path) -> Result<PathMapping> {\n    let path_string = path.to_string_lossy();\n    if let Ok(path) = parse_wsl_unc_path(&path_string) {","sourceCodeStart":1415,"sourceCodeEnd":1451,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/sandbox/src/windows_wsl.rs#L1415-L1451","documentation":"Raised in path_to_wsl when a path being granted to the sandboxed command exists as neither a file nor a directory (or is otherwise inaccessible). WSL sandbox grants are limited to existing filesystem entries, so the invalid grant path is rejected with this error.","triggerScenarios":"Thrown at crates/sandbox/src/windows_wsl.rs:1433 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the granted file or directory exists before requesting sandbox access","Fix stale or mistyped paths in the request"],"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-14T05:17:10.506Z"}