grpc / grpc-go

The Go language implementation of gRPC. HTTP/2 based RPC
https://grpc.io
Apache License 2.0
21.15k stars 4.4k forks source link

Service reflection can not handle directory paths with imported proto files #7146

Closed nkoson closed 6 months ago

nkoson commented 7 months ago

What version of gRPC are you using?

1.63.2

What version of Go are you using (go version)?

1.21.0

What operating system (Linux, Windows, …) and version?

macOS 13.2

What did you do?

My proto file api/proto/services/foo/v1/foo.proto

imports a file from another directory: import "api/proto/v1/bar.proto";

and I instruct protoc with -I ./

start the gRPC server and describe its services with grpcurl:

grpcurl -plaintext -use-reflection localhost:8888 describe

File not found: api/proto/v1/bar.proto

(for the record, the issue persists in Postman as well)

However, if I change the import in api/proto/services/foo/v1/foo.proto to import "bar.proto";

and instruct protoc with -I ./api/proto/v1

then service reflection works fine.

What did you expect to see?

Service reflection should be able to traverse directories.

What did you see instead?

Service reflection only working when the import statement does not describe a directory path.

arvindbr8 commented 6 months ago

Hi @nkoson -- sorry for the delayed response. But I would like to get more clarity here

My proto file api/proto/services/foo/v1/foo.proto imports a file from another directory: import "api/proto/v1/bar.proto";

I would like to understand the directory structure here more clearly. Could you maybe provide us with an example on how to reproduce this?

github-actions[bot] commented 6 months ago

This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.