# grpc._channel._MultiThreadedRendezvous: <StatusCode.UNAVAILABLE: 14> Stream removed

- **ID:** `grpc/stream-remotely-closed`
- **Domain:** grpc
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

The server closed the gRPC stream due to a network disruption or server-side shutdown.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC v1.40.0 | active | — | — |
| gRPC v1.50.0 | active | — | — |
| gRPC v1.60.0 | active | — | — |

## Workarounds

1. **Implement automatic reconnection logic in the client. Example in Python with grpc.aio: async def streaming_rpc(): async with grpc.aio.insecure_channel('localhost:50051') as channel: stub = MyStub(channel); async for response in stub.MyStream(request): process(response)** (80% success)
   ```
   Implement automatic reconnection logic in the client. Example in Python with grpc.aio: async def streaming_rpc(): async with grpc.aio.insecure_channel('localhost:50051') as channel: stub = MyStub(channel); async for response in stub.MyStream(request): process(response)
   ```
2. **Check server logs for errors like 'connection reset by peer' and ensure the server is stable. Use a load balancer to distribute connections.** (75% success)
   ```
   Check server logs for errors like 'connection reset by peer' and ensure the server is stable. Use a load balancer to distribute connections.
   ```
3. **Set the grpc.keepalive_time_ms option on the client to a lower value (e.g., 10000 ms) to detect dead connections faster and reconnect.** (70% success)
   ```
   Set the grpc.keepalive_time_ms option on the client to a lower value (e.g., 10000 ms) to detect dead connections faster and reconnect.
   ```

## Dead Ends

- **** — The server or network issue persists; client restart doesn't fix the underlying cause. (70% fail)
- **** — The error is not about timeout but about stream removal; longer timeouts won't prevent stream closure. (85% fail)
- **** — Keepalive pings help detect dead connections; disabling them may delay detection but not prevent stream removal. (60% fail)
