{"record":{"id":"3374a82436e0ca5e","repo":"vectordotdev/vector","slug":"failed-to-compile-proto-files","errorCode":null,"errorMessage":"Failed to compile proto files","messagePattern":"Failed to compile proto files","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"lib/vector-vrl/dnstap-parser/build.rs","lineNumber":7,"sourceCode":"fn main() {\n    println!(\"cargo:rerun-if-changed=proto/dnstap.proto\");\n    let mut prost_build = prost_build::Config::new();\n    prost_build.btree_map([\".\"]);\n    prost_build\n        .compile_protos(&[\"proto/dnstap.proto\"], &[\"proto\"])\n        .expect(\"Failed to compile proto files\");\n}\n","sourceCodeStart":1,"sourceCodeEnd":9,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/lib/vector-vrl/dnstap-parser/build.rs#L1-L9","documentation":"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.","triggerScenarios":"Running `cargo build` when `prost_build::Config::compile_protos(&[\"proto/dnstap.proto\"], &[\"proto\"])` fails — missing proto file, malformed .proto syntax, or `protoc` unavailable.","commonSituations":"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.","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"],"exampleFix":"// before (proto file missing from checkout)\n$ cargo build\nerror: Failed to compile proto files\n// after\n$ git checkout -- lib/vector-vrl/dnstap-parser/proto/dnstap.proto\n$ cargo build  # succeeds","handlingStrategy":"validation","validationCode":"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","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["build","protobuf","prost","rust"],"backgroundTag":"protobuf-unmarshal-failed","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}