protobuf-net / protobuf-net.Grpc

GRPC bindings for protobuf-net and grpc-dotnet
Other
846 stars 106 forks source link

Grpc reflection error "Code: Unimplemented, Message: Service is unimplemented" #280

Open abakumov-v opened 1 year ago

abakumov-v commented 1 year ago

Good afternoon,

I have this git repo - https://github.com/abakumov-v/test-grpc-reflection - with the master-reflection branch, where I have enabled grpc reflection with these nuget packages:

When I launch the TestGrpcReflection project (which is the grpc server) and I try to send grpc request via Postman or grpcurl, I always get an error:

But if I send a grpc request from the self-written console app, I don't get any error messages, and my request finishes successfully: image

Could you tell me, please, why I always get an error "Unimplemented" for my grpc-service over http (without https)?

P.S. I have tried to research the same behaviour with the protobuf-net's examples (https://github.com/protobuf-net/protobuf-net.Grpc/tree/main/examples/pb-net-grpc/Server_CS), but it works fine (and I don't know why): grpc-reflection-05 grpc-reflection-01

mgravell commented 1 year ago

Can you try changing the service attribute to:

[ServiceContract(Name = ".TestService")]

? I suspect it is applying a namespace (and uri prefix) that you don't want. The leading . here indicates that it is relative to the root, i.e. that the full name is .TestService; I think without that, it is using .TestGrpc.Contract.TestService as the fully qualified name.

abakumov-v commented 1 year ago

@mgravell I have changed name to add leading . - but it wasn't help: image

Also the generated by grpc reflection service name was changed just to TestService, without any full namespace.

saravanakumarvelayutham commented 1 year ago

the name change helped in my case, thanks

abakumov-v commented 1 year ago

@saravanakumarvelayutham hi, what exactly did you change?

saravanakumarvelayutham commented 1 year ago

Hi @abakumov-v , I validated two things, one on the local is the "applicationUrl" in launch settings without https , and listen on local port for the gRPC listener.

my case was I had interface shared which is exactly same for POC, when reslving for example service2 from service1 using the interface from service1 .. the resolution for grpc tried to resolve using namespace in service1 and started throwing unimplemented, so I gave a servicename to overcome it.