I am trying to use Postman on my GRPC service as described here: https://learn.microsoft.com/en-us/aspnet/core/grpc/test-tools?view=aspnetcore-6.0
Unfortunately, I am getting the error below:
Could not load server reflection.
Details: unknown error
In Console I can see a bunch of info messages, no errors:
info: Microsoft.AspNetCore.Hosting.Diagnostics2 Request finished HTTP/2 POST http://localhost:5001/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo application/grpc - - 200 - application/grpc 57.0449ms
info: Microsoft.AspNetCore.Hosting.Diagnostics2 Request finished HTTP/2 POST http://localhost:5001/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo application/grpc - - 200 - application/grpc 158.2632ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware1
Executed endpoint 'gRPC - /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo'
Not sure what can be done to investigate and fix.
If I import the proto files to Postman, I can execute an endpoint and it works OK.
Some details:
Any help appreciated!
I have used https://github.com/fullstorydev/grpcurl instead of Postman to connect to the service. It immediately gave me meaningful error:
Failed to resolve symbol "My.Service":
Symbol not found: My.Service
caused by: File not found: google/protobuf/Empty.proto
It was a bit puzzling, especially that the service works OK.
However, it turns out that my import definitions had an incorrect casing (see https://github.com/fullstorydev/grpcurl/issues/203).
I had "google/protobuf/Empty.proto";
instead of import "google/protobuf/empty.proto";
.
After correcting it works fine both in Postman and Grpcurl.
For the record - it's not that Grpcurl has better error handling than Postman.
It depends - for example, when an incorrect protocol is used (HTTP 1 instead of HTTP 2), Grpcurl just says Failed to dial target host "localhost:5001": context deadline exceeded
whereas Postman's error is more meaningful: INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: Protocol error