grpc connection_error ai_generated true

grpc._channel._InactiveRpcError: StatusCode.UNAVAILABLE: failed to connect to all addresses

ID: grpc/unavailable-connection-failed

Also available as: JSON · Markdown
88%Fix Rate
90%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1 active

Root Cause

gRPC client cannot reach the server. Server not running, wrong address/port, or TLS/plaintext mismatch.

generic

Workarounds

  1. 95% success Verify server is running and listening on expected port
    grpcurl -plaintext localhost:50051 list  # or ss -tlnp | grep 50051

    Sources: https://grpc.io/docs/guides/

  2. 90% success Check TLS mismatch: plaintext client vs TLS server or vice versa
    grpc.insecure_channel() for plaintext; grpc.secure_channel(creds) for TLS
  3. 85% success Check DNS resolution and firewall rules for remote servers
    dig server.example.com; telnet server.example.com 50051

Dead Ends

Common approaches that don't work:

  1. Add grpc.enable_http_proxy channel option 78% fail

    HTTP proxies do not support gRPC's HTTP/2 framing. This makes connection worse, not better.

  2. Switch to REST API as workaround 72% fail

    Loses gRPC benefits (streaming, protobuf efficiency, code generation). Fix the connection instead.