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

Can't see more than one service when using reflection #57

Open
howey opened this issue Apr 13, 2021 · 3 comments
Open

Can't see more than one service when using reflection #57

howey opened this issue Apr 13, 2021 · 3 comments

Comments

@howey
Copy link

howey commented Apr 13, 2021

Hi all,

I have a server with two services: Service_A and Service_B. When I use reflection I can only see Service_A. I can see both services if I manually use the .proto files. Any idea what I'm doing wrong?

Using Wombat_v0.4.0_Linux_x86_64.tar.gz

Thanks

wombat

server.cpp:

#include <grpcpp/grpcpp.h>
  
#include <string>

#include "service_a.grpc.pb.h"
#include "service_b.grpc.pb.h"

using grpc::Server;
using grpc::ServerBuilder;
using grpc::ServerContext;
using grpc::Status;

using service_a::Service_A;
using service_b::Service_B;

class ServiceAImplementation final : public Service_A::Service {};

class ServiceBImplementation final : public Service_B::Service {};

void Run() {
  std::string address{"0.0.0.0:5000"};
  ServiceAImplementation service_a;
  ServiceBImplementation service_b;

  ServerBuilder builder;

  builder.AddListeningPort(address, grpc::InsecureServerCredentials());
  builder.RegisterService(&service_a);
  builder.RegisterService(&service_b);

  std::unique_ptr<Server> server(builder.BuildAndStart());
  std::cout << "server listening on port: " << address << std::endl;

  server->Wait();
}

int main(int argc, char** argv) {
  Run();

  return 0;
}

service_b.proto:

syntax = "proto3";
  
package service_b;

service Service_B{
  rpc DoThing(ThingIn) returns (ThingOut) {}
}

message ThingIn {}
message ThingOut {}

service_a.proto:

syntax = "proto3";
  
package service_a;

service Service_A{
  rpc DoThing(ThingIn) returns (ThingOut) {}
}

message ThingIn {}
message ThingOut {}

Working with grpc-client-cli:

$ grpc-client-cli localhost:5000
? Choose a service:  [Use arrows to move, enter to select, type to filter]
→ grpc.reflection.v1alpha.ServerReflection
  service_a.Service_A
  service_b.Service_B
@rogchap
Copy link
Owner

rogchap commented Apr 22, 2021

Hmm. that is really strange as you should at least see the grpc.reflection.v1alpha.ServerReflection service too?
image

@howey
Copy link
Author

howey commented Apr 23, 2021

Nope, I don't see grpc.reflection.v1alpha.ServerReflection either.

As another test I tried out grpcui, and the issue is similar. To me it seems like there is a problem in a library that's used by Wombat

 ~/go/bin/grpcui -plaintext localhost:5000
Failed to compute set of methods to expose: Symbol not found: service_b.Service_B

@raphaelzulliger
Copy link

raphaelzulliger commented Sep 15, 2022

I seem to suffer from the same issue, using V0.5.0. grpc_cli ls shows all services, while wombat only shows one of them. I hope the following screenshot is not too much obfuscated :-)

image

Can we enable "logging" or such for wombat to get to the culprit of it?

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

3 participants