gRPC 3 INVALID_ARGUMENT vs 14 UNAVAILABLE
Both gRPC 3 (INVALID_ARGUMENT) and 14 (UNAVAILABLE) belong to the gRPC Status Codes category. 3 indicates that the client specified an invalid argument. This indicates arguments that are problematic regardless of the state of the system. Meanwhile, 14 means that the service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff.
Description
The client specified an invalid argument. This indicates arguments that are problematic regardless of the state of the system.
When You See It
A request field failed validation — for example, a negative page size, a malformed email, or a required field left empty.
How to Fix
Inspect the request payload and fix the invalid field. Check the API documentation for expected formats and constraints.
Description
The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff.
When You See It
The server is overloaded, shutting down, or a network partition occurred. This is the most common code to retry on, as it's explicitly transient.
How to Fix
Retry with exponential backoff. If persistent, check the server health, load balancer configuration, and network connectivity between client and server.
Key Differences
gRPC 3: The client specified an invalid argument. This indicates arguments that are problematic regardless of the state of the system.
gRPC 14: The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff.
You encounter 3 when a request field failed validation — for example, a negative page size, a malformed email, or a required field left empty.
You encounter 14 when the server is overloaded, shutting down, or a network partition occurred. This is the most common code to retry on, as it's explicitly transient.
When to Use Which
For 3 (INVALID_ARGUMENT): Inspect the request payload and fix the invalid field. Check the API documentation for expected formats and constraints. For 14 (UNAVAILABLE): Retry with exponential backoff. If persistent, check the server health, load balancer configuration, and network connectivity between client and server.