Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem compiling proto files when importing from package google.protobuf #149

Open
mdebellefeuille opened this issue Jan 21, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mdebellefeuille
Copy link

Hello

Description
The bug I encounter happens when deploying the image shubhendumadhukar/camouflage:latest on kubernetes. The proto compiler seems to not be able to find the files in the appropriate folder. Giving a compilation error message, it seems to be looking into google.api package when it is in the google.protobuf package.

Basically, the file google/api/annotations.proto has an import of google/protobuf/descriptor.proto (line 20) and declares an extend of google.protobuf.MethodOptions which is declared inside the file google/protobuf/descriptor.proto (line 467).

If I temper with the files and changes all the imports to ./filename and put them all inside home/grpc/protos/ there is no more error message.

What is weird is that on my workstation I installed it from npm and it is working fine. (on Windows)

I saw on another project somebody having a similar issue with the proto compiler, not sure if it applies

To Reproduce
Steps to reproduce the behavior:

  1. Fresh installation of the image on Kuberneter
  2. Activate http and grpc protocols
  3. create these folders , home/grpc/protos/api and home/grpc/protos/protobuf
  4. copy from Google's repository the files annotations.proto and http.proto into the api folder
  5. copy from Google's repository the file descriptor.proto into the protobuf folder
  6. restart the server
  7. stack trace: Error: unresolvable extensions: 'extend google.protobuf.MethodOptions' in .google.api at Root.resolveAll (/usr/local/lib/node_modules/camouflage-server/node_modules/protobufjs/src/root.js:255:15) at Object.loadProtosWithOptionsSync (/usr/local/lib/node_modules/camouflage-server/node_modules/@grpc/proto-loader/build/src/util.js:67:16) at Object.loadSync (/usr/local/lib/node_modules/camouflage-server/node_modules/@grpc/proto-loader/build/src/index.js:194:31) at /usr/local/lib/node_modules/camouflage-server/dist/protocols/GRPC.js:74:48 at Array.forEach (<anonymous>) at GrpcSetup.initGrpc (/usr/local/lib/node_modules/camouflage-server/dist/protocols/GRPC.js:73:33) at Protocols.initGrpc (/usr/local/lib/node_modules/camouflage-server/dist/protocols/index.js:41:28) at Object.start (/usr/local/lib/node_modules/camouflage-server/dist/index.js:165:19) at Object.<anonymous> (/usr/local/lib/node_modules/camouflage-server/bin/camouflage.js:306:14) at Module._compile (node:internal/modules/cjs/loader:1097:14)

Expected behavior
Expecting the proto file to be compiled properly

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Kubernetes GKE on Google Cloud Platform
  • Chrome
  • Version docker image from shubhendumadhukar/camouflage:latest

Additional context
log file attached
camouflage.log

@mdebellefeuille mdebellefeuille added the bug Something isn't working label Jan 21, 2022
@AlessandroBagnoli
Copy link

Hello @shubhendumadhukar , any ETA on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants