I added a new plugin go-json_out from https://github.com/mitchellh/protoc-gen-go-json and got some panics running buf generate until I got the actual error Failure: could not find protoc plugin for name go-json_out on the third try. That's when I realized that I needed to remove the _out suffix, after which the generate worked perfectly. Not a big deal, but probably worth fixing so that the error gets emitted correctly on the first run. Maybe also accepting or at least suggesting removing _out if detected?
buf.gen.yaml
version: v1
managed:
enabled: true
go_package_prefix:
default: go.nozzle.io
plugins:
- name: go
out: .
opt: paths=source_relative
- name: go-grpc
out: .
opt:
- paths=source_relative
- require_unimplemented_servers=false
- name: go-json_out
out: .
opt:
- paths=source_relative
- enums_as_ints=false
- emit_defaults=false
- orig_name=false
- allow_unknown=false
Run 1
panic: send on closed channel
goroutine 110 [running]:
github.com/bufbuild/buf/private/buf/bufgen.semaphore.Acquire(0xc000d8f3e0, {0x1a99d68, 0xc001d37a00})
github.com/bufbuild/buf/private/buf/bufgen/generator.go:584 +0x7a
github.com/bufbuild/buf/private/buf/bufgen.(*generator).generateConcurrently.func1()
github.com/bufbuild/buf/private/buf/bufgen/generator.go:227 +0xa6
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x92
panic: send on closed channel
goroutine 118 [running]:
github.com/bufbuild/buf/private/buf/bufgen.semaphore.Acquire(0xc000d8f3e0, {0x1a99d68, 0xc001d37a00})
github.com/bufbuild/buf/private/buf/bufgen/generator.go:584 +0x7a
github.com/bufbuild/buf/private/buf/bufgen.(*generator).generateConcurrently.func1()
github.com/bufbuild/buf/private/buf/bufgen/generator.go:227 +0xa6
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x92
Run 2
panic: send on closed channel
goroutine 93 [running]:
github.com/bufbuild/buf/private/buf/bufgen.semaphore.Acquire(0xc001b621e0, {0x1a99d68, 0xc002b7d640})
github.com/bufbuild/buf/private/buf/bufgen/generator.go:584 +0x7a
github.com/bufbuild/buf/private/buf/bufgen.(*generator).generateConcurrently.func1()
github.com/bufbuild/buf/private/buf/bufgen/generator.go:227 +0xa6
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x92
panic: send on closed channel
goroutine 116 [running]:
github.com/bufbuild/buf/private/buf/bufgen.semaphore.Acquire(0xc001b621e0, {0x1a99d68, 0xc002b7d640})
github.com/bufbuild/buf/private/buf/bufgen/generator.go:584 +0x7a
github.com/bufbuild/buf/private/buf/bufgen.(*generator).generateConcurrently.func1()
github.com/bufbuild/buf/private/buf/bufgen/generator.go:227 +0xa6
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x92
panic: send on closed channel
goroutine 124 [running]:
github.com/bufbuild/buf/private/buf/bufgen.semaphore.Acquire(0xc001b621e0, {0x1a99d68, 0xc002b7d640})
github.com/bufbuild/buf/private/buf/bufgen/generator.go:584 +0x7a
github.com/bufbuild/buf/private/buf/bufgen.(*generator).generateConcurrently.func1()
github.com/bufbuild/buf/private/buf/bufgen/generator.go:227 +0xa6
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x92
panic: send on closed channel
goroutine 97 [running]:
github.com/bufbuild/buf/private/buf/bufgen.semaphore.Acquire(0xc001b621e0, {0x1a99d68, 0xc002b7d640})
github.com/bufbuild/buf/private/buf/bufgen/generator.go:584 +0x7a
github.com/bufbuild/buf/private/buf/bufgen.(*generator).generateConcurrently.func1()
github.com/bufbuild/buf/private/buf/bufgen/generator.go:227 +0xa6
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x92
Run 3
Failure: could not find protoc plugin for name go-json_out
I added a new plugin
go-json_outfrom https://github.com/mitchellh/protoc-gen-go-json and got some panics runningbuf generateuntil I got the actual errorFailure: could not find protoc plugin for name go-json_outon the third try. That's when I realized that I needed to remove the_outsuffix, after which the generate worked perfectly. Not a big deal, but probably worth fixing so that the error gets emitted correctly on the first run. Maybe also accepting or at least suggesting removing_outif detected?buf.gen.yaml
Run 1
Run 2
Run 3