# rpc error: code = Unavailable desc = 最后的解析器错误：产生零个地址

- **ID:** `go/grpc-failed-precondition-balancer`
- **领域:** go
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

名称解析器（DNS 或自定义）返回了空地址列表，通常由于没有就绪端点的无头服务，或格式错误的 target URI。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.x | active | — | — |

## 解决方案

1. **** (85% 成功率)
   ```
   _, addrs, err := net.DefaultResolver.LookupHost(context.Background(), "myservice.ns.svc.cluster.local")
log.Printf("addrs=%v err=%v", addrs, err)
   ```
2. **** (75% 成功率)
   ```
   conn, err := grpc.NewClient("static:///svc", grpc.WithResolvers(customResolver), grpc.WithTransportCredentials(insecure.NewCredentials()))
   ```

## 无效尝试

- **** — Bypasses resolution but then dials the literal string as an address, which may not be a valid host:port. (60% 失败率)
- **** — No addresses means every dial fails; retries never produce an address. (90% 失败率)
