Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving API Core gRPC error reporting #150

Open
crwilcox opened this issue Mar 11, 2021 · 2 comments
Open

Improving API Core gRPC error reporting #150

crwilcox opened this issue Mar 11, 2021 · 2 comments
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@crwilcox
Copy link
Contributor

crwilcox commented Mar 11, 2021

While looking into googleapis/python-firestore#4 it seems gRPC reports child error details. While this is helpful, it can be a bit misleading to a user, as it will pair things like 503 (unavailable) with the text 'deadline exceeded' (error code 504) which seems strange.

I reached out to @lidizheng to discuss this and they brought up using debug_error_string: https://github.com/grpc/grpc/blob/d3e97d953b9a94d017d76a44b780bb5ca48e5840/src/python/grpcio/grpc/_channel.py#L80

We could potentially add rpc_exc.debug_error_string() to the exceptions formed at from_grpc_error:

rpc_exc.code(), rpc_exc.details(), errors=(rpc_exc,), response=rpc_exc

Note: this could be verbose. An example raised:

{"created":"@1615494939.757345505","description":"xds call failed","file":"src/core/ext/xds/xds_client.cc","file_line":1260}
E0311 20:35:39.757768839  443158 xds_cluster_resolver.cc:742] [xds_cluster_resolver_lb 0x7ffb5c005550] discovery mechanism 0 xds watcher reported error: {"created":"@1615494939.757345505","description":"xds call failed","file":"src/core/ext/xds/xds_client.cc","file_line":1260}

Though in the case of the bug raised the error would look more like "receiving error from server, which is "Deadline Exceeded"."

@lidizheng
Copy link
Contributor

<_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "Deadline Exceeded"
	debug_error_string = "{"created":"@1615495482.926352000","description":"Error received from peer ipv6:[::1]:50051","file":"src/core/lib/surface/call.cc","file_line":1063,"grpc_message":"Deadline Exceeded","grpc_status":14}"
>

I use the helloworld example to generate an UNAVAILABLE error with message "Deadline Exceeded", above is what the debug error string looks like. So, it doesn't use the word "server", but uses the term "peer".

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Mar 12, 2021
@busunkim96 busunkim96 added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Mar 12, 2021
@busunkim96
Copy link
Contributor

This work seems like it would pair nicely with #99 (parsing error details from the trailing metadata)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants