vectordotdev/vector · error

must not be the repository root

Error message

{description} must not be the repository root: {}

What it means

Raised by resolve_repo_relative_path after component filtering: the input path consisted solely of CurDir components (e.g. '.' or './'), so the accumulated relative path is empty, meaning the user asked to operate on the repository root itself. The operation described by {description} requires an actual subdirectory/file below the root, so the guard bails.

Solutions

  1. Point at a concrete file or subdirectory inside the repository instead of '.'
  2. Check for a shell glob that expanded to the current directory
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at vdev/src/utils/paths.rs:65 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vectordotdev/vector@0d4ab78a4f (2026-09-16). Data as JSON: /api/errors/02257c196ee55a6e. Report an issue: GitHub.

Appendix: source

Thrown at vdev/src/utils/paths.rs:66

    path: &Path,
    description: &str,
) -> Result<PathBuf> {
    let mut relative = PathBuf::new();
    for component in path.components() {
        match component {
            Component::Normal(component) => relative.push(component),
            Component::CurDir => {}
            Component::ParentDir | Component::RootDir | Component::Prefix(_) => {
                bail!(
                    "{description} must be a relative descendant of the repository: {}",
                    path.display()
                );
            }
        }
    }

    if relative.as_os_str().is_empty() {
        bail!(
            "{description} must not be the repository root: {}",
            path.display()
        );
    }

    let output = repo_root.join(relative);
    let canonical_root = repo_root.canonicalize().with_context(|| {
        format!(
            "Could not canonicalize repository root {}",
            repo_root.display()
        )
    })?;
    let existing_ancestor = output
        .ancestors()
        .find(|ancestor| ancestor.exists())
        .expect("repository root must be an existing output ancestor");
    let canonical_ancestor = existing_ancestor.canonicalize().with_context(|| {
        format!(

View on GitHub (pinned to 0d4ab78a4f)