go
network_error
ai_generated
true
rpc error: code = Unavailable desc = last connection error: connection error: desc = "transport: Error while dialing: dial tcp: lookup grpc.example.com on 10.0.0.2:53: no such host"
ID: go/grpc-unavailable-subchannel-transient-failure
80%Fix Rate
87%Confidence
0Evidence
2025-03-04First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.30+ | active | — | — | — |
Root Cause
DNS resolution failed for the gRPC target. Common in Kubernetes when the service name is wrong, the DNS server is unreachable, or the pod's resolv.conf is misconfigured.
generic中文
gRPC 目标的 DNS 解析失败。常见于 Kubernetes 中服务名错误、DNS 服务器不可达,或 Pod 的 resolv.conf 配置错误时。
Workarounds
-
92% success
// Use <service>.<namespace>.svc.cluster.local conn, _ := grpc.Dial("users.default.svc.cluster.local:50051", grpc.WithTransportCredentials(insecure.NewCredentials())) -
88% success
conn, _ := grpc.Dial("dns:///users.default.svc.cluster.local:50051", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultServiceConfig(`{"loadBalancingConfig":[{"round_robin":{}}]}`))
Dead Ends
Common approaches that don't work:
-
75% fail
Breaks when the backend pod is rescheduled; loses load balancing across replicas
-
90% fail
DNS NXDOMAIN returns immediately; a longer timeout does not make the name resolve