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

protoc-gen-grpc-gateway fails silently after release 1.10 #1013

Closed
rmilejcz opened this issue Aug 28, 2019 · 4 comments
Closed

protoc-gen-grpc-gateway fails silently after release 1.10 #1013

rmilejcz opened this issue Aug 28, 2019 · 4 comments
Labels

Comments

@rmilejcz
Copy link

rmilejcz commented Aug 28, 2019

Bug reports:

protoc-gen-grpc-gateway doesn't build stubs after updating to release 1.10

Steps you follow to reproduce the error:

  1. Install plugins:
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/golang/protobuf/protoc-gen-go
  1. Make a suitable service file (copy paste this into terminal):
touch service.proto
cat <<EOF >>service.proto
syntax = "proto3";
package example;

import "google/api/annotations.proto";

message StringMessage {
  string value = 1;
}

service YourService {
  rpc Echo(StringMessage) returns (StringMessage) {
    option (google.api.http) = {
      post: "/v1/example/echo",
      body: "*"
    };
  }
}
EOF
  1. In the same folder, try generating GW stubs by running:
protoc -I/usr/local/include -I. \
  -I$GOPATH/src \
  -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
  --grpc-gateway_out=logtostderr=true:. \
  service.proto
  1. Observe that service.pb.gw.go does not exist as expected.

What did you expect to happen instead:

service.pb.gw.go should be output in the same folder as service.proto

What's your theory on why it isn't working:

Hard to say since there is no output and I'm unfamiliar with how these tools work under the hood

@johanbrandhorst
Copy link
Collaborator

Let me investigate this...

@johanbrandhorst
Copy link
Collaborator

johanbrandhorst commented Aug 28, 2019

Can't reproduce in my repo johanbrandhorst/grpc-gateway-boilerplate@7ea73ef. What version were you updating from?

@rmilejcz
Copy link
Author

rmilejcz commented Aug 28, 2019

I believe it was 1.9.4. I went ahead and did a clean build in a docker environment and this bug did not occur so it must be some issue in my local environment. Unfortunately we aren't using go modules so I can't say whether or not downgrading would fix the issue. Thanks as usual for the prompt and helpful response, sorry for the (apparent) false alarm.

EDIT:

In case anyone else encounters this, I was able to resolve it by building protoc-gen-grpc-gateway from source instead of go getting it. If you already have it installed simply:

cd $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway
go build -o $GOBIN/protoc-gen-grpc-gateway

@johanbrandhorst
Copy link
Collaborator

We also have pre-built binaries for most platforms for every release.

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

No branches or pull requests

2 participants