{"record":{"id":"ef96c5e5baaf39a0","repo":"gravitational/teleport","slug":"proto-wrong-wiretype-d-for-field-proxyaddress","errorCode":null,"errorMessage":"proto: wrong wireType = %d for field ProxyAddress","messagePattern":"proto: wrong wireType = (.+?) for field ProxyAddress","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/client/proto/authservice.pb.go","lineNumber":60279,"sourceCode":"\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 {\n\t\t\t\treturn ErrInvalidLengthAuthservice\n\t\t\t}\n\t\t\tpostIndex := iNdEx + intStringLen\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\tm.SSOClientRedirectURL = string(dAtA[iNdEx:postIndex])\n\t\t\tiNdEx = postIndex\n\t\tcase 8:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field ProxyAddress\", 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":60261,"sourceCodeEnd":60297,"githubUrl":"https://github.com/gravitational/teleport/blob/1283425b60ec5f60d509ba4c791183d452923ff7/api/client/proto/authservice.pb.go#L60261-L60297","documentation":"Generated gogoproto Unmarshal code requires field 8 (ProxyAddress, a string) to be length-delimited (wire type 2). The encoded payload presents a different wire type for that field number, so decoding aborts with this error. This guards against decoding bytes produced by a different schema version or corrupt data.","triggerScenarios":"Unmarshal is handed bytes where tag 8 of the message carrying ProxyAddress uses wire type != 2 (e.g. a varint or fixed-width encoding), typically during a gRPC call whose request/response includes ProxyAddress.","commonSituations":"Version skew between teleport client and auth server (field renumbering after schema changes); a third-party client encoding ProxyAddress as another type; corrupted bytes over an unreliable transport; replaying old serialized messages against a newer binary.","solutions":["Align the proto schema/generated code versions between sender and receiver (upgrade the older binary)","Re-serialize the message with the current api/client/proto definitions instead of replaying stale bytes","Decode the payload with protoc --decode_raw to check which wire type field 8 actually uses","Rule out corruption by verifying checksums/TLS termination points that could truncate frames"],"exampleFix":"// before: stale cached message bytes from an older schema\nblob := cache.Load(\"proxy_req.bin\")\n// after: re-marshal from the live struct with current generated code\nblob, err := proto.Marshal(req)\nif err != nil { return trace.Wrap(err) }\nerr = proto.Unmarshal(blob, out)","handlingStrategy":"validation","validationCode":"func validatePayloadBoundary(b []byte) error {\n    if len(b) == 0 { return errors.New(\"empty payload\") }\n    if bytes.Equal(b, make([]byte, len(b))) { return errors.New(\"all-zero payload\") }\n    return nil\n}\n// run validatePayloadBoundary(blob) before proto.Unmarshal","typeGuard":"func isWireTypeError(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"wrong wireType = \")\n}","tryCatchPattern":"if err := proto.Unmarshal(blob, msg); err != nil {\n    if isWireTypeError(err) {\n        log.WithError(err).Warn(\"schema mismatch on ProxyAddress field; requesting re-sync\")\n        return trace.BadParameter(\"incompatible payload schema\")\n    }\n    return trace.Wrap(err)\n}","preventionTips":["Keep sender and receiver on the same generated proto schema version","Re-marshal stale persisted messages instead of replaying old bytes","Inspect payloads with protoc --decode_raw when versions change","Avoid middlewares that rewrite or truncate binary frames"],"tags":["protobuf","grpc","wire-format","deserialization"],"backgroundTag":"proto-wire-type-mismatch","analyzedSha":"1283425b60ec5f60d509ba4c791183d452923ff7","analyzedAt":"2026-09-02T04:06:41.601Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}