{"record":{"id":"c78f6ffacee42c75","repo":"zed-industries/zed","slug":"cannot-grant-sandbox-write-access-to-it-reso","errorCode":null,"errorMessage":"cannot grant sandbox write access to `{}`: it resolves to `{}`, which is not a Windows drive path","messagePattern":"cannot grant sandbox write access to `(.+?)`: it resolves to `(.+?)`, which is not a Windows drive path","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/sandbox/src/windows_wsl.rs","lineNumber":337,"sourceCode":"    wsl_zed_release: (String, String),\n) -> Result<ResolvedGrant> {\n    let path_string = requested.to_string_lossy();\n\n    // A Windows drive grant (NTFS) is resolved on the Windows host, which is\n    // authoritative about junctions and symlinks (see the doc comment above).\n    if parse_native_drive_path(&path_string).is_ok() {\n        let canonical = smol::fs::canonicalize(&requested).await.with_context(|| {\n            format!(\n                \"failed to resolve writable path `{}` on the Windows host\",\n                requested.display()\n            )\n        })?;\n        // `canonicalize` yields a `\\\\?\\` verbatim path; store the plain native\n        // spelling so a non-junction grant compares equal to what was requested.\n        // A junction resolving off the local drives (onto a UNC/WSL path) is\n        // rejected — only a Windows drive path maps to a DrvFs bind.\n        let canonical = strip_windows_verbatim_prefix(canonical);\n        ensure!(\n            parse_native_drive_path(&canonical.to_string_lossy()).is_ok(),\n            \"cannot grant sandbox write access to `{}`: it resolves to `{}`, \\\n             which is not a Windows drive path\",\n            requested.display(),\n            canonical.display()\n        );\n        // A Windows drive is reached inside WSL via DrvFs (weaker guarantees), so\n        // a native-drive grant is on a Windows filesystem by definition.\n        return Ok(ResolvedGrant {\n            canonical,\n            on_windows_fs: true,\n        });\n    }\n\n    // Otherwise the grant must be a Linux-absolute WSL path, which only WSL can\n    // canonicalize. `\\\\wsl.localhost\\...` and other shapes are rejected.\n    let wsl_path = parse_wsl_absolute_path(&path_string).map_err(|_| {\n        anyhow::anyhow!(","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/sandbox/src/windows_wsl.rs#L319-L355","documentation":"A path intended as a Windows drive (NTFS) grant did not parse as a native drive-letter path, so it cannot be resolved on the Windows host for sandbox write access. The requested grant is in an unsupported form (e.g. a UNC or WSL path where a drive path was required).","triggerScenarios":"Thrown at crates/sandbox/src/windows_wsl.rs:337 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a native drive-letter Windows path (e.g. C:\\work\\repo) for the grant","Route non-drive paths through the WSL-side resolution path instead of Windows-host canonicalization"],"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"}