{"record":{"id":"ce498a8992af403e","repo":"zed-industries/zed","slug":"zed-wsl-sandbox-helper-must-be-an-absolute-path-in","errorCode":null,"errorMessage":"ZED_WSL_SANDBOX_HELPER must be an absolute path inside WSL","messagePattern":"ZED_WSL_SANDBOX_HELPER must be an absolute path inside WSL","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/sandbox/src/windows_wsl.rs","lineNumber":869,"sourceCode":"/// `--wsl-sandbox-helper`. Runs [`HELPER_PROVISION_SCRIPT`] (which downloads the\n/// matching release tarball into an off-`PATH` location on first use).\n///\n/// Successful resolutions are cached per `(distro, channel, version)` for the\n/// life of the process — once provisioned, the path won't change. Failures are\n/// not cached, so a user who installs `curl` (or fixes networking) after an\n/// error can retry without restarting Zed.\nasync fn ensure_wsl_zed_helper(\n    wsl_exe: &Path,\n    distro: Option<&str>,\n    channel: &str,\n    version: &str,\n) -> Result<String> {\n    // TODO: Remove this development override once WSL canonical-path handling is released.\n    if let Some(helper) = std::env::var_os(\"ZED_WSL_SANDBOX_HELPER\") {\n        let helper = helper\n            .into_string()\n            .map_err(|_| anyhow::anyhow!(\"ZED_WSL_SANDBOX_HELPER is not valid UTF-8\"))?;\n        ensure!(\n            helper.starts_with('/'),\n            \"ZED_WSL_SANDBOX_HELPER must be an absolute path inside WSL\"\n        );\n        return Ok(helper);\n    }\n\n    type HelperCache = HashMap<(Option<String>, String, String), String>;\n    static CACHE: OnceLock<Mutex<HelperCache>> = OnceLock::new();\n    let cache = CACHE.get_or_init(|| Mutex::new(HashMap::new()));\n\n    let key = (\n        distro.map(str::to_string),\n        channel.to_string(),\n        version.to_string(),\n    );\n    if let Some(path) = cache\n        .lock()\n        .unwrap_or_else(|poisoned| poisoned.into_inner())","sourceCodeStart":851,"sourceCodeEnd":887,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/sandbox/src/windows_wsl.rs#L851-L887","documentation":"Validation in ensure_wsl_zed_helper(): the ZED_WSL_SANDBOX_HELPER value is not an absolute path inside WSL, which is required because it is passed as the --wsl-sandbox-helper argument to commands run in WSL.","triggerScenarios":"Thrown at crates/sandbox/src/windows_wsl.rs:869 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set ZED_WSL_SANDBOX_HELPER to an absolute Linux path (e.g. /usr/local/lib/zed/...)","Unset the variable to let Zed auto-provision the helper at its standard absolute location"],"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"}