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
- The status message: it is usually the text of the exception the handler raised.
- The server's logs at the time of the call, for the stack trace.
- Whether the handler wraps its errors in a proper status;
UNKNOWNis 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 | |
|---|---|
| Code | 2 |
| Name | UNKNOWN |
| In istek's status bar | unknown |
| Retry | Not blindly: the failure is unclassified, so it may happen again or may have half-applied. |
| HTTP status | 500 |
istek names the status of every call it makes, unknown included, and explains transport failures in plain words. See istek.