{"record":{"id":"cb8d16c35e8d41d9","repo":"thanos-io/thanos","slug":"proto-wrong-wiretype-d-for-field-maxtime","errorCode":null,"errorMessage":"proto: wrong wireType = %d for field MaxTime","messagePattern":"proto: wrong wireType = (.+?) for field MaxTime","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/status/statuspb/rpc.pb.go","lineNumber":1785,"sourceCode":"\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 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field MaxTime\", wireType)\n\t\t\t}\n\t\t\tm.MaxTime = 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.MaxTime |= 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\tdefault:\n\t\t\tiNdEx = preIndex","sourceCodeStart":1767,"sourceCodeEnd":1803,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/status/statuspb/rpc.pb.go#L1767-L1803","documentation":"Generated gogoproto Unmarshal guard for field 5 (MaxTime) of the Statistic message in pkg/status/statuspb/rpc.pb.go:1785. Like MinTime, MaxTime must be varint-encoded; the error fires when field 5 arrives with any other wire type, indicating the wire data does not match the compiled schema.","triggerScenarios":"Unmarshaling a Statistic message where field 5 arrives with wire type 1, 2, or 5 instead of varint (0).","commonSituations":"Thanos component version mismatch; sender generated from a modified rpc.proto; proxy or service mesh mangling gRPC frames; interop with a hand-written protobuf encoder.","solutions":["Pin both client and server to the same Thanos version so the schema matches","Regenerate the statuspb package from the canonical rpc.proto","Confirm MaxTime is field 5 (varint) in the sender's schema","Log the raw gRPC payload to identify exactly what the sender encoded"],"exampleFix":"// before: mixed versions\nquerier (v0.30) -> store (v0.32)\n// after\nquerier and store upgraded to the same release","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 MaxTime\") {\n        return fmt.Errorf(\"schema mismatch (MaxTime): %w\", err)\n    }\n    return err\n}","preventionTips":["Keep sender and receiver schemas in lockstep","Re-generate *.pb.go whenever rpc.proto changes","Round-trip test every message type in CI","Fail fast on peer version skew at startup"],"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"}