# INTERNAL: grpc: 收到大小为 16777216 的 HTTP/2 帧，超过配置的最大值 16384

- **ID:** `grpc/http2-max-frame-size-exceeded`
- **领域:** grpc
- **类别:** protocol_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

gRPC 服务器或客户端配置的 HTTP/2 最大帧大小小于对端发送的大小，导致协议违规。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| gRPC C++ 1.62.0 | active | — | — |
| gRPC Go 1.64.0 | active | — | — |
| Envoy 1.30.0 | active | — | — |

## 解决方案

1. ```
   将客户端和服务端的 `GRPC_ARG_HTTP2_MAX_FRAME_SIZE` 设置为更大的值（如 65536）：`export GRPC_ARG_HTTP2_MAX_FRAME_SIZE=65536`
   ```
2. ```
   在 gRPC-Web 或 Envoy 的 HTTP 连接管理器中配置 `max_frame_size`：`http_filters: [name: envoy.filters.http.grpc_web]` 然后设置 `max_request_size_kb: 65536`
   ```

## 无效尝试

- **Increase max frame size on client only to a very high value like 64MB** — The server may have its own limit; mismatch persists and can cause memory issues. (60% 失败率)
- **Disable HTTP/2 frame size checks entirely via environment variable** — Not a standard gRPC option; may lead to silent data corruption. (80% 失败率)
- **Restart both services without any config change hoping it's transient** — The misconfiguration persists across restarts. (90% 失败率)
