go network_error ai_generated true

rpc error: code = Unavailable desc = name resolver error: produced zero addresses

ID: go/grpc-failed-to-exit-idle

Also available as: JSON · Markdown · 中文
80%Fix Rate
82%Confidence
0Evidence
2024-11-23First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.x active — — —

Root Cause

The name resolver (DNS or custom) returned no addresses for the target. Often a typo in the target string, a DNS failure, or a resolver that has not yet received updates.

generic

中文

名称解析器(DNS 或自定义)为目标返回了零个地址。通常是目标字符串拼写错误、DNS 失败,或解析器尚未收到更新。

Workarounds

  1. 90% success
    Verify the target format: use dns:///host:port or passthrough:///host:port explicitly, and check that the hostname resolves with net.LookupHost.
  2. 85% success
    For custom resolvers, implement the Resolver interface correctly and call cc.UpdateState with a non-empty Addresses slice; add logging in Build to confirm resolution.

Dead Ends

Common approaches that don't work:

  1. 60% fail

    Bypassing the resolver breaks load balancing and service discovery, and the IP may change.

  2. 75% fail

    If the resolver genuinely returns zero addresses, waiting longer does not produce addresses.