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

grpc-dump prints warning if nested message is null (not set) #87

Open
shinderuk opened this issue Mar 31, 2020 · 0 comments
Open

grpc-dump prints warning if nested message is null (not set) #87

shinderuk opened this issue Mar 31, 2020 · 0 comments
Assignees

Comments

@shinderuk
Copy link

Like this:

WARN[0004] Failed to search for unknown fields in message =proto_decoder error="failed to enrich decode descriptor: failed to search nested field foo: internal: got nil message"

Steps to reproduce:

  1. Start greeter_server
$ ~/go/bin/greeter_server
...
  1. Download helloworld.proto to proto/helloworld/helloworld.proto
  2. Edit helloworld.proto and add a nested message to HelloRequest:
message HelloRequest {
  string name = 1;
  Foo foo = 2;
}

message Foo {
    string bar = 1;
}
  1. Start grpc-dump:
$ ~/go/bin/grpc-dump -port 8980 -destination localhost:50051 -proto_roots proto
...
  1. Call SayHello with grpc_cli and omit foo:
$ grpc_cli -remotedb=false -proto_path proto -protofiles helloworld/helloworld.proto \
    call localhost:8980 helloworld.Greeter/SayHello 'name:"world"'
...
  1. grpc-dump prints a warning:
WARN[0004] Failed to search for unknown fields in message  =proto_decoder error="failed to enrich decode descriptor: failed to search nested field foo: internal: got nil message"
{"service":"helloworld.Greeter","method":"SayHello","messages":[{"message_origin":"client","raw_message":"CgV3b3JsZA==","message":{"name":"world"},"timestamp":"2020-03-31T22:37:14.401284+03:00"},{"message_origin":"server","raw_message":"CgtIZWxsbyB3b3JsZA==","message":{"message":"Hello world"},"timestamp":"2020-03-31T22:37:14.402273+03:00"}],"metadata":{":authority":["localhost:8980"],"accept-encoding":["identity,gzip"],"content-type":["application/grpc"],"grpc-accept-encoding":["identity,deflate,gzip"],"user-agent":["grpc-c++/1.19.1 grpc-c/7.0.0 (osx; chttp2; gold)"],"via":["HTTP/2.0 127.0.0.1:8980"]},"metadata_response_headers":{"content-type":["application/grpc"]},"metadata_response_trailers":{}}
  1. Now pass an empty foo:
$ grpc_cli -remotedb=false -proto_path proto -protofiles helloworld/helloworld.proto \
    call localhost:8980 helloworld.Greeter/SayHello 'name:"world" foo{}'
  1. No warning:
{"service":"helloworld.Greeter","method":"SayHello","messages":[{"message_origin":"client","raw_message":"CgV3b3JsZBIA","message":{"name":"world","foo":{}},"timestamp":"2020-03-31T22:38:07.585913+03:00"},{"message_origin":"server","raw_message":"CgtIZWxsbyB3b3JsZA==","message":{"message":"Hello world"},"timestamp":"2020-03-31T22:38:07.586199+03:00"}],"metadata":{":authority":["localhost:8980"],"accept-encoding":["identity,gzip"],"content-type":["application/grpc"],"grpc-accept-encoding":["identity,deflate,gzip"],"user-agent":["grpc-c++/1.19.1 grpc-c/7.0.0 (osx; chttp2; gold)"],"via":["HTTP/2.0 127.0.0.1:8980"]},"metadata_response_headers":{"content-type":["application/grpc"]},"metadata_response_trailers":{}}
  1. Repeat steps 3-8 with response.
@bradleyjkemp bradleyjkemp self-assigned this Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants