gRPC status 2: UNKNOWN

UNKNOWN is gRPC status code 2. An error with no better code: the server failed in a way it did not classify.

Updated

Usual causes

  • The server handler threw an exception or returned a plain error without a gRPC status; most servers report that as UNKNOWN.
  • A status came from another error space that has no gRPC equivalent.
  • The server returned a status code number the client does not know.

What to check

  1. The status message: it is usually the text of the exception the handler raised.
  2. The server's logs at the time of the call, for the stack trace.
  3. Whether the handler wraps its errors in a proper status; UNKNOWN is a sign it does not.

What it looks like

A typical error, as a Go client prints it: rpc error: code = Unknown desc = runtime error: invalid memory address or nil pointer dereference

Retry, and the HTTP equivalent

UNKNOWN
Code2
NameUNKNOWN
In istek's status barunknown
RetryNot blindly: the failure is unclassified, so it may happen again or may have half-applied.
HTTP status500

istek names the status of every call it makes, unknown 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