grpc-json transcoding filter not able to find service in proto descriptor

20 views
Skip to first unread message

ja...@pyrofex.net

unread,
Oct 22, 2018, 1:39:43 AM10/22/18
to envoy-users

per the instructions found here https://www.envoyproxy.io/docs/envoy/v1.7.1/configuration/http_filters/grpc_json_transcoder_filter
i used protoc to generate descriptors from a .proto file with the following command line:
   protoc --proto_path=<something useful> --include_imports --include_source_info --descriptor_set_out=fooDescriptor.pb foo.proto

here's an excerpt from foo.proto which was input to protoc above - this is the only .proto file that defines a service (as opposed to messages):

service DeployService {

  rpc DoDeploy(DeployData) returns (DeployServiceResponse) {
    option (google.api.http) = {
      put: "/deploy"
      body: "*"
    };
  }

  rpc addBlock(BlockMessage) returns (DeployServiceResponse) {
    option (google.api.http) = {
      put: "/block"
      body: "*"
    };
  }

  rpc showBlock(BlockQuery) returns (BlockQueryResponse) {
    option (google.api.http).get = "/show/block";
  }

  rpc listenForContinuationAtName(ContinuationAtNameQuery) returns (ListeningNameContinuationResponse) {
    option (google.api.http).get = "/listen/continuation";
  }

}

here's an excerpt from the config file i'm using to run envoy (envoyConfig.yaml):

            http_filters:
            - name: envoy.grpc_json_transcoder
              config:
                 proto_descriptor: fooDescriptor.pb
                 match_incoming_request_route: true
                 services:
                 - DeployService
            - name: envoy.router

it is my (perhaps flawed) understanding that, within the "config" object of an "envoy.grpc_json_transcoder", that:
- the string value of "proto_descriptor" should be the name of the descriptor file emitted by protoc
- the "services" value is an array whose elements are strings equating to a service defined in the .proto file fed to protoc ("DeployService" in my case)

however, i am receiving the following error message when running envoy:

source/server/server.cc:80] error initializing configuration 'envoyConfig.yaml': transcoding_filter: Could not find 'DeployService' in the proto descriptor

any ideas on what's going wrong here?
thanx in advance.

ja...@pyrofex.net

unread,
Oct 23, 2018, 10:00:10 PM10/23/18
to envoy-users
wanted to let everyone know that Lizan Zhou 
in the envoy config file, in the "services" key of the grpc_json_transcoder config, one needs to use the fully elaborated name of the service starting with any enclosing packages.
in my case the .proto code above was in package (for example) "foo.bar" therefore the string in the services key should be "foo.bar.DeployService".
Reply all
Reply to author
Forward
0 new messages