{"record":{"id":"791d939e8ebd4538","repo":"vectordotdev/vector","slug":"fragment-path-is-not-valid-utf-8","errorCode":null,"errorMessage":"Fragment path is not valid UTF-8: {}","messagePattern":"Fragment path is not valid UTF-8: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/release/generate_cue.rs","lineNumber":432,"sourceCode":"    pull_request_metadata: PullRequestMetadata,\n) -> Result<Vec<u64>> {\n    lookup_pull_requests_from_git(repo_root, fragment_path, pull_request_metadata)\n}\n\nfn lookup_pull_requests_from_git(\n    repo_root: &Path,\n    fragment_path: &Path,\n    pull_request_metadata: PullRequestMetadata,\n) -> Result<Vec<u64>> {\n    let relative_path = fragment_path.strip_prefix(repo_root).with_context(|| {\n        format!(\n            \"Fragment path {} is outside the repository root {}\",\n            fragment_path.display(),\n            repo_root.display()\n        )\n    })?;\n    let relative_path = relative_path.to_str().ok_or_else(|| {\n        anyhow!(\n            \"Fragment path is not valid UTF-8: {}\",\n            fragment_path.display()\n        )\n    })?;\n\n    let addition_commits = run_command(\n        \"git\",\n        &[\n            \"log\",\n            \"--format=%H\",\n            \"--diff-filter=A\",\n            \"--follow\",\n            \"--\",\n            relative_path,\n        ],\n        repo_root,\n    )?;\n    let Some(latest_addition) = addition_commits.lines().next() else {","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/commands/release/generate_cue.rs#L414-L450","documentation":"lookup_pull_requests_from_git converts a fragment's repository-relative path into a &str so it can be embedded in a git log grep pattern. If the path contains bytes that are not valid UTF-8, to_str() fails and this error is thrown instead of silently proceeding with a bad pattern.","triggerScenarios":"Calling lookup_pull_requests (during release CUE generation) with a fragment path whose relative path (after stripping the repo root) is not valid UTF-8.","commonSituations":"A changelog fragment was created with a filename containing raw or escaped bytes from another tool/OS; a merge artifact copied a non-UTF-8 name into changelog.d.","solutions":["Find and rename the non-UTF-8 filename in the changelog.d directory (e.g. `convmv --notest -f latin1 -t utf8 changelog.d/*`).","Regenerate the fragment filename in plain ASCII/UTF-8 before running the release step.","Re-run the release command after the rename."],"exampleFix":"// before\ngit mv $'changelog.d/fix\\xff.md' 'changelog.d/fix.md'\n// after\nmv 'changelog.d/fix.md' 'changelog.d/fix.md'  # valid UTF-8 name","handlingStrategy":"validation","validationCode":"let name = fragment_path.to_str();\nassert!(name.is_some(), \"fragment path must be UTF-8: {:?}\", fragment_path);","typeGuard":"fn is_utf8_path(p: &std::path::Path) -> bool { p.to_str().is_some() }","tryCatchPattern":null,"preventionTips":["Create fragment files with editor/shell defaults that use UTF-8","Avoid copying fragments from archives or filesystems with legacy encodings","Lint changelog.d filenames in CI for UTF-8 validity"],"tags":["rust","cli","encoding"],"backgroundTag":"invalid-argument-format","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"}