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

- **ID:** `go/grpc-failed-precondition-stream-closed`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.x | active | — | — |

## 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

- **** — This error is not timeout-related; increasing timeout will not prevent RST_STREAM. (90% fail)
- **** — gRPC requires HTTP/2; disabling it will break gRPC entirely. (100% fail)
