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

  1. Confirm `proto/dnstap.proto` exists in the dnstap-parser crate and run `cargo build` from the workspace root so relative paths resolve
  2. Fix any syntax errors in dnstap.proto (the prost error message names the line)
  3. Install/repair protoc and ensure it is on PATH with a version compatible with prost-build
  4. 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

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


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)