# rpc error: code = Unavailable desc = transport is closing

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

## Root Cause

The underlying HTTP/2 transport was torn down mid-RPC (server restart, idle timeout, or GOAWAY frame from load balancer).

## Version Compatibility

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

## Workarounds

1. **** (92% success)
   ```
   Enable client-side retry policy via service config:
conn, _ := grpc.NewClient(addr,
  grpc.WithDefaultServiceConfig(`{"methodConfig":[{"name":[{}],"retryPolicy":{"maxAttempts":5,"initialBackoff":"0.1s","maxBackoff":"1s","backoffMultiplier":2,"retryableStatusCodes":["UNAVAILABLE"]}}]}`))
   ```
2. **** (88% success)
   ```
   Tune keepalive to detect dead transports faster:
grpc.WithKeepaliveParams(keepalive.ClientParameters{Time: 30*time.Second, Timeout: 10*time.Second, PermitWithoutStream: true})
   ```

## Dead Ends

- **** — WithBlock only affects dial; the in-flight RPC still fails with Unavailable. (85% fail)
- **** — Keepalive is what detects dead transports; disabling it hides the symptom but leaves zombie connections. (70% fail)
