gRPC status 9: FAILED_PRECONDITION
FAILED_PRECONDITION is gRPC status code 9. The system is not in the state the call needs, such as deleting a directory that is not empty.
Updated
Usual causes
- The entity is in the wrong state: an order already shipped, an account frozen.
- An optimistic concurrency check failed at the application level, and the server chose this code over
ABORTED.
What to check
- The current state of the entity the call acts on.
- A
PreconditionFailuredetail in the trailers, which names the violation.
Not to be confused with
Use UNAVAILABLE for a transient condition the client can wait out, ABORTED for a conflict to retry at a higher level, and FAILED_PRECONDITION for one the client must fix.
What it looks like
A typical error, as a Go client prints it: rpc error: code = FailedPrecondition desc = directory not empty
Retry, and the HTTP equivalent
| FAILED_PRECONDITION | |
|---|---|
| Code | 9 |
| Name | FAILED_PRECONDITION |
| In istek's status bar | failed_precondition |
| Retry | Not until the state has changed; retrying the same call immediately will fail again. |
| HTTP status | 400 |
istek names the status of every call it makes, failed_precondition included, and explains transport failures in plain words. See istek.