go network_error ai_generated true

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

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

Also available as: JSON · Markdown · 中文
80%Fix Rate
80%Confidence
0Evidence
2024-05-18First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.x active

Root Cause

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

中文

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

Workarounds

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

Dead Ends

Common approaches that don't work:

  1. 90% fail

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

  2. 100% fail

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