vectordotdev/vector · error

No deprecation fragment found at

Error message

No deprecation fragment found at {}

What it means

Thrown by `cargo vdev deprecation enact` when the resolved fragment file (DEPRECATION_DIR joined with '<slug>.md') does not exist on disk. The command needs the fragment to parse entry data for enactment.

Solutions

  1. Check the exact slug: list fragments in the deprecation directory and re-run with the correct name.
  2. Confirm the fragment was not already enacted and removed (check git log / the deprecations JSON).
  3. Run from the correct repository root/branch that contains the fragment.
  4. Optionally omit --version so it defaults to next release if the slug was fine but other flags confused the invocation.

Example fix

// before
cargo vdev deprecation enact azure-monitor-log-sink  # typo
// after
cargo vdev deprecation enact azure-monitor-logs-sink
Defensive patterns

Strategy: validation

Validate before calling

let path = repo_root.join("deprecations").join(format!("{slug}.md"));
if !path.exists() { eprintln!("fragment {slug}.md not found; list the directory first"); return; }

Type guard

fn fragment_exists(repo_root: &Path, slug: &str) -> bool { let stem = slug.strip_suffix(".md").unwrap_or(slug); repo_root.join("deprecations").join(format!("{stem}.md")).exists() }

Try / catch

match result { Err(e) if e.to_string().contains("No deprecation fragment found") => { eprintln!("Check slug spelling and that the fragment is not already enacted"); } Err(e) => return Err(e), Ok(v) => v }

Prevention

When it happens

Trigger: Calling enact with a slug whose '<stem>.md' file is absent from the deprecation directory: path.exists() returns false after dir.join(&filename).

Common situations: Happens with a typo'd slug, a fragment already enacted and deleted, running in the wrong repo/branch, or enacting on a fork missing the deprecation directory.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at vdev/src/commands/deprecation/enact.rs:39

impl Cli {
    pub fn exec(self) -> Result<()> {
        let repo_root = paths::find_repo_root()?;
        let dir = repo_root.join(deprecation::DEPRECATION_DIR);

        // Accept "slug" or "slug.md"; reject path-like inputs to keep the
        // identifier unambiguous (and the file lookup safe).
        if self.slug.contains('/') || self.slug.contains('\\') {
            bail!(
                "expected a deprecation slug (e.g. \"azure-monitor-logs-sink\"), not a path: {}",
                self.slug
            );
        }
        let stem = self.slug.strip_suffix(".md").unwrap_or(&self.slug);
        let filename = format!("{stem}.md");

        let path = dir.join(&filename);
        if !path.exists() {
            bail!("No deprecation fragment found at {}", path.display());
        }

        // Parse the fragment to get entry data.
        let entries = deprecation::read_deprecation_fragments(&dir)?;
        let entry = entries
            .into_iter()
            .find(|e| e.filename == filename)
            .ok_or_else(|| anyhow::anyhow!("Could not parse {filename}"))?;

        let version = if let Some(v) = self.version {
            // Reject `--version 0.58.0-alpha` and friends: only release-shaped
            // semver is valid here.
            if !v.pre.is_empty() || !v.build.is_empty() {
                bail!(
                    "--version {v} has prerelease or build metadata; only plain X.Y.Z is allowed"
                );
            }
            v

View on GitHub (pinned to bdb87aeaa4)