LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

gRPC import "google/protobuf..." types fails

Solved!
Go to solution

When running gRPC template creation utility, the error is generated when encountering 

import "google/protobuf/empty.proto";

and similar (e.g. "google/protobuf..." ) imports:

 

Error 5015 occurred at gRPC Template Creation Utility-release.lvlib:Error 5015.vi

Possible reason(s):

Proto file import - messages ref error
google/protobuf/emtpy.proto: -1 - File not found.
AddressBook.proto: 16 - Import "google/protobuf/emtpy.proto" was not found or had errors.

 

 

Win 10, LabView 2023 Q3, gRPC library  1.0.1.1

I've just started learning gRPC, If anybody tried dealing with this issue any and all help is greatly appreciated.

 

0 Kudos
Message 1 of 6
(874 Views)

Can you share the proto file that you are using for generation? It sounds like it has imports that you don't have on your local machine (or the imports are in the wrong location). Google typically keeps its proto files on github. For example, empty.proto is here.

0 Kudos
Message 2 of 6
(852 Views)

That is probably true and it might be a limitation of the code generator as other tools know how to resolve it. For example, BloomRPC doesn't have any problems loading the AddressBook.proto.

I've created external file 'person.proto' just to make sure LabView can find it from 'AddressBook.proto' and indeed it can. When I add the line: import 'google.protobuf...' it throws an error. Customer gave me a huge .proto file, referencing 20 other proto files each containing several 'imports' of the google types.

Download All
0 Kudos
Message 3 of 6
(840 Views)

For measurementlink-labview, we keep the google proto files next to the NI proto files that require them. This allows grpc-labview to find them and import them. https://github.com/ni/measurementlink-labview/tree/main/Source/Protos/google/protobuf

0 Kudos
Message 4 of 6
(823 Views)

Are you downloading them to the local hard drive?

0 Kudos
Message 5 of 6
(820 Views)
Solution
Accepted by topic author alemberskiy

When you clone the repo, all of the proto files get synced to the local machine. They don't get synced from google's github repo, though. We keep a copy of the google proto files in our repo.

Message 6 of 6
(816 Views)