buf "buf generate" plugin failed in CI
buf generate runs the plugins listed in buf.gen.yaml. A local plugin fails if its binary is not on PATH; a remote plugin fails if the reference or version is wrong. The error names which plugin failed and why.
What this error means
buf generate fails with "Failure: plugin protoc-gen-go: ..." for a local plugin (not found on PATH) or a remote-plugin resolution error for a remote: reference.
Failure: plugin "go": could not find protoc plugin for name "go":
exec: "protoc-gen-go": executable file not found in $PATHCommon causes
A local plugin binary is missing from PATH
A local: or bare plugin name in buf.gen.yaml requires the protoc-gen-* binary on PATH, which the runner may not have.
A remote plugin reference or version is wrong
A remote: plugin points at a name or version that does not exist on the registry, so buf cannot fetch it.
How to fix it
Use remote plugins to avoid PATH setup
- Reference a hosted plugin with a pinned version in buf.gen.yaml.
- buf fetches and runs it without any local install.
- Re-run
buf generate.
version: v2
plugins:
- remote: buf.build/grpc/go:v1.5.1
out: genInstall the local plugin and export PATH
If you keep local plugins, install the binary and add GOPATH/bin to PATH before buf generate.
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"How to prevent it
- Prefer remote plugins so CI needs no plugin installs.
- Pin every plugin version in buf.gen.yaml.
- If using local plugins, install and PATH-export them in a setup step.