# rpc 错误：代码 = Internal，描述 = 流被 RST_STREAM 终止，错误码：PROTOCOL_ERROR

- **ID:** `go/grpc-internal-http2-frame-error`
- **领域:** go
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

客户端与服务端之间的 HTTP/2 帧协议违规。常见于中间代理（nginx/Envoy）不支持 gRPC，或 h2c/TLS 配置不一致。

## 版本兼容性

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

## 解决方案

1. **** (85% 成功率)
   ```
   Configure the proxy for gRPC (HTTP/2 end-to-end). For nginx:
location /pb.UserService/ {
  grpc_pass grpc://backend:50051;
  grpc_read_timeout 300s;
}
   ```
2. **** (90% 成功率)
   ```
   Bypass the proxy entirely to isolate: dial the gRPC server directly from the client host and confirm the call succeeds.
   ```

## 无效尝试

- **** — PROTOCOL_ERROR is a framing issue, not a stream-count limit. (90% 失败率)
- **** — Keepalives don't fix malformed HTTP/2 frames; aggressive pings may trigger GOAWAY from servers. (80% 失败率)
