gRPC status 3: INVALID_ARGUMENT

INVALID_ARGUMENT is gRPC status code 3. The request is invalid regardless of the server's state: a bad field value, a malformed name, a missing required field.

Updated

Usual causes

  • Server-side validation rejected a field: an empty ID, a malformed email, a value outside its allowed set.
  • The request JSON used a wrong field name or type, and the client or a gateway could not convert it.
  • An enum was sent as an unknown name, or a 64-bit number was out of range.

What to check

  1. The status message and any BadRequest detail in the trailers, which name the offending field.
  2. Field names: in JSON they are lowerCamelCase (user_id becomes userId), though parsers also accept the original name.
  3. The service's .proto for which fields are required by convention, since proto3 marks none.

Not to be confused with

FAILED_PRECONDITION is a valid request the system is not in a state to accept; OUT_OF_RANGE is a valid request past the end of something.

What it looks like

A typical error, as a Go client prints it: rpc error: code = InvalidArgument desc = email: must be a valid address

Retry, and the HTTP equivalent

INVALID_ARGUMENT
Code3
NameINVALID_ARGUMENT
In istek's status barinvalid_argument
RetryNo. The same request will fail the same way; fix it first.
HTTP status400

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