go
grpc_error
ai_generated
partial
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp: lookup service: no such host"
ID: go/grpc-unavailable
80%Fix Rate
85%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1 | active | — | — | — |
Root Cause
gRPC UNAVAILABLE status indicates the service cannot be reached. Causes: server not running, DNS resolution failure, TLS mismatch, or load balancer health check failure.
genericWorkarounds
-
88% success Verify the gRPC server is running and the address is correct
Use grpcurl to test: grpcurl -plaintext localhost:50051 list Check if the server is listening: ss -tlnp | grep 50051
-
85% success Match TLS configuration between client and server
If server uses grpc.Creds(), client must use grpc.WithTransportCredentials(). If server uses insecure, client must use grpc.WithTransportCredentials(insecure.NewCredentials()).
Sources: https://pkg.go.dev/google.golang.org/grpc#WithTransportCredentials
Dead Ends
Common approaches that don't work:
-
Increase gRPC MaxRecvMsgSize to fix connection errors
90% fail
MaxRecvMsgSize controls message size limits, not connection establishment — UNAVAILABLE means the transport layer cannot connect
-
Disable gRPC keepalive pings
75% fail
Keepalives detect dead connections — disabling them hides connection failures without fixing the root cause
Error Chain
Leads to:
Preceded by:
Frequently confused with: