go network_error ai_generated true

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

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

ID: go/grpc-failed-precondition-stream-closed

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

版本兼容性

版本状态引入弃用备注
1.x active

根因分析

由于协议违规,例如在流关闭后发送数据或格式错误的帧,gRPC 流被服务器或客户端重置。

English

The gRPC stream was reset by the server or client due to a protocol violation, such as sending data after the stream is closed or malformed framing.

generic

解决方案

  1. 85% 成功率
    Call CloseSend() only after all messages are sent, and handle the send error properly.
  2. 70% 成功率
    Configure the proxy to support HTTP/2 and not buffer or modify stream frames.

无效尝试

常见但无效的做法:

  1. 90% 失败

    This error is not timeout-related; increasing timeout will not prevent RST_STREAM.

  2. 100% 失败

    gRPC requires HTTP/2; disabling it will break gRPC entirely.