go network_error ai_generated true

rpc 错误:代码 = Internal,描述 = 流被 RST_STREAM 终止,错误码:PROTOCOL_ERROR

rpc error: code = Internal desc = stream terminated by RST_STREAM with error code: PROTOCOL_ERROR

ID: go/grpc-internal-http2-frame-error

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
0证据数
2024-08-12首次发现

版本兼容性

版本状态引入弃用备注
1.50+ active

根因分析

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

English

HTTP/2 framing violation between client and server. Often caused by an intermediate proxy (nginx/Envoy) that doesn't support gRPC, or a mismatched h2c/TLS configuration.

generic

解决方案

  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.

无效尝试

常见但无效的做法:

  1. 90% 失败

    PROTOCOL_ERROR is a framing issue, not a stream-count limit.

  2. 80% 失败

    Keepalives don't fix malformed HTTP/2 frames; aggressive pings may trigger GOAWAY from servers.