vectordotdev/vector · error

Neither nor found; the deprecation fragment system is not…

Error message

Neither {} nor {} found; the deprecation fragment system is not installed in this repo.

What it means

Thrown by `cargo vdev deprecation generate` (exec) when neither the deprecation fragments directory nor the generated deprecations JSON exists in the repo, meaning the deprecation fragment system is not installed. Unlike `check`, generate needs at least one of the two inputs even though an empty pending list is valid.

Solutions

  1. Ensure you are in the correct Vector repository root with the deprecation system present (git checkout main).
  2. Create/restore the deprecation fragments directory with at least the expected layout before generating.
  3. If upgrading an old branch, rebase onto a branch that includes the deprecation tooling.
  4. Skip generate in repos that intentionally do not use the deprecation fragment system.

Example fix

// before (wrong dir)
cd ~/other-repo && cargo vdev deprecation generate
// after
cd ~/vector && cargo vdev deprecation generate
Defensive patterns

Strategy: fallback

Validate before calling

let dir = repo_root.join("deprecations");
let json = repo_root.join("deprecations.json");
if !dir.is_dir() && !json.is_file() { eprintln!("deprecation fragment system not installed in this repo"); return; }

Type guard

fn can_generate(repo_root: &Path) -> bool { repo_root.join("deprecations").is_dir() || repo_root.join("deprecations.json").is_file() }

Try / catch

match result { Err(e) if e.to_string().contains("deprecation fragment system is not installed") => { eprintln!("Run from the Vector repo root or skip this step"); } Err(e) => return Err(e), Ok(v) => v }

Prevention

When it happens

Trigger: Running `cargo vdev deprecation generate` in a repo where dir.is_dir() is false AND json_path.is_file() is false, immediately after find_repo_root succeeds.

Common situations: Seen in fresh forks, older branches predating the deprecation system, or checkouts where the deprecation directory was deleted and the JSON never generated.

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/b59f10e14a191454. Report an issue: GitHub.

Appendix: source

Thrown at vdev/src/commands/deprecation/generate.rs:21

use anyhow::{Result, bail};

use crate::utils::{deprecation, paths};

/// Regenerate generated/deprecations.json from deprecation.d/ fragments
#[derive(clap::Args, Debug)]
#[command()]
pub struct Cli {}

impl Cli {
    pub fn exec(self) -> Result<()> {
        let repo_root = paths::find_repo_root()?;
        let dir = repo_root.join(deprecation::DEPRECATION_DIR);
        let json_path = repo_root.join(deprecation::DEPRECATIONS_JSON);
        // If neither input exists, the fragment system isn't installed. With
        // either present, we can still produce or refresh the JSON (an empty
        // pending list is valid once all fragments have been enacted).
        if !dir.is_dir() && !json_path.is_file() {
            bail!(
                "Neither {} nor {} found; the deprecation fragment system is not installed in this repo.",
                dir.display(),
                json_path.display()
            );
        }
        deprecation::sync_deprecations_cue(&repo_root)?;
        println!("Updated {}", json_path.display());
        Ok(())
    }
}

View on GitHub (pinned to bdb87aeaa4)