{"record":{"id":"67068d415dae20c1","repo":"vectordotdev/vector","slug":"failed-to-read-path-e","errorCode":null,"errorMessage":"failed to read path: {e}","messagePattern":"failed to read path: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/release/github.rs","lineNumber":16,"sourceCode":"use crate::{app::CommandExt as _, utils::cargo};\nuse anyhow::{Ok, Result, anyhow};\nuse glob::glob;\nuse std::process::Command;\n\n/// Uploads target/artifacts to GitHub releases\n#[derive(clap::Args, Debug)]\n#[command()]\npub struct Cli {}\n\nimpl Cli {\n    pub fn exec(self) -> Result<()> {\n        let artifacts = glob(\"target/artifacts/*\")\n            .expect(\"failed to read glob pattern\")\n            .collect::<Result<Vec<_>, _>>()\n            .map_err(|e| anyhow!(\"failed to read path: {e}\"))?\n            .into_iter()\n            .map(|p| p.into_os_string().into_string())\n            .collect::<Result<Vec<_>, _>>()\n            .map_err(|e| anyhow!(\"failed to turn path into string: {}\", e.to_string_lossy()))?;\n\n        let version = cargo::get_version()?;\n        let mut command = Command::new(\"gh\");\n        command.in_repo();\n        command.args(\n            [\n                \"release\",\n                \"--repo\",\n                \"vectordotdev/vector\",\n                \"create\",\n                &format!(\"v{version}\"),\n                \"--title\",\n                &format!(\"v{version}\"),\n                \"--notes\",","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/release/github.rs#L1-L34","documentation":"The `vdev release github` command globs target/artifacts/* to collect release artifacts to upload. If any matched path fails to be read (e.g. the entry vanished between glob and iteration, or a permission error occurs), the glob iterator yields an Err which is converted into this error.","triggerScenarios":"Running `vdev release github` while files under target/artifacts/ are deleted concurrently (e.g. a parallel clean) or a matched entry is unreadable due to permissions, causing glob's per-entry Result to be an Err.","commonSituations":"A `cargo clean` or CI job running concurrently with the release step; target/ on a network filesystem with transient permission issues; stale glob cache pointing at removed paths.","solutions":["Re-run the release command after ensuring no concurrent process deletes target/artifacts (check CI jobs).","Verify permissions on target/artifacts (`ls -la target/artifacts`) and fix unreadable entries.","Rebuild artifacts (`cargo build` / artifact packaging step) so target/artifacts is freshly populated, then re-run."],"exampleFix":"// before\nvdev release github &  # concurrent with cargo clean\n// after\ncargo build --release && vdev release github   # serialized steps","handlingStrategy":"try-catch","validationCode":"for entry in std::fs::read_dir(\"target/artifacts\")? {\n    entry?.metadata()?; // fails fast with a clearer error if unreadable\n}","typeGuard":null,"tryCatchPattern":"match std::fs::metadata(path) {\n    Ok(_) => /* proceed with release */,\n    Err(e) => eprintln!(\"artifact unreadable, rebuilding: {e}\"),\n}","preventionTips":["Do not run `cargo clean` or other jobs concurrently with the release step","Verify artifacts exist and are readable right before `vdev release github`","Keep target/ on local, reliable storage rather than flaky network mounts"],"tags":["rust","cli","filesystem"],"backgroundTag":"file-read-failed","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}