liminfo

gRPC Status Code Reference

Free web tool: gRPC Status Code Reference

17 results
gRPCCodeHTTPTypeDescriptionExample
OK0200SuccessSuccess
CANCELLED1499ClientClient cancelled request
UNKNOWN2500ServerUnknown error
INVALID_ARGUMENT3400ClientInvalid request argument
DEADLINE_EXCEEDED4504ServerDeadline exceeded
NOT_FOUND5404ClientResource not found
ALREADY_EXISTS6409ClientResource already exists
PERMISSION_DENIED7403ClientPermission denied
RESOURCE_EXHAUSTED8429ServerResource exhausted (rate limit)
FAILED_PRECONDITION9400ClientFailed precondition
ABORTED10409ServerAborted (transaction conflict)
OUT_OF_RANGE11400ClientOut of range
UNIMPLEMENTED12501ServerUnimplemented method
INTERNAL13500ServerInternal error
UNAVAILABLE14503ServerService unavailable
DATA_LOSS15500ServerData loss
UNAUTHENTICATED16401ClientAuthentication required

About gRPC Status Code Reference

The gRPC Status Code Reference provides a complete, searchable mapping of all 17 official gRPC status codes defined by Google, showing each code's string name (e.g., NOT_FOUND), numeric code (0–16), corresponding HTTP status code equivalent, and a concise description. Developers can filter the table in real time by typing a gRPC status name, numeric code, or HTTP code number into the search field, making it fast to look up a specific code during debugging or API design.

gRPC uses a distinct status code system from HTTP, and mapping between the two is a common requirement when building REST-to-gRPC transcoding layers, API gateways, or error handling middleware. For example, gRPC OK (code 0) maps to HTTP 200, NOT_FOUND (code 5) maps to HTTP 404, PERMISSION_DENIED (code 7) maps to HTTP 403, and UNAVAILABLE (code 14) maps to HTTP 503. The HTTP equivalents shown follow the canonical mapping recommended by Google's gRPC HTTP/JSON transcoding specification.

This reference is designed for backend developers, DevOps engineers building gRPC services, and API architects designing error-handling conventions. The table renders entirely in the browser without any server round-trip; HTTP status codes are color-coded — green for 2xx success codes, yellow for 4xx client errors, and red for 5xx server errors — making it easy to visually distinguish the severity of each gRPC error. All 17 gRPC codes from OK through UNAUTHENTICATED are included.

Key Features

  • All 17 official gRPC status codes from OK (0) to UNAUTHENTICATED (16)
  • Real-time search by gRPC name, numeric code, or HTTP status code
  • Color-coded HTTP badges: green (2xx), yellow (4xx), red (5xx)
  • Both gRPC string name and numeric code displayed side-by-side
  • Canonical HTTP mapping following Google's gRPC transcoding specification
  • Result count display to confirm search is working correctly
  • Bilingual support with English and Korean descriptions
  • 100% client-side — no network request required after page load

Frequently Asked Questions

What are the 17 gRPC status codes?

gRPC defines 17 status codes: OK (0), CANCELLED (1), UNKNOWN (2), INVALID_ARGUMENT (3), DEADLINE_EXCEEDED (4), NOT_FOUND (5), ALREADY_EXISTS (6), PERMISSION_DENIED (7), RESOURCE_EXHAUSTED (8), FAILED_PRECONDITION (9), ABORTED (10), OUT_OF_RANGE (11), UNIMPLEMENTED (12), INTERNAL (13), UNAVAILABLE (14), DATA_LOSS (15), and UNAUTHENTICATED (16). Each has a defined HTTP equivalent for transcoding.

What is the difference between PERMISSION_DENIED and UNAUTHENTICATED in gRPC?

UNAUTHENTICATED (code 16, HTTP 401) means the client has not provided authentication credentials or the credentials are invalid. PERMISSION_DENIED (code 7, HTTP 403) means the client is authenticated but does not have permission to perform the requested operation. In other words: UNAUTHENTICATED is "who are you?", while PERMISSION_DENIED is "I know who you are, but you cannot do this."

Why does gRPC CANCELLED map to HTTP 499?

HTTP 499 is a non-standard code used by Nginx to indicate that the client closed the connection before the server responded. The gRPC CANCELLED status (code 1) means the client cancelled the RPC in flight, which is conceptually similar to a client dropping the connection. Google adopted HTTP 499 as the canonical transcoding mapping for CANCELLED. It does not appear in the RFC 7231 HTTP specification but is widely understood in modern infrastructure.

What is gRPC RESOURCE_EXHAUSTED and when should I return it?

RESOURCE_EXHAUSTED (code 8, HTTP 429) indicates that a resource has been exhausted — most commonly a rate limit or quota. Return this code when a client exceeds their allowed request rate, when a server-side resource pool is full, or when a quota has been reached. Clients should implement exponential backoff and retry when they receive this status. It is the gRPC equivalent of HTTP 429 Too Many Requests.

What is the difference between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE?

FAILED_PRECONDITION (code 9) means the system is not in the required state to execute the operation — for example, trying to delete a non-empty directory. ABORTED (code 10) is used for operations that were aborted due to a concurrency conflict, such as a failed compare-and-swap or transaction abort. UNAVAILABLE (code 14) means the service is temporarily unavailable and the operation can be retried. FAILED_PRECONDITION and ABORTED are typically not retriable without fixing the precondition, while UNAVAILABLE is always safe to retry.

How should I handle gRPC DEADLINE_EXCEEDED in my client?

DEADLINE_EXCEEDED (code 4, HTTP 504) means the operation did not complete within the deadline set by the caller. In client code, you should distinguish it from CANCELLED: DEADLINE_EXCEEDED means the server may or may not have processed the request before the deadline expired, so the operation's state is unknown. For idempotent operations (like reads), it is usually safe to retry with a new deadline. For non-idempotent operations (like writes), check the server state before retrying to avoid duplicate side effects.

What does gRPC INTERNAL status code mean?

INTERNAL (code 13, HTTP 500) indicates that some invariant expected by the underlying system has been broken. It is the gRPC equivalent of a generic server-side error. Unlike UNKNOWN (code 2, HTTP 500), which is used for truly unknown errors or errors from sub-systems that don't use gRPC status codes, INTERNAL is used when the server detects a specific internal inconsistency or programming error. Clients generally should not retry INTERNAL errors without investigation.

Can I use this table as a reference for gRPC-Gateway or gRPC-Web transcoding?

Yes. The HTTP mappings shown in this table follow the canonical mappings documented in the gRPC HTTP/JSON transcoding specification and the grpc-gateway project defaults. When using grpc-gateway to expose a gRPC service as a REST API, or when using Envoy's gRPC-JSON transcoding filter, these are the HTTP status codes that will be returned for each gRPC error status by default. Some gateways allow you to override specific mappings via proto annotations.