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

M1 grpcui -plaintext localhost:8023 Failed to compute set of methods to expose: proto: invalid syntax: "<unknown:0>" #279

Open
ioext opened this issue Nov 1, 2023 · 5 comments

Comments

@ioext
Copy link

ioext commented Nov 1, 2023

M1 grpcui -plaintext localhost:8023 Failed to compute set of methods to expose: proto: invalid syntax: "unknown:0"

@cmgsj
Copy link

cmgsj commented Nov 16, 2023

I am having the same issue, and also with grpcurl

@antonprokopovich
Copy link

Are there any updates on this? I'm facing the same issue when trying to connect with -plaintext option. I'm able to connect when I replace it with -insecure option but then some of the requests to server fail

@antonprokopovich
Copy link

antonprokopovich commented Dec 26, 2023

I was able to resolve it by omitting the -plaintext option and passing the -cacert option followed by path to the CA certificate file

@venkad-intc
Copy link

I am facing the same issue. It works fine with grpcurl but not with grpcui. Any update?

@jhump
Copy link
Contributor

jhump commented Jan 5, 2024

@ioext, @cmgsj, @antonprokopovich, @venkad-intc, the real root cause is an issue in your protos. The protobuf-go runtime cannot find the descriptor for a dependency, so it creates a placeholder file descriptor. The grpc-go reflection implementation then sends that placeholder file descriptor as part of a reflection response. The placeholder descriptor has this invalid syntax string, which causes the error.

If things worked fine with an earlier version of grpcurl or grpcui, it is because the missing dependency likely is just for custom options. The older versions of grpcurl and grpcui didn't use the protobuf-go's reflection capability, but instead an alternate implementation in github.com/jhump/protoreflect. This alternate implementation didn't validate the syntax string, so would have used the invalid (and empty) placeholder descriptor. The only way this can work and grpcurl/grpcui still be able to resolve the RPC schema is if the only thing in the dependency were custom options (which grpcurl/grpcui would see as unrecognized fields and ignore).

You can find more details in this grpc-go issue: grpc/grpc-go#6770.

While there are some fixes to the grpc-go and protobuf-go runtime, they would simply change the error message to something less confusing. The root issue is still that a file descriptor for a dependency cannot be resolved.

Most likely, the issue is that your sources are importing some vendored source of custom options (like from grpc-gateway, googleapis, protoc-gen-validate, protovalidate, etc) but using the "wrong" import path. The import statement must refer to the file using the same relative path that was used to compile that file in order for the descriptors to be properly discovered and linked. See this article for more details.

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

5 participants