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

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

## Root Cause

The underlying HTTP/2 transport was closed while an RPC was in flight. Causes include server shutdown, keepalive timeout, or a proxy (e.g., Envoy) closing idle connections.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| google.golang.org/grpc 1.x | active | — | — |

## Workarounds

1. **** (85% success)
   ```
   conn, _ := grpc.Dial(addr,
    grpc.WithKeepaliveParams(keepalive.ClientParameters{
        Time:                30 * time.Second,
        Timeout:             10 * time.Second,
        PermitWithoutStream: true,
    }),
)
   ```
2. **** (80% success)
   ```
   for {
    resp, err := client.Get(ctx, req)
    if err == nil { return resp, nil }
    c := status.Code(err)
    if c != codes.Internal && c != codes.Unavailable { return nil, err }
    time.Sleep(backoff.NextBackOff())
}
   ```

## Dead Ends

- **** — The response body is empty; downstream code will fail parsing nil/empty data. (90% fail)
- **** — WithBlock only affects initial dial; it does not prevent mid-call transport closure. (80% fail)
