Failed to process proto source files
sqqqrly opened this issue · comments
When I run this, I get an error:
# ls /root/csi.proto
/root/csi.proto
# pwd
/root
# grpcurl -plaintext -unix=true -proto /root/csi.proto /var/run/csi/csi.sock describe
Failed to process proto source files.: must specify at least one import path if any absolute file paths are given
However, this works. csi.proto is in my CWD:
# pwd
/root
# grpcurl -plaintext -unix=true -proto csi.proto /var/run/csi/csi.sock list
csi.v1.Controller
csi.v1.Identity
csi.v1.Node
Apologies if the error is unclear. Since you used an absolute path (/root/csi.proto
), you must add an import path to the command line. File paths are not allowed to be absolute in Protobuf; they must instead be relative to some import path. When you specify a relative path (like the second example), the current directory is the assumed import path. But when you specify an absolute path, you must also tell it the import path, so it can compute the relative path for the file to compile. So adding -import_path /root
to the first example would make it happy.