{"record":{"id":"34dda9188ea760b4","repo":"thanos-io/thanos","slug":"proto-wrong-wiretype-d-for-field-value","errorCode":null,"errorMessage":"proto: wrong wireType = %d for field Value","messagePattern":"proto: wrong wireType = (.+?) for field Value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/status/statuspb/rpc.pb.go","lineNumber":1886,"sourceCode":"\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 {\n\t\t\t\treturn ErrInvalidLengthRpc\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthRpc\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tm.Name = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tcase 2:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field Value\", wireType)\n\t\t\t}\n\t\t\tm.Value = 0\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowRpc\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\tm.Value |= 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\tdefault:\n\t\t\tiNdEx = preIndex","sourceCodeStart":1868,"sourceCodeEnd":1904,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/status/statuspb/rpc.pb.go#L1868-L1904","documentation":"Generated gogoproto Unmarshal guard for field 2 (Value) of the Statistic message in pkg/status/statuspb/rpc.pb.go:1886. Value is a numeric field encoded as varint; the error fires when field 2 arrives with any other wire type, meaning the incoming bytes do not match the compiled schema.","triggerScenarios":"Unmarshaling a Statistic message where field 2 arrives with wire type 2, 1, or 5 instead of varint (0), typically when sender and receiver schemas differ.","commonSituations":"Thanos component version mismatch; receiver's generated rpc.pb.go stale versus the sender's proto; corrupted gRPC streams or interop with a non-conforming encoder.","solutions":["Use the same Thanos version and generated statuspb code on both peers","Regenerate rpc.pb.go from the canonical rpc.proto","Confirm Value is field 2 with a varint proto type in the sender's schema","Inspect raw wire frames if the mismatch persists after version alignment"],"exampleFix":"// before: stale generated code on receiver\ngo mod tidy // pulls mismatched statuspb\n// after\nmake proto && go mod tidy && go build ./...","handlingStrategy":"try-catch","validationCode":"if !semverCompatible(peerVersion, minSupportedVersion) {\n    return fmt.Errorf(\"peer %s version %s incompatible for TSDB statistics\", peer, peerVersion)\n}","typeGuard":null,"tryCatchPattern":"if err := proto.Unmarshal(buf, &stat); err != nil {\n    if strings.Contains(err.Error(), \"field Value\") {\n        return fmt.Errorf(\"schema mismatch (Value): %w\", err)\n    }\n    return err\n}","preventionTips":["Regenerate *.pb.go after any rpc.proto change","Keep all Thanos components on a single release train","Add CI round-trip tests for the Statistic message","Log both peers' versions whenever a decode error occurs"],"tags":["protobuf","grpc","deserialization","wire-format","gogoproto"],"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"}