# Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="failed to connect to all addresses; last error: UNKNOWN: Connection reset")

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

## Root Cause

gRPC client cannot establish or maintain a connection to the server, often due to server unavailability, network issues, or TLS configuration mismatches.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| dotnet 6.0 | active | — | — |
| dotnet 8.0 | active | — | — |
| Grpc.Core 2.46 | active | — | — |
| Grpc.Net.Client 2.60 | active | — | — |

## Workarounds

1. **Verify server health and network connectivity. Use tools like grpcurl to test the endpoint. Example: grpcurl -insecure <server>:<port> list.** (90% success)
   ```
   Verify server health and network connectivity. Use tools like grpcurl to test the endpoint. Example: grpcurl -insecure <server>:<port> list.
   ```
2. **Ensure TLS certificates are valid and trusted. If using self-signed certs in dev, set GrpcChannelOptions.HttpHandler to bypass validation.** (85% success)
   ```
   Ensure TLS certificates are valid and trusted. If using self-signed certs in dev, set GrpcChannelOptions.HttpHandler to bypass validation.
   ```
3. **Check firewall and load balancer settings to ensure gRPC port (usually 5001) is open and HTTP/2 is supported.** (80% success)
   ```
   Check firewall and load balancer settings to ensure gRPC port (usually 5001) is open and HTTP/2 is supported.
   ```

## Dead Ends

- **** — gRPC requires secure connections in production; disabling TLS can cause security warnings or failures if server enforces HTTPS. (80% fail)
- **** — Retries will continue to fail if the server is down or firewall blocks the port. (90% fail)
- **** — Does not fix the connection issue; just delays the timeout error. (70% fail)
