# rpc error: code = Unavailable desc = error reading from server: EOF

- **ID:** `go/grpc-connection-closing-transport`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The server closed the HTTP/2 connection mid-stream. Typically the server process exited, was restarted, or a proxy/load balancer dropped the connection.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| grpc-go 1.58+ | active | — | — |

## Workarounds

1. **** (85% success)
   ```
   Enable client keepalive to detect dead connections quickly:
conn, err := grpc.NewClient(addr,
    grpc.WithKeepaliveParams(keepalive.ClientParameters{
        Time: 10 * time.Second, Timeout: 3 * time.Second, PermitWithoutStream: true,
    }),
)
   ```
2. **** (82% success)
   ```
   Add a retry policy for UNAVAILABLE and inspect server logs for crashes:
// configure retryableStatusCodes: ["UNAVAILABLE"] in the service config, then check server OOM/panic logs.
   ```

## Dead Ends

- **** — The error originates at the transport layer from the server side closing the connection; the client handler is not at fault. (70% fail)
- **** — Disabling keepalive does not prevent the server from closing; it actually makes stale connections harder to detect. (80% fail)
