protoc "--go_out: protoc-gen-go: plugins are not supported" in CI
The modern google.golang.org/protobuf version of protoc-gen-go dropped the old plugins=grpc option. gRPC stubs are now generated by a separate protoc-gen-go-grpc plugin, so --go_out=plugins=grpc:... is rejected.
What this error means
protoc fails with "--go_out: protoc-gen-go: plugins are not supported" the moment you pass plugins=grpc to the Go output.
--go_out: protoc-gen-go: plugins are not supportedCommon causes
Legacy plugins=grpc syntax with the new plugin
The command still uses --go_out=plugins=grpc:., which only the old github.com/golang/protobuf plugin understood. The current plugin removed that mode.
A mix of old build scripts and a new plugin install
CI installs the modern protoc-gen-go but the Makefile or script predates the split into two plugins.
How to fix it
Split into two output directives
- Install
protoc-gen-go-grpcalongsideprotoc-gen-go. - Replace
--go_out=plugins=grpc:.with separate--go_outand--go-grpc_outflags. - Re-run protoc to generate message and gRPC code.
protoc -I proto \
--go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
proto/service.protoExpress both plugins in buf.gen.yaml
A buf generate config makes the two-plugin split explicit and reproducible.
version: v1
plugins:
- plugin: go
out: gen/go
opt: paths=source_relative
- plugin: go-grpc
out: gen/go
opt: paths=source_relativeHow to prevent it
- Use the two-plugin model (
goplusgo-grpc) in all generation scripts. - Pin both plugin versions so the option surface stays stable.
- Migrate Makefiles off
plugins=grpcwhen adopting the modern plugin.