vectordotdev/vector · error

failed to read path

Error message

failed to read path: {e}

What it means

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.

Solutions

  1. Re-run the release command after ensuring no concurrent process deletes target/artifacts (check CI jobs).
  2. Verify permissions on target/artifacts (`ls -la target/artifacts`) and fix unreadable entries.
  3. Rebuild artifacts (`cargo build` / artifact packaging step) so target/artifacts is freshly populated, then re-run.

Example fix

// before
vdev release github &  # concurrent with cargo clean
// after
cargo build --release && vdev release github   # serialized steps
Defensive patterns

Strategy: try-catch

Validate before calling

for entry in std::fs::read_dir("target/artifacts")? {
    entry?.metadata()?; // fails fast with a clearer error if unreadable
}

Try / catch

match std::fs::metadata(path) {
    Ok(_) => /* proceed with release */,
    Err(e) => eprintln!("artifact unreadable, rebuilding: {e}"),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/67068d415dae20c1. Report an issue: GitHub.

Appendix: source

Thrown at vdev/src/commands/release/github.rs:16

use crate::{app::CommandExt as _, utils::cargo};
use anyhow::{Ok, Result, anyhow};
use glob::glob;
use std::process::Command;

/// Uploads target/artifacts to GitHub releases
#[derive(clap::Args, Debug)]
#[command()]
pub struct Cli {}

impl Cli {
    pub fn exec(self) -> Result<()> {
        let artifacts = glob("target/artifacts/*")
            .expect("failed to read glob pattern")
            .collect::<Result<Vec<_>, _>>()
            .map_err(|e| anyhow!("failed to read path: {e}"))?
            .into_iter()
            .map(|p| p.into_os_string().into_string())
            .collect::<Result<Vec<_>, _>>()
            .map_err(|e| anyhow!("failed to turn path into string: {}", e.to_string_lossy()))?;

        let version = cargo::get_version()?;
        let mut command = Command::new("gh");
        command.in_repo();
        command.args(
            [
                "release",
                "--repo",
                "vectordotdev/vector",
                "create",
                &format!("v{version}"),
                "--title",
                &format!("v{version}"),
                "--notes",

View on GitHub (pinned to bdb87aeaa4)