# rpc error: code = DataLoss desc = stream terminated by RST_STREAM with error code: INTERNAL_ERROR

- **ID:** `go/grpc-data-loss-stream-reset`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The HTTP/2 stream was reset by the peer, often due to a proxy (Envoy/nginx) killing long-lived streams or a server bug.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| google.golang.org/grpc 1.52+ | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Align proxy timeouts with gRPC keepalive:
// Envoy
stream_idle_timeout: 0s
// client
grpc.WithKeepaliveParams(keepalive.ClientParameters{Time: 30*time.Second, Timeout: 10*time.Second})
   ```
2. **** (85% success)
   ```
   Implement stream reconnection with jittered exponential backoff and resume from the last received cursor (application-level checkpointing).
   ```

## Dead Ends

- **** — RST_STREAM is a peer-initiated reset, not a timeout; a longer deadline won't stop it. (85% fail)
- **** — Reconnect storms against a misbehaving proxy worsen the outage. (80% fail)
