{"record":{"id":"4d1439a29bc45742","repo":"zed-industries/zed","slug":"path-must-be-relative-right","errorCode":null,"errorMessage":"Path must be relative: {right:?}","messagePattern":"Path must be relative: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/path/src/path.rs","lineNumber":124,"sourceCode":"        }\n    }\n\n    pub fn join_path(\n        self,\n        left: impl AsRef<Path>,\n        right: impl AsRef<Path>,\n    ) -> anyhow::Result<PathBuf> {\n        let left = left\n            .as_ref()\n            .to_str()\n            .ok_or_else(|| anyhow::anyhow!(\"Path contains invalid UTF-8\"))?;\n        let right = right.as_ref();\n        let right_string = right\n            .to_str()\n            .ok_or_else(|| anyhow::anyhow!(\"Path contains invalid UTF-8\"))?;\n        let joined = self\n            .join(left, right_string)\n            .ok_or_else(|| anyhow::anyhow!(\"Path must be relative: {right:?}\"))?;\n        Ok(PathBuf::from(self.normalize(&joined)))\n    }\n\n    pub fn join_path_preserving_components(\n        self,\n        left: impl AsRef<Path>,\n        right: impl AsRef<Path>,\n    ) -> anyhow::Result<PathBuf> {\n        let left = left\n            .as_ref()\n            .to_str()\n            .ok_or_else(|| anyhow::anyhow!(\"Path contains invalid UTF-8\"))?;\n        let right = right.as_ref();\n        let right_string = right\n            .to_str()\n            .ok_or_else(|| anyhow::anyhow!(\"Path contains invalid UTF-8\"))?;\n        let joined = self\n            .join(left, right_string)","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/path/src/path.rs#L106-L142","documentation":"join_path's internal join returned None because the right-hand path is not relative — it is absolute (or otherwise cannot be appended under `left`). The guard enforces that only relative paths may be joined onto a base directory path.","triggerScenarios":"Thrown at crates/path/src/path.rs:124 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Strip the leading separator or prefix from the right-hand path before joining, e.g. via strip_prefix or path helpers","Validate user-supplied sub-paths early and reject absolute components","Check callers like worktrees_directory_for_repo for accidentally absolute computed sub-paths"],"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"}