question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importer throws error when .proto dependency is not in current or sub-directory of imported .proto

See original GitHub issue

Our organization uses a central repo that contains a large number of different libraries, which includes proto definitions for all our services (hundreds). However, there are also a number of separate proto definitions that are imported to the service definitions, that are stored in a wholly separate directory structure. I created an example repo that hopefully illustrates the problem. The directory structure looks like this:

> org
  > shared
    > lib
      > grpcproto
        > uuid.proto
    > services
      > auth
        > authv2.proto

I created a sample repo to test with, which can be found here: https://github.com/molteninjabob/org.

In this example, authv2.proto imports uuid.proto from a completely separate branch in the org directory structure. I can create the importer successfully, but the import throws the following error:

microcks | protoc-jar: executing: [/tmp/protocjar8444733488152786468/bin/protoc.exe, -I/tmp/protocjar8444733488152786468/include, --include_imports, --proto_path=/tmp, --descriptor_set_out=/tmp/microcks-162613201891814477613584668397839.download.pbb, microcks-162613201891814477613584668397839.download]
microcks | org/shared/lib/grpcproto/uuid.proto: File not found.
microcks | microcks-162613201891814477613584668397839.download:6:1: Import "org/shared/lib/grpcproto/uuid.proto" was not found or had errors.

Attaching stack trace. stack.txt

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
molteninjabobcommented, Jul 14, 2021

@lbroudoux No worries and sorry it took a bit to get back. I’ll keep playing around with things. I really love what you’re doing and we want to use microcks as our main tool for mocking endpoints. You’re doing great things!

0reactions
lbroudouxcommented, Sep 19, 2021

@xymox : your help would be really appreciated on this one 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error using import in .proto file - Stack Overflow
If you're using IntelliJ IDEA, go to Preferences -> Protobuf Support and add the path to your .proto file. This would resolve the...
Read more >
Protocol Buffer Basics: Java - Google Developers
This tutorial provides a basic Java programmer's introduction to working with protocol buffers. By walking through creating a simple example application, ...
Read more >
Go Protobuf Tips - Johan Brandhorst
As long as your proto file imports are all relative to the current directory, this will work. Several include paths. If you're using...
Read more >
[protobuf] protoc - how to generate code for proto and its imports
proto, test/imported.proto. The first two are in the command line and the third is found through import statement. It then leads to the...
Read more >
Usage - Buf.build
proto files, and how to handle imports. As opposed to protoc , where all .proto files are manually specified on the command-line, buf...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found