{"record":{"id":"f2a2b2bbea4c6989","repo":"zed-industries/zed","slug":"expected-expected-result-lines-from-the-path-res","errorCode":null,"errorMessage":"expected {expected} result lines from the path resolution script, got {}: {stdout:?}","messagePattern":"expected (.+?) result lines from the path resolution script, got (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/sandbox/src/windows_wsl.rs","lineNumber":1140,"sourceCode":"                args.extend([\"L\".to_string(), path.path.clone(), String::new()]);\n            }\n            PathMapping::NativeDrive {\n                windows_path,\n                fallback,\n            } => {\n                args.extend([\"W\".to_string(), windows_path.clone(), fallback.path.clone()]);\n            }\n        }\n    }\n    args\n}\n\n/// Parse [`PATH_RESOLUTION_SCRIPT`] output: one strictly-formatted line per\n/// input triple. Anything else (wrong line count, unknown status words, a\n/// non-absolute path) means the stdout protocol was corrupted and is an error.\nfn parse_path_resolution_output(stdout: &str, expected: usize) -> Result<Vec<ResolvedPath>> {\n    let lines: Vec<&str> = stdout.lines().collect();\n    ensure!(\n        lines.len() == expected,\n        \"expected {expected} result lines from the path resolution script, got {}: {stdout:?}\",\n        lines.len()\n    );\n    lines\n        .into_iter()\n        .map(|line| {\n            let mut parts = line.splitn(3, ' ');\n            let (Some(translate), Some(exists), Some(path)) =\n                (parts.next(), parts.next(), parts.next())\n            else {\n                bail!(\"malformed line from the path resolution script: {line:?}\");\n            };\n            let used_fallback = match translate {\n                \"ok\" => false,\n                \"fallback\" => true,\n                _ => bail!(\"malformed line from the path resolution script: {line:?}\"),\n            };","sourceCodeStart":1122,"sourceCodeEnd":1158,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/sandbox/src/windows_wsl.rs#L1122-L1158","documentation":"Raised in parse_path_resolution_output(): the WSL path-resolution script returned a number of result lines different from the number of input paths, meaning the stdout protocol was corrupted; the actual stdout is embedded.","triggerScenarios":"Thrown at crates/sandbox/src/windows_wsl.rs:1140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry path resolution once in case of truncated pipe output","Re-provision the sandbox helper if a stale script version prints a different protocol"],"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"}