{"record":{"id":"b59f10e14a191454","repo":"vectordotdev/vector","slug":"neither-nor-found-the-deprecation-fragment-system-is-not-b59f10","errorCode":null,"errorMessage":"Neither {} nor {} found; the deprecation fragment system is not installed in this repo.","messagePattern":"Neither (.+?) nor (.+?) found; the deprecation fragment system is not installed in this repo\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/deprecation/generate.rs","lineNumber":21,"sourceCode":"use anyhow::{Result, bail};\n\nuse crate::utils::{deprecation, paths};\n\n/// Regenerate generated/deprecations.json from deprecation.d/ fragments\n#[derive(clap::Args, Debug)]\n#[command()]\npub struct Cli {}\n\nimpl Cli {\n    pub fn exec(self) -> Result<()> {\n        let repo_root = paths::find_repo_root()?;\n        let dir = repo_root.join(deprecation::DEPRECATION_DIR);\n        let json_path = repo_root.join(deprecation::DEPRECATIONS_JSON);\n        // If neither input exists, the fragment system isn't installed. With\n        // either present, we can still produce or refresh the JSON (an empty\n        // pending list is valid once all fragments have been enacted).\n        if !dir.is_dir() && !json_path.is_file() {\n            bail!(\n                \"Neither {} nor {} found; the deprecation fragment system is not installed in this repo.\",\n                dir.display(),\n                json_path.display()\n            );\n        }\n        deprecation::sync_deprecations_cue(&repo_root)?;\n        println!(\"Updated {}\", json_path.display());\n        Ok(())\n    }\n}\n","sourceCodeStart":3,"sourceCodeEnd":32,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/deprecation/generate.rs#L3-L32","documentation":"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.","triggerScenarios":"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.","commonSituations":"Seen in fresh forks, older branches predating the deprecation system, or checkouts where the deprecation directory was deleted and the JSON never generated.","solutions":["Ensure you are in the correct Vector repository root with the deprecation system present (git checkout main).","Create/restore the deprecation fragments directory with at least the expected layout before generating.","If upgrading an old branch, rebase onto a branch that includes the deprecation tooling.","Skip generate in repos that intentionally do not use the deprecation fragment system."],"exampleFix":"// before (wrong dir)\ncd ~/other-repo && cargo vdev deprecation generate\n// after\ncd ~/vector && cargo vdev deprecation generate","handlingStrategy":"fallback","validationCode":"let dir = repo_root.join(\"deprecations\");\nlet json = repo_root.join(\"deprecations.json\");\nif !dir.is_dir() && !json.is_file() { eprintln!(\"deprecation fragment system not installed in this repo\"); return; }","typeGuard":"fn can_generate(repo_root: &Path) -> bool { repo_root.join(\"deprecations\").is_dir() || repo_root.join(\"deprecations.json\").is_file() }","tryCatchPattern":"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 }","preventionTips":["Run `cargo vdev` commands from the repository root","Ensure your checkout includes the deprecation system (sync with upstream main)","Do not delete the deprecation directory without also removing dependent workflows"],"tags":["deprecation","codegen","repo-setup"],"backgroundTag":"file-not-found","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"}