go network_error ai_generated true

rpc错误:代码=不可用 描述=所有子连接都处于瞬态故障状态,最新连接错误:连接错误:描述="传输:拨号时出错:拨号tcp 10.0.0.1:8080:输入/输出超时"

rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: error while dialing: dial tcp 10.0.0.1:8080: i/o timeout"

ID: go/grpc-unavailable-load-balancer-fail

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
0证据数
2024-09-14首次发现

版本兼容性

版本状态引入弃用备注
1.0 active
1.1 active

根因分析

负载均衡器后面的所有后端服务器都不可达,通常是由于网络分区或服务器崩溃。

English

All backend servers behind a load balancer are unreachable, often due to network partition or server crash.

generic

解决方案

  1. 90% 成功率 Check the health of all backend servers and ensure they are reachable.
    Use curl or telnet to test connectivity: telnet 10.0.0.1 8080, and check server logs.
  2. 80% 成功率 Implement a fallback to a different load balancer or DNS resolver.
    resolver := resolver.NewBuilder("dns:///example.com:8080")
    conn, err := grpc.Dial("dns:///example.com:8080", grpc.WithInsecure(), grpc.WithResolvers(resolver))

无效尝试

常见但无效的做法:

  1. Restart the client application. 95% 失败

    The client is fine; the issue is with the servers or network.

  2. Increase the dial timeout to a very high value. 80% 失败

    If servers are down, longer timeout just delays the error.