grpc_cli does not work if the proto file contains imports

Created on 10 Sep 2019  路  3Comments  路  Source: grpc/grpc

What version of gRPC and what language are you using?

1.22.2

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

Linux

What runtime / compiler are you using (e.g. python version or version of gcc)

grpc_cli on client

What did you do?

make a grpc_cli call to a user.proto with imports (https://github.com/restorecommerce/protos/blob/master/io/restorecommerce/user.proto)

./grpc_cli type localhost:50051 io.restorecommerce.user.LoginRequest

getting below error:

[libprotobuf ERROR google/protobuf/descriptor.cc:3561] Invalid proto descriptor for file "":
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/resource_base.proto: Import "io/restorecommerce/resource_base.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   google/protobuf/empty.proto: Import "google/protobuf/empty.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/meta.proto: Import "io/restorecommerce/meta.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/address.proto: Import "io/restorecommerce/address.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/contact_point.proto: Import "io/restorecommerce/contact_point.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/image.proto: Import "io/restorecommerce/image.proto" was not found or had errors.
Type io.restorecommerce.user.LoginRequest not found.

I did try even with proto_path and protofiles and does not seem to work - still get same error as above:

./grpc_cli type --proto_path=$PROTO_ROOT --protofiles=io/restorecommerce/user.proto localhost:50051 io.restorecommerce.user.LoginRequest

What did you expect to see?

grpc_cli should resolve the returned proto containing import statements and display the requested Type.

What did you see instead?

[libprotobuf ERROR google/protobuf/descriptor.cc:3561] Invalid proto descriptor for file "":
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/resource_base.proto: Import "io/restorecommerce/resource_base.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   google/protobuf/empty.proto: Import "google/protobuf/empty.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/meta.proto: Import "io/restorecommerce/meta.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/address.proto: Import "io/restorecommerce/address.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/contact_point.proto: Import "io/restorecommerce/contact_point.proto" was not found or had errors.
[libprotobuf ERROR google/protobuf/descriptor.cc:3564]   io/restorecommerce/image.proto: Import "io/restorecommerce/image.proto" was not found or had errors.
Type io.restorecommerce.user.LoginRequest not found.
dispositiostale kinbug lanother prioritP2

Most helpful comment

any updates on this ?

All 3 comments

any updates on this ?

Unfortunately, I haven't been able to spend time on this. There are other higher priority things on my plate right now :(

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 180 days. It will be closed automatically if no further update occurs in 1 day. Thank you for your contributions!

Was this page helpful?
0 / 5 - 0 ratings