{"record":{"id":"6d65f3ab3731173c","repo":"zed-industries/zed","slug":"wsl-sandbox-helper-returned-invalid-canonical-path","errorCode":null,"errorMessage":"WSL sandbox helper returned invalid canonical-path output: {stdout:?}","messagePattern":"WSL sandbox helper returned invalid canonical-path output: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/sandbox/src/windows_wsl.rs","lineNumber":628,"sourceCode":"}\n\nfn parse_canonical_grant_output(stdout: &str) -> Result<ResolvedGrant> {\n    let mut lines = stdout.lines();\n    let distro = lines\n        .next()\n        .context(\"WSL sandbox helper omitted the distro name\")?;\n    let canonical = lines\n        .next()\n        .context(\"WSL sandbox helper omitted the canonical path\")?;\n    let fs_class = lines\n        .next()\n        .context(\"WSL sandbox helper omitted the filesystem class\")?;\n    let on_windows_fs = match fs_class {\n        RESOLVE_WINDOWS_FS => true,\n        RESOLVE_NATIVE_FS => false,\n        _ => bail!(\"WSL sandbox helper returned an invalid filesystem class: {fs_class:?}\"),\n    };\n    ensure!(\n        lines.next().is_none()\n            && !distro.is_empty()\n            && !distro.contains(['/', '\\\\'])\n            && canonical.starts_with('/'),\n        \"WSL sandbox helper returned invalid canonical-path output: {stdout:?}\"\n    );\n    // Store the canonical as the Linux path bwrap actually binds. The distro is\n    // pinned at enforcement from the *requested* path (see `wrap_invocation`),\n    // so it is not re-encoded here: spelling the canonical as\n    // `\\\\wsl.localhost\\<distro>\\...` would resurface the Windows-style path we\n    // avoid and, because it names the same object as the request, show as a\n    // spurious redirect in the approval UI.\n    Ok(ResolvedGrant {\n        canonical: PathBuf::from(canonical),\n        on_windows_fs,\n    })\n}\n","sourceCodeStart":610,"sourceCodeEnd":646,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/sandbox/src/windows_wsl.rs#L610-L646","documentation":"The WSL sandbox helper's stdout protocol was violated: the filesystem-class line contained an unrecognized token instead of the expected windows/native marker. The helper binary is mismatched with this version of Zed or its output was corrupted.","triggerScenarios":"Thrown at crates/sandbox/src/windows_wsl.rs:628 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-provision the WSL sandbox helper so a version-matched helper is installed","Check that a stale Zed helper installed via ZED_WSL_SANDBOX_HELPER is not being reused","Retry once in case of corrupted pipe output"],"exampleFix":null,"handlingStrategy":"retry","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"}