gRPC 5 NOT_FOUND vs 13 INTERNAL
Both gRPC 5 (NOT_FOUND) and 13 (INTERNAL) belong to the gRPC Status Codes category. 5 indicates that some requested entity was not found. For example, a file or directory that the RPC was supposed to operate on does not exist. Meanwhile, 13 means that an internal error occurred. This means that some invariant expected by the underlying system has been broken.
Descrição
Some requested entity was not found. For example, a file or directory that the RPC was supposed to operate on does not exist.
Quando você o vê
The resource referenced in the request doesn't exist — such as looking up a user by ID that has been deleted or never created.
Como corrigir
Verify the resource identifier is correct. Ensure the resource was created before accessing it, or handle the not-found case gracefully in your client.
Descrição
An internal error occurred. This means that some invariant expected by the underlying system has been broken.
Quando você o vê
A server-side bug, a corrupted internal state, or an unexpected failure in a dependency. This is the gRPC equivalent of HTTP 500.
Como corrigir
Check the server error logs and traces for the root cause. This typically indicates a bug that needs to be fixed in the server code.
Diferenças principais
gRPC 5: Some requested entity was not found. For example, a file or directory that the RPC was supposed to operate on does not exist.
gRPC 13: An internal error occurred. This means that some invariant expected by the underlying system has been broken.
You encounter 5 when the resource referenced in the request doesn't exist — such as looking up a user by ID that has been deleted or never created.
You encounter 13 when a server-side bug, a corrupted internal state, or an unexpected failure in a dependency. This is the gRPC equivalent of HTTP 500.
Quando usar qual
For 5 (NOT_FOUND): Verify the resource identifier is correct. Ensure the resource was created before accessing it, or handle the not-found case gracefully in your client. For 13 (INTERNAL): Check the server error logs and traces for the root cause. This typically indicates a bug that needs to be fixed in the server code.