{"record":{"id":"3eb541e7faa6cc26","repo":"gravitational/teleport","slug":"proto-wrong-wiretype-d-for-field-recoverystart","errorCode":null,"errorMessage":"proto: wrong wireType = %d for field RecoveryStartTokenID","messagePattern":"proto: wrong wireType = (.+?) for field RecoveryStartTokenID","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/client/proto/authservice.pb.go","lineNumber":60073,"sourceCode":"\t\t\tif msglen < 0 {\n\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\tv := &UserCredentials{}\n\t\t\tif err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tm.Request = &CreateAuthenticateChallengeRequest_UserCredentials{v}\n\t\t\tiNdEx = postIndex\n\t\tcase 2:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field RecoveryStartTokenID\", wireType)\n\t\t\t}\n\t\t\tvar stringLen uint64\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\tstringLen |= 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\t\tintStringLen := int(stringLen)\n\t\t\tif intStringLen < 0 {","sourceCodeStart":60055,"sourceCodeEnd":60091,"githubUrl":"https://github.com/gravitational/teleport/blob/1283425b60ec5f60d509ba4c791183d452923ff7/api/client/proto/authservice.pb.go#L60055-L60091","documentation":"The decoder expects field 2 (RecoveryStartTokenID, a string) to be wire type 2 (length-delimited). Any other wire type on tag 2 triggers this error during CreateAuthenticateChallengeRequest unmarshaling.","triggerScenarios":"Decoding bytes where tag 2 is encoded as varint/fixed instead of a length-delimited string — mismatched proto definitions or corrupted/manually-built payloads.","commonSituations":"Client/server built from different proto versions where RecoveryStartTokenID changed type or number; payload corruption; test fixtures with wrong bytes.","solutions":["Rebuild both endpoints from the same authservice.proto","Set RecoveryStartTokenID via the generated struct field so Marshal emits wire type 2","Inspect the payload with protoc --decode_raw to confirm field 2's encoding","Clear stale generated .pb.go artifacts and regenerate"],"exampleFix":"// before\n// hand-encoded field 2 as varint\n// after\nreq := &proto.CreateAuthenticateChallengeRequest{\n  Request: &proto.CreateAuthenticateChallengeRequest_RecoveryStartTokenID{\"tok\"},\n}\nb, _ := req.Marshal()","handlingStrategy":"validation","validationCode":"// strings must be length-delimited; just ensure value is a Go string set on the struct\nif req.GetRequest() == nil && req.GetRecoveryStartTokenID() == \"\" { /* caller must set oneof */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set RecoveryStartTokenID as a plain string on the generated struct","Avoid proto type changes for existing field numbers","Regenerate code after proto edits; never edit .pb.go by hand","Validate payloads with protoc --decode_raw when debugging"],"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"}