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

Unwanted namespacing warning/ or error #6853

Closed
mamaart opened this issue Dec 13, 2023 · 1 comment
Closed

Unwanted namespacing warning/ or error #6853

mamaart opened this issue Dec 13, 2023 · 1 comment

Comments

@mamaart
Copy link

mamaart commented Dec 13, 2023

What version of gRPC are you using?

1.59.0

What version of Go are you using (go version)?

1.21.4

What operating system (Linux, Windows, …) and version?

Linux 6.6.4-arch1-1

What did you do?

I have multiple protos defined in a git repo and the generated code is in this repo as well and I use it to import the functionality into the server and clients.

├── events_service
│   ├── admin.proto
│   ├── golang
│   │   ├── admin
│   │   │   ├── admin_grpc.pb.go
│   │   │   └── admin.pb.go
│   │   ├── generate.sh
│   │   ├── go.mod
│   │   ├── go.sum
│   │   ├── shared
│   │   │   └── shared.pb.go
│   │   └── user
│   │   ├── user_grpc.pb.go
│   │   └── user.pb.go
│   ├── shared.proto
│   └── user.proto
├── mailbox_service
│   ├── admin.proto
│   ├── golang
│   │   ├── admin
│   │   │   ├── admin_grpc.pb.go
│   │   │   └── admin.pb.go
│   │   ├── generate.sh
│   │   ├── go.mod
│   │   └── user
│   │   ├── user_grpc.pb.go
│   │   └── user.pb.go
│   └── user.proto
├── member_service
│   ├── admin.proto
│   ├── golang
│   │   ├── admin
│   │   │   ├── admin_grpc.pb.go
│   │   │   └── admin.pb.go
│   │   ├── generate.sh
│   │   ├── go.mod
│   │   ├── registration
│   │   │   ├── registration_grpc.pb.go
│   │   │   └── registration.pb.go
│   │   ├── shared
│   │   │   └── shared.pb.go
│   │   └── statistics
│   │   ├── statistics_grpc.pb.go
│   │   └── statistics.pb.go
│   ├── registration.proto
│   ├── shared.proto
│   └── statistics.proto
└── README.md

  • events service
  • mailbox service
  • member service

They are not related to eachother.

Inside some of them have a protofile called shared (its only used inside the domain and not shared with the others.)

When I have a client application that use all of the protos I get a panic, but I managed to reduce it to a warning after reading the FAQ in the error message.

I have even namespaced the package name in the proto - for instance:

syntax = "proto3";

package eventsservice.shared;

option go_package = "github.com/dk-slack/protos/events_service/golang/shared";

What did you expect to see?

Nothing, no warning and no errors.

What did you see instead?

After running this:

❯ GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn go run ./cmd
WARNING: proto: file "shared.proto" is already registered
	previously from: "github.com/dk-slack/protos/events_service/golang/shared"
	currently from:  "github.com/dk-slack/protos/member_service/golang/shared"
See https://protobuf.dev/reference/go/faq#namespace-conflict

WARNING: proto: file "admin.proto" is already registered
	previously from: "github.com/dk-slack/protos/events_service/golang/admin"
	currently from:  "github.com/dk-slack/protos/member_service/golang/admin"
See https://protobuf.dev/reference/go/faq#namespace-conflict
@easwars
Copy link
Contributor

easwars commented Dec 15, 2023

This feels like a protobuf issue and not a grpc issue. Please open an issue with the protobuf repository. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants