when i generare i got this message : --grpc-gateway_out: echoserver/echoserver.proto: unsupported options: logtostderr
thank you
Can you share the exact code that is executing? The protocol invocation?
I think you need a = in there:
--grpc-gateway_out=: echoserver/echoserver.proto
@johanbrandhorst its not work. just getting this
--grpc-gateway_out: echoserver/echoserver.proto: options: mode is required
@tmc this ??
syntax = "proto3";
package echoserver;import "google/api/annotations.proto";
message EchoRequest {
string message = 1;
}message EchoResponse {
string message = 1;
}message Heartbeat {
enum Status {
UNKNOWN = 0;
OK = 1;
}
Status status = 1;
}message Empty {}
service EchoService {
rpc Echo(stream EchoRequest) returns (stream EchoResponse) {
option (google.api.http) = {post: "/echo", body: "*"};
}
rpc Stream(Empty) returns (stream EchoResponse) {
option (google.api.http) = {get: "/echo"};
}
rpc Heartbeats(stream Empty) returns (stream Heartbeat) {
option (google.api.http) = {post: "/heartbeats"};
}
}
We need the full protoc command to see where the problem is. Your last example still doesn't have the = in it. Can you post your full protoc command?
@johanbrandhorst @tmc
protoc -I /usr/local/include -I. -I $GOPATH/src -I $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --plugin=protoc-gen-grpc-gateway=$GOPATH/bin/protoc-gen-grpc-web --grpc-gateway_out=logtostderr=true:. echoserver/echoserver.proto
Thanks, there's clearly been a misunderstanding here since you're using $GOPATH/bin/protoc-gen-grpc-web. I don't know where you got this from, but it's not used with the grpc-gateway. What happens if you run:
$ 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:. echoserver/echoserver.proto
@johanbrandhorst i got this message :
protoc-gen-grpc-gateway: program not found or is not executable
--grpc-gateway_out: protoc-gen-grpc-gateway: Plugin failed with status code 1.
this command protoc -I /usr/local/include -I. -I $GOPATH/src -I $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --plugin=protoc-gen-grpc-gateway=$GOPATH/bin/protoc-gen-grpc-web --grpc-gateway_out=logtostderr=true:. echoserver/echoserver.proto i got from this #205 but when i running this command i got this
--grpc-gateway_out: echoserver/echoserver.proto: unsupported options: logtostderr
You're getting that error because you're not running protoc-gen-grpc-gateway. Run
$ go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
And then run the command I told you to run again.
Where did you get protoc-gen-grpc-web from? It has nothing to do with this repository I'm afraid. That is the whole source of your trouble. I'm closing this as it seems to be unrelated to the gateway, but please tell me if you want me to reopen it again.
@johanbrandhorst i got same message
protoc-gen-grpc-gateway: program not found or is not executable
--grpc-gateway_out: protoc-gen-grpc-gateway: Plugin failed with status code 1.
If you're getting that message even after installing protoc-gen-grpc-gateway with go get, you may need to just add $GOBIN to your path. This is definitely within the realms of an environmental problem though, and I don't think this is the best place to help you debug it. Maybe join Gophers Slack and ask for help on there?
@johanbrandhorst okey thank you for your help :+1:
Thanks its just save my day. @johanbrandhorst
Most helpful comment
You're getting that error because you're not running
protoc-gen-grpc-gateway. RunAnd then run the command I told you to run again.