vectordotdev/vector · error
{}
Error message
{} What it means
vdev's check_output runs a command capturing stdout and expects a zero exit status, returning stdout as a String. When the command exits non-zero, it bails with the formatted command error (including a "Command: {self:?}" dump of the invocation). The message body is generic ({}), so the actual failure detail comes from format_command_error.
Solutions
- Read the formatted error output (it echoes "Command: ...") and run that command manually to see the raw failure.
- Install or fix the missing/failing tool (ensure cargo, git, docker/podman are on PATH and functional).
- Re-run with a clean environment / correct working directory, since vdev commands are directory-sensitive.
- If the command is expected to fail sometimes, switch the call site to non-checking output() handling instead of exec().
Example fix
// before: vdev exec("cargo metadata ...") fails because toolchain missing
rustup update stable && cargo --version
// after: rerun the vdev command once the tool answers on PATH Defensive patterns
Strategy: try-catch
Validate before calling
# Pre-flight check for tools vdev will invoke
cargo --version >/dev/null 2>&1 || { echo "cargo missing"; exit 1; }
git --version >/dev/null 2>&1 || { echo "git missing"; exit 1; } Try / catch
// Catch vdev command failures and re-run the underlying command for detail
match vdev_exec(cmd) {
Err(e) => {
eprintln!("vdev exec failed: {e}; re-running command verbosely");
run_verbose(cmd)?;
}
ok => ok?,
} Prevention
- Install all tools vdev wraps (cargo, rustup, git, docker/podman) in the execution environment.
- Run vdev from the repository root so relative command contexts resolve.
- Read the echoed "Command: ..." in the error and reproduce it manually for the real stderr.
- Keep CI images aligned with docs/DEVELOPING.md tool requirements.
When it happens
Trigger: Any vdev code path calling exec()/check_output on an external command (cargo, git, docker, etc.) that exits with a non-zero status; also reachable from retains_state_between_requests when an underlying invocation fails.
Common situations: Missing tools on PATH during vdev runs (e.g. cargo feature not installed); docker/podman not running for integration tasks; git operations failing in CI; disk/permission errors in build scripts invoked by vdev.
Related errors
- command: failed with exit code
- Invalid config file name
- test name is required
- test name is required
- already exists
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/e209e278e702a286.
Report an issue: GitHub.
Appendix: source
Thrown at vdev/src/app.rs:118
}
}
/// Set the command's working directory to the repository directory.
fn in_repo(&mut self) -> &mut Self {
self.current_dir(path())
}
/// Run the command and capture its output.
fn check_output(&mut self) -> Result<String> {
self.pre_exec();
let output = self.output()?;
if output.status.success() {
// If the command exits successfully, return stdout as a string
Ok(String::from_utf8(output.stdout)?)
} else {
bail!(
"{}",
format_command_error(&output, Some(&format!("Command: {self:?}")))
)
}
}
/// Run the command and catch its exit code.
fn run(&mut self) -> Result<ExitStatus> {
self.pre_exec();
self.status().map_err(Into::into)
}
fn check_run(&mut self) -> Result<()> {
let status = self.run()?;
if status.success() {
Ok(())
} else {
let exit = status.code().unwrap();View on GitHub (pinned to bdb87aeaa4)