gRPC

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.

Descripción

The client specified an invalid argument. This indicates arguments that are problematic regardless of the state of the system.

Cuándo lo verás

A request field failed validation — for example, a negative page size, a malformed email, or a required field left empty.

Cómo solucionarlo

Inspect the request payload and fix the invalid field. Check the API documentation for expected formats and constraints.

Descripción

The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff.

Cuándo lo verás

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.

Cómo solucionarlo

Retry with exponential backoff. If persistent, check the server health, load balancer configuration, and network connectivity between client and server.

Diferencias clave

1.

gRPC 3: The client specified an invalid argument. This indicates arguments that are problematic regardless of the state of the system.

2.

gRPC 14: The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff.

3.

You encounter 3 when a request field failed validation — for example, a negative page size, a malformed email, or a required field left empty.

4.

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.

Cuándo usar cada uno

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.

Saber más