{"record":{"id":"a66dd4fa17ee027b","repo":"gravitational/teleport","slug":"proto-wrong-wiretype-d-for-field-challengeexte","errorCode":null,"errorMessage":"proto: wrong wireType = %d for field ChallengeExtensions","messagePattern":"proto: wrong wireType = (.+?) for field ChallengeExtensions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/client/proto/authservice.pb.go","lineNumber":60211,"sourceCode":"\t\t\t\treturn ErrInvalidLengthAuthservice\n\t\t\t}\n\t\t\tpostIndex := iNdEx + msglen\n\t\t\tif postIndex < 0 {\n\t\t\t\treturn ErrInvalidLengthAuthservice\n\t\t\t}\n\t\t\tif postIndex > l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\tif m.MFARequiredCheck == nil {\n\t\t\t\tm.MFARequiredCheck = &IsMFARequiredRequest{}\n\t\t\t}\n\t\t\tif err := m.MFARequiredCheck.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tiNdEx = postIndex\n\t\tcase 6:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field ChallengeExtensions\", wireType)\n\t\t\t}\n\t\t\tvar msglen int\n\t\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\t\tif shift >= 64 {\n\t\t\t\t\treturn ErrIntOverflowAuthservice\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\tmsglen |= int(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\tif msglen < 0 {\n\t\t\t\treturn ErrInvalidLengthAuthservice","sourceCodeStart":60193,"sourceCodeEnd":60229,"githubUrl":"https://github.com/gravitational/teleport/blob/1283425b60ec5f60d509ba4c791183d452923ff7/api/client/proto/authservice.pb.go#L60193-L60229","documentation":"Protobuf unmarshal guard in generated code: while decoding CreateAuthenticateChallengeRequest, the ChallengeExtensions field arrived with an unexpected wire type instead of the length-delimited type expected for a message.","triggerScenarios":"Bytes where tag 6 is not length-delimited — produced by mismatched proto definitions, manual byte assembly, or stream corruption/misalignment.","commonSituations":"Version skew after ChallengeExtensions was added or retyped; test fixtures encoding it as a scalar; corrupted payload in transit.","solutions":["Ensure both peers use identical proto definitions for field 6 and regenerate code","Populate ChallengeExtensions via the generated struct and Marshal","Verify stream alignment: no off-by-one slicing before Unmarshal","Debug the raw payload with protoc --decode_raw"],"exampleFix":"// before\n// ChallengeExtensions encoded as varint\n// after\nm.ChallengeExtensions = &proto.ChallengeExtensions{Required: true}\nb, _ := m.Marshal()","handlingStrategy":"validation","validationCode":"// ensure ChallengeExtensions is present and marshaled as a message\nif req.ChallengeExtensions == nil { req.ChallengeExtensions = &proto.ChallengeExtensions{} }","typeGuard":"func hasChallengeExtensions(r *proto.CreateAuthenticateChallengeRequest) bool {\n  return r.GetChallengeExtensions() != nil\n}","tryCatchPattern":null,"preventionTips":["Only assign message structs to ChallengeExtensions","Avoid renumbering/retyping existing proto fields","Keep transport framing intact; no manual byte slicing before Unmarshal","Use protoc --decode_raw on failing payloads to confirm field encodings"],"tags":["protobuf","grpc","wire-format","version-skew"],"backgroundTag":"protobuf-wire-type-mismatch","analyzedSha":"1283425b60ec5f60d509ba4c791183d452923ff7","analyzedAt":"2026-09-02T04:06:41.601Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}