fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include more output while connecting and reflecting with verbose mode

dimo414 opened this issue · comments

Trying to use grpcurl against a proxy server (therefore hitting all sorts of unusual edge cases) has been a bit of a pain for debugging because it doesn't generally provide any diagnostics, even with -v/-vv. I would have expected one or the other to include details about the connection state and reflection queries, but instead the output is generally minimal / confusing. Some examples:

  • Hit an Envoy proxy incorrectly routing /grpc.reflection.v1alpha.ServerReflection to an HTTP server

    $ grpcurl -vv -plaintext -d '{}' my_proxy:8080 my.CoolService.Endpoint
    # no output, just hangs, I suspect because the HTTP server doesn't correctly close the streaming reflection request
    ^C
    
  • Passing -max-time helps but you need to look closely to realize it's reporting that reflection is what timed out

    $ grpcurl -vv -plaintext -max-time 10 -d '{}' my_proxy:8080 my.CoolService.Endpoint
    Error invoking method "my_server my.CoolService.Endpoint": rpc error: code = DeadlineExceeded desc = failed to query for service descriptor "my_server my.CoolService": context deadline exceeded
    
  • Hit that same HTTP server directly (this is a particularly odd failure as the server is up, and curl my_server:8080 responds):

    $ grpcurl -vv -plaintext -d '{}' my_server:8080 my.CoolService.Endpoint
    Failed to dial target host "my_server:8080": context deadline exceeded
    

Obviously these are all cases were I would expect grpcurl to fail, but the output, especially with -vv, is IMO lacking. It would be great if more information could be surfaced in -v or -vv mode about the connection status and what data is being requested for reflection.