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

grpc-gateway_out Cannot set flag #1751

Closed
artificial-james opened this issue Oct 14, 2020 · 2 comments · Fixed by #1752
Closed

grpc-gateway_out Cannot set flag #1751

artificial-james opened this issue Oct 14, 2020 · 2 comments · Fixed by #1752

Comments

@artificial-james
Copy link

🐛 Bug Report

This morning (after the v2 release), when I attempt to generate the grpc-gateway, I get the following error:

goroutine 1 [running]:
github.com/golang/glog.stacks(0xc000157a00, 0xc000268240, 0x3c, 0x40)
	/go/src/github.com/golang/glog/glog.go:769 +0xb9
github.com/golang/glog.(*loggingT).output(0xb0bdc0, 0xc000000003, 0xc0000c7d50, 0xadb797, 0x7, 0x72, 0x0)
	/go/src/github.com/golang/glog/glog.go:720 +0x39a
github.com/golang/glog.(*loggingT).printf(0xb0bdc0, 0x3, 0x85b045, 0x12, 0xc000325be8, 0x1, 0x1)
	/go/src/github.com/golang/glog/glog.go:655 +0x153
github.com/golang/glog.Fatalf(...)
	/go/src/github.com/golang/glog/glog.go:1148
main.parseFlags(0xc0002209c0, 0x0, 0x0)
	/go/src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/main.go:114 +0x3b1
main.main.func1(0xc0003b7540, 0x0, 0xc000272000)
	/go/src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/main.go:68 +0x79
google.golang.org/protobuf/compiler/protogen.run(0xc000210ef0, 0x0, 0xc000325f30, 0xb0c720, 0x7f9b70382560)
	/go/src/google.golang.org/protobuf/compiler/protogen/protogen.go:75 +0x1e2
google.golang.org/protobuf/compiler/protogen.Options.Run(0xc000210ef0, 0x0, 0xc0001d3f30)
	/go/src/google.golang.org/protobuf/compiler/protogen/protogen.go:53 +0x5a
main.main()
	/go/src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/main.go:66 +0x2dd
--grpc-gateway_out: protoc-gen-grpc-gateway: Plugin failed with status code 255.

To Reproduce

Here is my protoc step:

protoc $(INC_PARAMS) \
		--go_out=plugins=grpc:$(OUT_DIR)/example \
		--grpc-gateway_out=$(OUT_DIR) \
		--openapiv2_out=logtostderr=true:$(OUT_DIR) \
		example/echo_service.proto

I found that I can get this to work with if I add an additional param to the grpc-gateway_out plugin, example:

protoc $(INC_PARAMS) \
		--go_out=plugins=grpc:$(OUT_DIR)/example \
		--grpc-gateway_out=version=true:$(OUT_DIR) \
		--openapiv2_out=logtostderr=true:$(OUT_DIR) \
		example/echo_service.proto

Expected behavior

No errors when generating grpc-gateway.

Actual Behavior

See above.

Your Environment

Docker (golang:1.15), protoc v3.13.0.

@johanbrandhorst
Copy link
Collaborator

Can you try --grpc-gateway_out $(OUT_DIR)? Our documentation recommends doing this in separate parameters like this.

@johanbrandhorst
Copy link
Collaborator

CC @adambabik

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

Successfully merging a pull request may close this issue.

2 participants