gRPC status 14: UNAVAILABLE

UNAVAILABLE is gRPC status code 14. The service cannot be reached right now. It is usually transient, and the most common error when a call never gets through.

Updated

Usual causes

  • Nothing is listening at that address: the server is down, restarting, or on another port.
  • The name did not resolve, or there is no route to the host (DNS, VPN, firewall).
  • A TLS mismatch: a plaintext client dialled a TLS port, or a TLS client dialled a plaintext one.
  • The connection was reset or dropped mid-call, often by a load balancer or a server shutting down.
  • The server is overloaded or draining and is shedding load.

What to check

  1. Host and port, then whether the server is running.
  2. Whether the port expects TLS; error reading server preface: http2: frame too large is the classic sign of a plaintext client on a TLS port.
  3. DNS and VPN for internal hostnames.
  4. Load balancer idle timeouts and keepalive settings, if calls fail after a period of quiet.

Not to be confused with

DEADLINE_EXCEEDED means time ran out; UNAVAILABLE means the transport failed before or during the call.

What it looks like

A typical error, as a Go client prints it: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:50051: connect: connection refused"

Retry, and the HTTP equivalent

UNAVAILABLE
Code14
NameUNAVAILABLE
In istek's status barunavailable
RetryYes, with exponential backoff. It is the code gRPC's own retry policies are designed around.
HTTP status503

istek names the status of every call it makes, unavailable included, and explains transport failures in plain words. See istek.

istek, $29 once

macOS 14.0+ · Apple Silicon · no account, no telemetry

Buy istek · $29