go
network_error
ai_generated
true
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:50051: connect: connection refused"
ID: go/grpc-connection-refused
80%Fix Rate
90%Confidence
0Evidence
2024-07-19First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.7 | active | — | — | — |
Root Cause
Server is not running or the port is not open.
generic中文
服务器未运行或端口未开放。
Workarounds
-
100% success
lis, _ := net.Listen("tcp", ":50051"); s := grpc.NewServer(); pb.RegisterGreeterServer(s, &server{}); s.Serve(lis) -
90% success
Ensure client dials the correct address: grpc.Dial("localhost:50051", grpc.WithInsecure())
Dead Ends
Common approaches that don't work:
-
90% fail
The server is not listening on any port.
-
50% fail
Firewall is not the issue if the server is not running.