# rpc 错误：代码 = Internal 描述 = grpc：响应反序列化错误：proto：无法解析无效的 wire-format 数据

- **ID:** `go/grpc-malformed-response`
- **领域:** go
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

服务器发送的响应不是有效的 protobuf 消息，可能是由于服务器序列化错误或网络流损坏。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.13 | active | — | — |

## 解决方案

1. **Check the server's protobuf version and regenerate code** (85% 成功率)
   ```
   protoc --go_out=. --go-grpc_out=. your.proto
   ```
2. **Enable gRPC max receive message size on the client** (80% 成功率)
   ```
   grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(10*1024*1024))
   ```

## 无效尝试

- **Ignore the error and retry with the same request** — If the server has a bug, it will likely produce the same malformed response. (70% 失败率)
- **Use a different protobuf library** — The wire format is standard; the issue is likely in the server's generation. (40% 失败率)
