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

Google proto import issues #5

Open
avyasbms opened this issue Dec 11, 2018 · 9 comments
Open

Google proto import issues #5

avyasbms opened this issue Dec 11, 2018 · 9 comments

Comments

@avyasbms
Copy link
Contributor

Hello @thinkerou

I have a proto file which imports Google proto, These were added so that it Grpc can also be hosted as REST endpoints. Though highly unnecessary, it remains in our proto file.

So I cannot use these proto files directly, Can you see if we can have this generate code for karate-grpc automation.

syntax = "proto3";

package myproto;

import "google/api/annotations.proto";


service myservice {
    rpc AnewServiee (MyRequest) returns (MyResponse) {
        option (google.api.http) = {
      post: "/mygrpcrest/AnewServiee"
      body: "*"
    };
    }
}


    message MyRequest {
        string id = 1;
    }

    message MyResponse {
        string id = 1;
        string title = 2;
        string parentId = 3;
    }
$mvn compile
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.14
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 14
[INFO] os.detected.classifier: osx-x86_64
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building api-bdd 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- protobuf-maven-plugin:0.5.1:compile (default) @ api-bdd ---
[INFO] Will write descriptor set:
[INFO]  /karate-grpc/target/generated-resources/protobuf/descriptor-sets/karate-grpc.protobin
[INFO] Compiling 9 proto file(s) to /karate-grpc/target/generated-sources/protobuf/java
[ERROR] PROTOC FAILED: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/Experiment.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/category.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/filter.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/product.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/tax.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/item.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/project/protos/user.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/examples/helloworld.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[ERROR] /karate-grpc/src/test/java/projects/examples/user.proto [0:0]: google/api/annotations.proto: File not found.
project/protos/Experiment.proto: Import "google/api/annotations.proto" was not found or had errors.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.422 s
[INFO] Finished at: 2018-12-11T18:13:48+05:30
[INFO] Final Memory: 11M/155M
[INFO] ------------------------------------------------------------------------
@avyasbms
Copy link
Contributor Author

avyasbms commented Apr 1, 2019

Hello @thinkerou Can you please point me to right direction on how to use proto files with imports

e.g. import "google/api/annotations.proto";

@B4bharat
Copy link

B4bharat commented Nov 4, 2019

Hi @thinkerou I am facing the same issue, would be very helpful if you can help solve it.

@thinkerou
Copy link
Member

hi, everyone, sorry for replying so late, I will the next two week solve these issue, thanks!

@sabya-web
Copy link

Hi,
I am also getting below error when we have "google/protobuf/any.proto" as import statement in the proto file.
javascript evaluation failed: client.call('getformula.Formula/GetRqFormula',payload), Can't find dependency: google/protobuf/any.proto
We urgently need some inputs to move forward. Request to kindly help at the earliest.

@s3naid
Copy link

s3naid commented Jan 11, 2021

Anyone managed to solve this?

@dev-rgupta
Copy link

hi,
Does anyone find the solution for the above error because I'm also getting the same error in the same scenario like I have a proto file that imports Google proto?

@thinkerou any idea

@s3naid
Copy link

s3naid commented Jan 19, 2022

If I remember right just place folder 'google' with all those google protofiles inside your proto files

@dev-rgupta
Copy link

thanks, @s3naid for the comment, and yeah you are right

@lucarota
Copy link

lucarota commented Oct 3, 2022

Hi,
setting includeDependenciesInDescriptorSet to true in the protobuf-maven-plugin configuration solved the problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants