{"record":{"id":"bcb60cde2f7a4c42","repo":"thanos-io/thanos","slug":"proto-wrong-wiretype-d-for-field-symbols","errorCode":null,"errorMessage":"proto: wrong wireType = %d for field Symbols","messagePattern":"proto: wrong wireType = (.+?) for field Symbols","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/store/storepb/prompb/io/prometheus/write/v2/custom.go","lineNumber":43,"sourceCode":"\t\t\tb := dAtA[iNdEx]\n\t\t\tiNdEx++\n\t\t\twire |= uint64(b&0x7F) << shift\n\t\t\tif b < 0x80 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfieldNum := int32(wire >> 3)\n\t\twireType := int(wire & 0x7)\n\t\tif wireType == 4 {\n\t\t\treturn fmt.Errorf(\"proto: Request: wiretype end group for non-group\")\n\t\t}\n\t\tif fieldNum <= 0 {\n\t\t\treturn fmt.Errorf(\"proto: Request: illegal tag %d (wire type %d)\", fieldNum, wire)\n\t\t}\n\t\tswitch fieldNum {\n\t\tcase 4:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field Symbols\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowTypes\n\t\t\t\t}\n\t\t\t\tif iNdEx >= l {\n\t\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t\t}\n\t\t\t\tb := dAtA[iNdEx]\n\t\t\t\tiNdEx++\n\t\t\t\tstringLen |= uint64(b&0x7F) << shift\n\t\t\t\tif b < 0x80 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/store/storepb/prompb/io/prometheus/write/v2/custom.go#L25-L61","documentation":"In the remote-write v2 Request Unmarshal, field 4 (Symbols) is a length-delimited string (wire type 2). If the bytes declare a different wire type for that field, the decoder returns this error because the schema cannot be satisfied.","triggerScenarios":"Unmarshal called on bytes where the tag for field 4 carries a non-2 wire type — produced by a mismatched schema version (Symbols renumbered between draft versions of remote-write v2), or by corrupt input.","commonSituations":"Version skew between remote-write v2 draft implementations (the spec changed field numbering during development), sender and receiver generated from different .proto files, corrupted payloads.","solutions":["Align both ends on the same final remote-write v2 proto definition (regenerate from the current prometheus/prometheus prompb)","Check the sender's remote-write version header and reject mismatches","Re-serialize the request with the receiver's expected schema","Inspect raw bytes with protoc --decode_raw to confirm the wire layout"],"exampleFix":"// before: decoding with mismatched generated code\nerr := req.Unmarshal(body) // req generated from old draft schema\n// after: regenerate prompb v2 from current spec\ngoji run protoc --go_out=. io/prometheus/write/v2/types.proto","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := req.Unmarshal(body); err != nil { return http.StatusBadRequest }","preventionTips":["Pin one prometheus/prometheus version for all senders and receivers","Reject requests whose RW version header mismatches the supported schema","Add conformance tests that round-trip marshal/unmarshal v2 requests"],"tags":["protobuf","unmarshal","wire-format","remote-write"],"backgroundTag":"protobuf-unmarshal-failed","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}