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

Also available as: JSON · Markdown · 中文
80%Fix Rate
90%Confidence
0Evidence
2024-07-19First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.7 active

Root Cause

Server is not running or the port is not open.

generic

中文

服务器未运行或端口未开放。

Workarounds

  1. 100% success
    lis, _ := net.Listen("tcp", ":50051"); s := grpc.NewServer(); pb.RegisterGreeterServer(s, &server{}); s.Serve(lis)
  2. 90% success
    Ensure client dials the correct address: grpc.Dial("localhost:50051", grpc.WithInsecure())

Dead Ends

Common approaches that don't work:

  1. 90% fail

    The server is not listening on any port.

  2. 50% fail

    Firewall is not the issue if the server is not running.