vectordotdev/vector · critical
Failed to compile proto files
Error message
Failed to compile proto files
What it means
The `dnstap-parser` crate's `build.rs` invokes `prost-build` to compile `proto/dnstap.proto` into Rust types at build time and panics with this message if `compile_protos` fails. This is a build-time error, so the crate cannot compile until the protobuf compilation succeeds.
Solutions
- Confirm `proto/dnstap.proto` exists in the dnstap-parser crate and run `cargo build` from the workspace root so relative paths resolve
- Fix any syntax errors in dnstap.proto (the prost error message names the line)
- Install/repair protoc and ensure it is on PATH with a version compatible with prost-build
- Run `cargo clean -p vector-dnstap-parser` and rebuild to clear stale build-script state
Example fix
// before (proto file missing from checkout) $ cargo build error: Failed to compile proto files // after $ git checkout -- lib/vector-vrl/dnstap-parser/proto/dnstap.proto $ cargo build # succeeds
Defensive patterns
Strategy: validation
Validate before calling
test -f lib/vector-vrl/dnstap-parser/proto/dnstap.proto && protoc --proto_path=lib/vector-vrl/dnstap-parser/proto --descriptor_set_out=/dev/null lib/vector-vrl/dnstap-parser/proto/dnstap.proto
Prevention
- Run a CI step that compiles all .proto files with protoc before cargo build
- Keep proto files committed and verify with `git status` after partial syncs
- Pin protoc version used by developers and CI
- cargo clean the crate after editing build.rs or moving protos
When it happens
Trigger: Running `cargo build` when `prost_build::Config::compile_protos(&["proto/dnstap.proto"], &["proto"])` fails — missing proto file, malformed .proto syntax, or `protoc` unavailable.
Common situations: Partial checkout missing proto/dnstap.proto; editing dnstap.proto and introducing syntax errors; build environments without protoc or with an incompatible protoc version; stale build caches after proto moves.
Understand the failure class
Background: "cannot parse invalid wire-format data", "cannot unmarshal", "failed unmarshalling": protobuf unmarshal errors explained — this error's family across 10 libraries.
Related errors
- Env var DD_ORIGIN_PRODUCT must be an unsigned 32 bit…
- error_tps cannot be Nan
- Failed to build Vector for example validation
- invalid timestamp
- not implemented
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/3374a82436e0ca5e.
Report an issue: GitHub.
Appendix: source
Thrown at lib/vector-vrl/dnstap-parser/build.rs:7
fn main() {
println!("cargo:rerun-if-changed=proto/dnstap.proto");
let mut prost_build = prost_build::Config::new();
prost_build.btree_map(["."]);
prost_build
.compile_protos(&["proto/dnstap.proto"], &["proto"])
.expect("Failed to compile proto files");
}
View on GitHub (pinned to bdb87aeaa4)