Questions tagged [protoc]

protoc is the compiler for .proto files. It generates language bindings for the messages and/or RPC services from .proto files. protoc is a native executable, the scripts under this directory build and publish a protoc executable (a.k.a. artifact) to Maven repositories. The artifact can be used by build automation tools so that users would not need to compile and install protoc for their systems.

taken from google documentation

387 questions
83
votes
19 answers

Error "protoc-gen-go: program not found or is not executable"

I am trying to build a sample application with Go gRPC, but I am unable to generate the code using "protoc" I have installed the required libraries and Go packages using: go get -u google.golang.org/grpc go get -u…
Mayank Gupta
  • 1,779
  • 1
  • 13
  • 19
46
votes
2 answers

protoc not generating service stub files

I have just started playing with google proto. When I try to compile proto file present in proto-java example, it does not generate any grpc file. proto…
Raman Sonkhla
  • 461
  • 1
  • 4
  • 3
43
votes
14 answers

protoc-gen-go-grpc: program not found or is not executable

go version: go version go1.14 linux/amd64 go.mod module [redacted] go 1.14 require ( github.com/golang/protobuf v1.4.0-rc.2 google.golang.org/grpc v1.27.1 google.golang.org/protobuf v1.20.0 // indirect ) I am running the following…
Ayush Gupta
  • 8,716
  • 8
  • 59
  • 92
42
votes
11 answers

Correct format of protoc go_package?

I have an existing project in Go where I'm using Protocol buffers / gRPC. Until recent the go_package option was optional and the resulting Go package name would be the same as the proto package name. This file lives in the project root. The…
Tim
  • 1,585
  • 1
  • 18
  • 23
34
votes
4 answers

Is "google/protobuf/struct.proto" the best way to send dynamic JSON over GRPC?

I have a written a simple GRPC server and a client to call the server (both in Go). Please tell me if using golang/protobuf/struct is the best way to send a dynamic JSON with GRPC. In the example below, earlier I was creating Details as a…
Anuj Gupta
  • 341
  • 1
  • 3
  • 6
22
votes
1 answer

Protocol Buffer Error on compile during GOOGLE_PROTOBUF_MIN_PROTOC_VERSION check

I'm currently getting an error which points me to these lines in the header file produced by protoc: #if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your…
the_qbf
  • 358
  • 1
  • 2
  • 12
21
votes
5 answers

protoc-gen-js: program not found or is not executable

Trying to compile my protos - I need to compile them to use in my react app. But I get this error. I run the command as follows: cd src/main/proto && protoc -I=. *.proto --js_out=import_style=commonjs:.…
Asma Rahim Ali Jafri
  • 1,173
  • 2
  • 15
  • 22
21
votes
2 answers

How to use a forked module, with versioned Go Modules (v1.11+, GO111MODULE=on)

I forked a go module, and want to use the fork in my project that uses versioned modules via v1.12. My code is not inside my GOPATH. My project's go.mod: module github.com/me/myproj go 1.12 require ( …
rynop
  • 50,086
  • 26
  • 101
  • 112
21
votes
3 answers

Create variable of type Map[string]interface{} in gRPC protoc buffer golang

I'm using grpc golang to communicate between client and server application. Below is the code for protoc buffer. syntax = "proto3"; package Trail; service TrailFunc { rpc HelloWorld (Request) returns (Reply) {} } // The request message…
Radhika.S
  • 355
  • 1
  • 2
  • 8
20
votes
3 answers

Why is my Protobuf message (in Python) ignoring zero values?

I've been working on implementing protobufs for IPC for a project. For some reason, values that are set to 0 are not being set/serialized. For context, the .proto file contains the following message: syntax = "proto3"; enum SetGet { SET = 0; …
Timothy Kanarsky
  • 419
  • 1
  • 3
  • 5
19
votes
4 answers

How to import gRPC empty and Google api annotations proto

I am trying to use Google Cloud Endpoints to make a gRPC based api that can transcode incoming REST requests. I am following their example code but I can not any documentation on how to properly import and compile with the annotation.proto or the…
18
votes
16 answers

protoc object_detection/protos/*.proto: No such file or directory

I am following the example found here. But whenever I enter the command "C:/Program Files/protoc/bin/protoc" object_detection/protos/.proto --python_out=. I get an error that says object_detection/protos/.proto: No such file or directory. I can't…
twofair
  • 181
  • 1
  • 1
  • 4
16
votes
5 answers

protoc-gen-go: unable to determine Go import path for "simple.proto"

I have simple proto file with following content. syntax="proto3"; package main; message Person { string name = 1; int32 age = 2; } I am trying to generate go code for it using protoc. I run: protoc --go_out=. simple.proto I receive…
srbemr
  • 318
  • 1
  • 2
  • 8
14
votes
1 answer

Protobuf dart generation on Mac OS doesn't find protoc-gen-dart

I've installed protoc with homebrew and try to generate dart code with proto files. When I tried a simple case like protoc --dart_out=. test.proto it give me: protoc-gen-dart: program not found or is not executable --dart_out: protoc-gen-dart:…
jaumard
  • 8,202
  • 3
  • 40
  • 63
14
votes
1 answer

how to create a protobuf go plugin plugin

https://github.com/golang/protobuf protoc-gen-go is a plugin in protoc which generates go bindings for the input proto definition. protoc-gen-go also has a plugin framework for which grpc is a plugin…
weima
  • 4,653
  • 6
  • 34
  • 55
1
2 3
25 26