Skip to content
Latchkey

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.

buf generate
Failure: plugin "go": could not find protoc plugin for name "go":
exec: "protoc-gen-go": executable file not found in $PATH

Common 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

  1. Reference a hosted plugin with a pinned version in buf.gen.yaml.
  2. buf fetches and runs it without any local install.
  3. Re-run buf generate.
buf.gen.yaml
version: v2
plugins:
  - remote: buf.build/grpc/go:v1.5.1
    out: gen

Install the local plugin and export PATH

If you keep local plugins, install the binary and add GOPATH/bin to PATH before buf generate.

Terminal
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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →