vectordotdev/vector · error

does not exist

Error message

{} does not exist

What it means

`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.

Solutions

  1. Run the command from within the Vector repository that contains a `changelog.d` directory.
  2. Recreate the `changelog.d` directory if it was deleted (`mkdir changelog.d` at the repo root).
  3. Check `git status`/`git checkout` to restore a removed changelog.d directory.

Example fix

// before (wrong cwd)
cd ~/other-project && vdev changelog new my-fix error
// after
cd ~/vector && vdev changelog new my-fix error
Defensive patterns

Strategy: validation

Validate before calling

// before running the command
if !std::path::Path::new("changelog.d").is_dir() {
    eprintln!("not in a repo with changelog.d; cd to the Vector repo root first");
}

Try / catch

if let Err(e) = changelog_new::New { slug, fragment_type }.exec() {
    eprintln!("{e:#}"); // shows which directory was missing
}

Prevention

When it happens

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

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

Related errors


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

Appendix: source

Thrown at vdev/src/commands/changelog/new.rs:36

#[command()]
pub struct Cli {
    /// Fragment type.
    #[arg(value_parser = clap::builder::PossibleValuesParser::new(
        FRAGMENT_TYPES.iter().map(|t| t.name)
    ))]
    fragment_type: String,
    /// Unique slug (used as the filename prefix, e.g. `env_var_interpolation`).
    slug: String,
}

impl Cli {
    pub fn exec(self) -> Result<()> {
        validate_slug(&self.slug)?;

        let repo_root = paths::find_repo_root()?;
        let dir = repo_root.join(CHANGELOG_DIR);
        if !dir.is_dir() {
            bail!("{} does not exist", dir.display());
        }
        let file = dir.join(format!("{}.{}.md", self.slug, self.fragment_type));
        if file.exists() {
            bail!("{} already exists", file.display());
        }

        let author = detect_gh_handle().unwrap_or_else(|| TODO_HANDLE.to_string());
        let Some(entry) = FRAGMENT_TYPES
            .iter()
            .find(|t| t.name == self.fragment_type.as_str())
        else {
            bail!("unknown fragment type '{}'", self.fragment_type);
        };
        let content = render_template(entry, &author);
        fs::write(&file, content)?;

        // `git add` the new fragment so the checker (which scans `git diff --diff-filter=A`)
        // picks it up immediately without a manual staging step. Report the failure if it

View on GitHub (pinned to bdb87aeaa4)