# rpc error: code = Unavailable desc = connection error: desc = "transport: error while dialing: dial tcp 10.0.0.1:8080: connect: connection reset by peer"

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

## Root Cause

The TCP connection was reset by the remote peer, often due to server crash, firewall, or network issues.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0 | active | — | — |
| 1.1 | active | — | — |

## Workarounds

1. **Implement retry with exponential backoff and jitter.** (85% success)
   ```
   for i := 0; i < 5; i++ {
    conn, err := grpc.Dial("10.0.0.1:8080", grpc.WithInsecure(), grpc.WithBlock())
    if err == nil { return conn }
    time.Sleep(time.Duration(100*(1<<i)) * time.Millisecond)
}
   ```
2. **Check server logs and network connectivity.** (90% success)
   ```
   Verify server is running: netstat -an | grep 8080. Check firewall rules and network paths.
   ```

## Dead Ends

- **Retry the connection immediately without any delay.** — If the server is down or the network is unstable, immediate retry will likely fail again. (80% fail)
- **Ignore the error and assume the connection is fine.** — The connection is broken; continuing will result in more errors. (100% fail)
