{"record":{"id":"ad60ce3446563987","repo":"gravitational/teleport","slug":"proto-createauthenticatechallengerequest-wiretyp","errorCode":null,"errorMessage":"proto: CreateAuthenticateChallengeRequest: wiretype end group for non-group","messagePattern":"proto: CreateAuthenticateChallengeRequest: wiretype end group for non-group","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/client/proto/authservice.pb.go","lineNumber":60030,"sourceCode":"\t\tvar wire uint64\n\t\tfor shift := uint(0); ; shift += 7 {\n\t\t\tif shift >= 64 {\n\t\t\t\treturn ErrIntOverflowAuthservice\n\t\t\t}\n\t\t\tif iNdEx >= l {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\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: CreateAuthenticateChallengeRequest: wiretype end group for non-group\")\n\t\t}\n\t\tif fieldNum <= 0 {\n\t\t\treturn fmt.Errorf(\"proto: CreateAuthenticateChallengeRequest: illegal tag %d (wire type %d)\", fieldNum, wire)\n\t\t}\n\t\tswitch fieldNum {\n\t\tcase 1:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field UserCredentials\", 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]","sourceCodeStart":60012,"sourceCodeEnd":60048,"githubUrl":"https://github.com/gravitational/teleport/blob/1283425b60ec5f60d509ba4c791183d452923ff7/api/client/proto/authservice.pb.go#L60012-L60048","documentation":"Same class of gogo/protobuf generated decode error, but for the CreateAuthenticateChallengeRequest message: a wire type 4 (end-group) tag was encountered where no group field exists. The byte stream is not a valid CreateAuthenticateChallengeRequest encoding.","triggerScenarios":"Unmarshal (or gRPC receive) of bytes whose next tag has wireType==4 for CreateAuthenticateChallengeRequest — corrupted stream, wrong message type bytes, or offset misalignment.","commonSituations":"Sending bytes of Passwordless (or another message) to an endpoint expecting CreateAuthenticateChallengeRequest; corrupted transport; version skew after proto changes.","solutions":["Ensure the sender marshals CreateAuthenticateChallengeRequest, not another type","Check for byte-offset bugs (slicing the payload at the wrong index)","Align proto definitions between client and server; rebuild both","Decode the payload with protoc --decode_raw to identify where the stream diverges"],"exampleFix":"// before\nvar req proto.CreateAuthenticateChallengeRequest\nreq.Unmarshal(rawBytes) // rawBytes are actually a Passwordless message\n// after\nvar req proto.CreateAuthenticateChallengeRequest\nif err := proto.Unmarshal(createChallengeBytes, &req); err != nil { return trace.Wrap(err) }","handlingStrategy":"try-catch","validationCode":"if len(payload) == 0 || payload[0]&0x7 == 4 { return errors.New(\"payload is not a valid CreateAuthenticateChallengeRequest\") }","typeGuard":"func isLengthDelimitedFirstField(b []byte) bool {\n  return len(b) > 0 && b[0]&0x7 == 2\n}","tryCatchPattern":"var req proto.CreateAuthenticateChallengeRequest\nif err := proto.Unmarshal(payload, &req); err != nil {\n  return trace.BadParameter(\"could not decode challenge request: %v\", err)\n}","preventionTips":["Confirm the sender's message type matches the receiver's endpoint","Keep a single generated source of truth for proto types","Avoid slicing buffers at manual offsets; use codec framing","Add integration tests covering client/server version skew"],"tags":["protobuf","grpc","deserialization","wire-format"],"backgroundTag":"protobuf-unmarshal-failed","analyzedSha":"1283425b60ec5f60d509ba4c791183d452923ff7","analyzedAt":"2026-09-02T04:06:41.601Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}