{"record":{"id":"76e4b2c0ef2780a3","repo":"thanos-io/thanos","slug":"proto-wrong-wiretype-d-for-field-mintime","errorCode":null,"errorMessage":"proto: wrong wireType = %d for field MinTime","messagePattern":"proto: wrong wireType = (.+?) for field MinTime","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/status/statuspb/rpc.pb.go","lineNumber":1766,"sourceCode":"\t\t\t}\n\t\t\tm.ChunkCount = 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.ChunkCount |= int64(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\tcase 4:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field MinTime\", wireType)\n\t\t\t}\n\t\t\tm.MinTime = 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.MinTime |= int64(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\tcase 5:\n\t\t\tif wireType != 0 {","sourceCodeStart":1748,"sourceCodeEnd":1784,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/status/statuspb/rpc.pb.go#L1748-L1784","documentation":"Generated gogoproto Unmarshal guard for field 4 (MinTime) of the Statistic message in pkg/status/statuspb/rpc.pb.go:1766. MinTime is an int64 encoded as a varint; the error fires when the wire payload encodes field 4 with a different wire type, so the bytes cannot match the compiled schema.","triggerScenarios":"Unmarshaling a Statistic message where field 4 arrives with wire type 1, 2, or 5 instead of 0 (varint), i.e. the sender's schema or codec differs from the receiver's generated code.","commonSituations":"Version skew between Thanos components; message produced by a different protobuf generator that assigned different types/field numbers; corrupted or truncated gRPC stream frames.","solutions":["Use identical Thanos versions and statuspb generated code on both peers","Regenerate rpc.pb.go from the current rpc.proto with matching toolchain versions","Verify MinTime is field 4 (varint) in the sender's schema","Inspect raw wire bytes with grpclog/proxy tooling to confirm what the sender actually encoded"],"exampleFix":"// before: sender uses custom/older proto\nres.Marshal() // field types differ\n// after: both sides import the same statuspb package\nres := &statuspb.TSDBStatisticsResponse{Statistics: stats}\nbuf, _ := res.Marshal()","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 MinTime\") {\n        return fmt.Errorf(\"schema mismatch (MinTime): %w\", err)\n    }\n    return err\n}","preventionTips":["Align protoc/gogoproto versions across build environments","Verify int64 timestamp fields remain varint when editing the .proto","Add golden-file marshal/unmarshal round-trip tests","Reject responses from peers with unknown versions"],"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"}