{"record":{"id":"4895be226961d4e6","repo":"vectordotdev/vector","slug":"does-not-exist","errorCode":null,"errorMessage":"{} does not exist","messagePattern":"(.+?) does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/changelog/new.rs","lineNumber":36,"sourceCode":"#[command()]\npub struct Cli {\n    /// Fragment type.\n    #[arg(value_parser = clap::builder::PossibleValuesParser::new(\n        FRAGMENT_TYPES.iter().map(|t| t.name)\n    ))]\n    fragment_type: String,\n    /// Unique slug (used as the filename prefix, e.g. `env_var_interpolation`).\n    slug: String,\n}\n\nimpl Cli {\n    pub fn exec(self) -> Result<()> {\n        validate_slug(&self.slug)?;\n\n        let repo_root = paths::find_repo_root()?;\n        let dir = repo_root.join(CHANGELOG_DIR);\n        if !dir.is_dir() {\n            bail!(\"{} does not exist\", dir.display());\n        }\n        let file = dir.join(format!(\"{}.{}.md\", self.slug, self.fragment_type));\n        if file.exists() {\n            bail!(\"{} already exists\", file.display());\n        }\n\n        let author = detect_gh_handle().unwrap_or_else(|| TODO_HANDLE.to_string());\n        let Some(entry) = FRAGMENT_TYPES\n            .iter()\n            .find(|t| t.name == self.fragment_type.as_str())\n        else {\n            bail!(\"unknown fragment type '{}'\", self.fragment_type);\n        };\n        let content = render_template(entry, &author);\n        fs::write(&file, content)?;\n\n        // `git add` the new fragment so the checker (which scans `git diff --diff-filter=A`)\n        // picks it up immediately without a manual staging step. Report the failure if it","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/changelog/new.rs#L18-L54","documentation":"`vdev changelog new` (`New::exec`, vdev/src/commands/changelog/new.rs:30) creates a new changelog fragment. After resolving the repository root, it checks that the `changelog.d` directory exists; if not, it bails with \"<path> does not exist\". This protects against creating fragments in a checkout that lacks the changelog fragment directory.","triggerScenarios":"Running `vdev changelog new <slug> <type>` in a repository (or subdirectory) where `<repo-root>/changelog.d` does not exist or is not a directory (e.g. run outside the Vector repo, or changelog.d renamed/deleted).","commonSituations":"Running the command from a different project that happens to use vdev; working on an old branch before the changelog.d convention was introduced; accidentally deleting the changelog.d directory locally.","solutions":["Run the command from within the Vector repository that contains a `changelog.d` directory.","Recreate the `changelog.d` directory if it was deleted (`mkdir changelog.d` at the repo root).","Check `git status`/`git checkout` to restore a removed changelog.d directory."],"exampleFix":"// before (wrong cwd)\ncd ~/other-project && vdev changelog new my-fix error\n// after\ncd ~/vector && vdev changelog new my-fix error","handlingStrategy":"validation","validationCode":"// before running the command\nif !std::path::Path::new(\"changelog.d\").is_dir() {\n    eprintln!(\"not in a repo with changelog.d; cd to the Vector repo root first\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = changelog_new::New { slug, fragment_type }.exec() {\n    eprintln!(\"{e:#}\"); // shows which directory was missing\n}","preventionTips":["Run `vdev changelog new` from the root of the Vector repository.","Don't delete or rename the `changelog.d` directory locally.","If on an old branch, rebase to one that uses the changelog.d convention."],"tags":["changelog","cli","filesystem"],"backgroundTag":"directory-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"}