vectordotdev/vector · error
Could not find Vector repository root. Please run vdev from…
Error message
Could not find Vector repository root. Please run vdev from within the Vector repository.
What it means
Generic sentinel bail from find_repo_root: the walker climbed from the current working directory to the filesystem root without finding either a '.git' directory or a Cargo.toml containing '[workspace]', so vdev cannot locate the Vector repository root it needs to resolve paths. It fires whenever vdev is executed outside a Vector checkout.
Solutions
- Run vdev from inside the Vector repository clone
- Verify you are in the right directory with pwd; a common cause is running vdev from /tmp or the home directory
- If the checkout lacks .git (e.g. an exported tarball), ensure the root Cargo.toml still contains a [workspace] section so the secondary marker matches
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at vdev/src/utils/paths.rs:37 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/9332dd25e30d9d8e.
Report an issue: GitHub.
Appendix: source
Thrown at vdev/src/utils/paths.rs:38
// Check for .git directory (most reliable marker)
if current.join(".git").is_dir() {
return Ok(current);
}
// Check for Cargo.toml with workspace (Vector's root Cargo.toml has [workspace])
let cargo_toml = current.join("Cargo.toml");
if cargo_toml.is_file()
&& let Ok(contents) = fs::read_to_string(&cargo_toml)
&& contents.contains("[workspace]")
{
return Ok(current);
}
// Move up one directory
if let Some(parent) = current.parent() {
current = parent.to_path_buf();
} else {
anyhow::bail!(
"Could not find Vector repository root. Please run vdev from within the Vector repository."
);
}
}
}
/// Resolve a user-provided path only when it stays below the repository root.
pub fn resolve_repo_relative_path(
repo_root: &Path,
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(_) => {View on GitHub (pinned to 0d4ab78a4f)