connectrpc / grpcreflect-go

gRPC-compatible server reflection for any net/http server.
https://connectrpc.com
Apache License 2.0
72 stars 7 forks source link

reflection works with grpcurl but not grpcui #75

Closed robertwenquan closed 2 months ago

robertwenquan commented 2 months ago

grpcurl list and grpcurl describe both work, but the grpcui throws error

grpcui -plaintext localhost:8080
Failed to compute set of methods to expose: server does not support the reflection API

The grpcurl works

grpcurl -plaintext localhost:8080 list
api.v1.APIService
grpcurl -plaintext localhost:8080 describe
api.v1.APIService is a service:
service APIService {
  ....omitted....
}

version info

$ grpcui --version
grpcui 1.4.1

$ grpcurl --version
grpcurl dev build <no version set>

reflection error comes up with postman as well.

image
akshayjshah commented 2 months ago

It looks like grpcui hasn't been updated to use v1 of the reflection API. Is your code also exposing v1alpha1 of the reflection API (using grpcreflect.NewHandlerV1Alpha)?

robertwenquan commented 2 months ago

Good point. @akshayjshah You are right I didn't add the grpcreflect.NewHandlerV1Alpha(reflector) line. So it looks both grpcui and postman haven't updated the reflection API in their clients.

After adding this line, both the grpcui and postman work now. Thanks a ton!

image image
jhump commented 2 months ago

FWIW, grpcui has a fix for this in https://github.com/fullstorydev/grpcui/pull/314, but it's not been included in a release yet.