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

Generic .proto filename causes protocol buffer namespace conflicts #67

Closed
gwossum opened this issue Mar 13, 2024 · 0 comments · Fixed by #68
Closed

Generic .proto filename causes protocol buffer namespace conflicts #67

gwossum opened this issue Mar 13, 2024 · 0 comments · Fixed by #68
Assignees

Comments

@gwossum
Copy link
Member

gwossum commented Mar 13, 2024

The generic filename internal/internal.proto can create panics on startup due to protocol buffers namespace conflicts when influxql is included in projects that have modules with a internal/internal.proto file.

Error message:

panic: proto: file "internal/internal.proto" is already registered
        previously from: "github.com/influxdata/influxdb/query/internal"
        currently from:  "github.com/influxdata/influxql/internal"
See https://protobuf.dev/reference/go/faq#namespace-conflict


goroutine 1 [running]:
google.golang.org/protobuf/reflect/protoregistry.glob..func1({0x264ad40?, 0xc0005cb2e0?}, {0x264ad40?, 0xc0005cb320})
        /home/geoff/.gvm/pkgsets/go1.21.8/global/pkg/mod/google.golang.org/[email protected]/reflect/protoregistry/registry.go:56 +0x1e5
google.golang.org/protobuf/reflect/protoregistry.(*Files).RegisterFile(0xc0005bb260, {0x267feb8?, 0xc0004aea80?})
        /home/geoff/.gvm/pkgsets/go1.21.8/global/pkg/mod/google.golang.org/[email protected]/reflect/protoregistry/registry.go:130 +0x3a6
google.golang.org/protobuf/internal/filedesc.Builder.Build({{0x1e11370, 0x27}, {0x3dab880, 0x11e, 0x11e}, 0x0, 0x2, 0x0, 0x0, {0x26575c0, ...}, ...})
        /home/geoff/.gvm/pkgsets/go1.21.8/global/pkg/mod/google.golang.org/[email protected]/internal/filedesc/build.go:112 +0x1d6
google.golang.org/protobuf/internal/filetype.Builder.Build({{{0x1e11370, 0x27}, {0x3dab880, 0x11e, 0x11e}, 0x0, 0x2, 0x0, 0x0, {0x0, ...}, ...}, ...})
        /home/geoff/.gvm/pkgsets/go1.21.8/global/pkg/mod/google.golang.org/[email protected]/internal/filetype/build.go:138 +0x199
github.com/influxdata/influxql/internal.file_internal_internal_proto_init()
        /home/geoff/influx/src/github.com/influxdata/influxql/internal/internal.pb.go:242 +0x198
github.com/influxdata/influxql/internal.init.0()
        /home/geoff/influx/src/github.com/influxdata/influxql/internal/internal.pb.go:198 +0xf

For more context on this error, see golang/protobuf#1122.

@gwossum gwossum self-assigned this Mar 13, 2024
gwossum added a commit that referenced this issue Mar 13, 2024
Rename generic name of .proto file to avoid conflicts when used in projects that also
happen to have a file named `internal/internal.proto` in any modules.

closes: #67
gwossum added a commit that referenced this issue Mar 13, 2024
* fix: prevent panics due to protocol buffer namespace conflicts

Rename generic name of .proto file to avoid conflicts when used in projects that also
happen to have a file named `internal/internal.proto` in any modules.

Also updates go_package option to recommended value.

closes: #67
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.

1 participant