{"record":{"id":"f866abe001e4f1cc","repo":"vectordotdev/vector","slug":"description-must-be-a-relative-descendant-of-the-repository","errorCode":null,"errorMessage":"{description} must be a relative descendant of the repository: {}","messagePattern":"(.+?) must be a relative descendant of the repository: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/utils/paths.rs","lineNumber":57,"sourceCode":"                \"Could not find Vector repository root. Please run vdev from within the Vector repository.\"\n            );\n        }\n    }\n}\n\n/// Resolve a user-provided path only when it stays below the repository root.\npub fn resolve_repo_relative_path(\n    repo_root: &Path,\n    path: &Path,\n    description: &str,\n) -> Result<PathBuf> {\n    let mut relative = PathBuf::new();\n    for component in path.components() {\n        match component {\n            Component::Normal(component) => relative.push(component),\n            Component::CurDir => {}\n            Component::ParentDir | Component::RootDir | Component::Prefix(_) => {\n                bail!(\n                    \"{description} must be a relative descendant of the repository: {}\",\n                    path.display()\n                );\n            }\n        }\n    }\n\n    if relative.as_os_str().is_empty() {\n        bail!(\n            \"{description} must not be the repository root: {}\",\n            path.display()\n        );\n    }\n\n    let output = repo_root.join(relative);\n    let canonical_root = repo_root.canonicalize().with_context(|| {\n        format!(\n            \"Could not canonicalize repository root {}\",","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/utils/paths.rs#L39-L75","documentation":"Guard inside resolve_repo_relative_path: while walking the components() of a user-supplied path, any ParentDir, RootDir, or Prefix component is rejected because such a path can escape the repository root (absolute paths, '../' traversal, or Windows drive prefixes). The {description} names which input was at fault; only strictly relative descendants composed of Normal components are accepted.","triggerScenarios":"Thrown at vdev/src/utils/paths.rs:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a path relative to the repository root without leading '/' or '..' segments","If an absolute path was given, strip the repository-root prefix first","Re-run vdev from the repository root so relative paths resolve as intended"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}