# rpc error: code = Unknown desc = unexpected EOF

- **ID:** `go/grpc-status-code-mismatch`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The gRPC stream is abruptly closed, possibly due to a network issue or server crash, and the client receives an EOF without a proper status code.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.5 | active | — | — |

## Workarounds

1. **Use a new connection for retries** (85% success)
   ```
   conn, _ := grpc.NewClient("localhost:50051", grpc.WithTransportCredentials(insecure.NewCredentials()))
defer conn.Close()
   ```
2. **Enable keepalive and connection recovery** (75% success)
   ```
   grpc.WithKeepaliveParams(keepalive.ClientParameters{Time: 10 * time.Second, Timeout: 3 * time.Second, PermitWithoutStream: true})
   ```

## Dead Ends

- **Retry the RPC immediately with the same connection** — The connection is likely broken, so retrying on the same connection will fail again. (80% fail)
- **Ignore the error and assume the response is empty** — The RPC did not complete successfully, so the response is invalid. (100% fail)
