# rpc error: code = Unavailable desc = closing transport due to: connection error: desc = "error reading from server: EOF", received prior goaway: code: ENHANCE_YOUR_CALM, debug data: "too_many_pings"

- **ID:** `go/grpc-keepalive-too-aggressive`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The client sends keepalive pings more frequently than the server's MinTime permits, causing the server to send GOAWAY with ENHANCE_YOUR_CALM.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.50+ | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Set client keepalive to at least the server's MinTime (default 5 min):
conn, _ := grpc.NewClient(addr,
  grpc.WithKeepaliveParams(keepalive.ClientParameters{
    Time: 5*time.Minute, Timeout: 20*time.Second, PermitWithoutStream: false,
  }))
   ```
2. **** (85% success)
   ```
   On the server, lower the enforcement threshold:
srv := grpc.NewServer(grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
  MinTime: 10*time.Second, PermitWithoutStream: true,
}))
   ```

## Dead Ends

- **** — Loses detection of dead connections through idle NAT/LB timeouts, causing silent hangs. (60% fail)
- **** — MaxConnectionAge is a server option; the client's setting is ignored. (90% fail)
