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

panic: proto: file "egress.proto" is already registered #30

Closed
kieron-dev opened this issue Sep 29, 2021 · 2 comments
Closed

panic: proto: file "egress.proto" is already registered #30

kieron-dev opened this issue Sep 29, 2021 · 2 comments

Comments

@kieron-dev
Copy link
Contributor

kieron-dev commented Sep 29, 2021

Since some protobuf libraries have been updated, go-log-cache now panics when included in a project.

For example, running this main.go:

package main

import logcachev1 "code.cloudfoundry.org/go-log-cache"

func main() {
    logcachev1.NewClient("foo")
}

panics with:

❯ go run main.go
panic: proto: file "egress.proto" is already registered
See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict


goroutine 1 [running]:
google.golang.org/protobuf/reflect/protoregistry.glob..func1({0x9ade40, 0x9c6cf8}, {0x9ade40, 0xc00016aa00})
        /home/vagrant/go/pkg/mod/google.golang.org/[email protected]/reflect/protoregistry/registry.go:54 +0x1f4
google.golang.org/protobuf/reflect/protoregistry.(*Files).RegisterFile(0xc00000e0c0, {0x9c6cf8, 0xc00017f340})
        /home/vagrant/go/pkg/mod/google.golang.org/[email protected]/reflect/protoregistry/registry.go:128 +0x399
google.golang.org/protobuf/internal/filedesc.Builder.Build({{0x0, 0x0}, {0xc0000c7800, 0x3e3, 0x400}, 0x1, 0x6, 0x0, 0x1, {0x9b7c50, ...}, ...})
        /home/vagrant/go/pkg/mod/google.golang.org/[email protected]/internal/filedesc/build.go:113 +0x1d6
github.com/golang/protobuf/proto.RegisterFile({0x913777, 0xc}, {0xcb6540, 0x24d, 0x14})
        /home/vagrant/go/pkg/mod/github.com/golang/[email protected]/proto/registry.go:48 +0x127
code.cloudfoundry.org/go-log-cache/rpc/logcache_v1.init.1()
        /home/vagrant/go/pkg/mod/code.cloudfoundry.org/[email protected]/rpc/logcache_v1/egress.pb.go:353 +0x3a
exit status 2

Investigation has shown this is because go-log-cache imports go-loggregator, and both go-log-cache and go-loggregator have compiled gprc .proto files called 'ingress.proto' and 'egress.proto'. This went from being ignored, to being a warning, and now panics with the up to date protobuf libraries.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

danail-branekov added a commit to eirini-forks/cli that referenced this issue Sep 30, 2021
- client-go v0.22 does not work with protobuf v1.3.4.
- protobuf v1.5 leads to a runtime panic in go-loggregator and
go-log-cache. See:
cloudfoundry/go-log-cache#30
- pin go-log-cache to a fork containing this PR that fixes the above
problem: cloudfoundry/go-log-cache#31

Having done all this allows us to use the latest verson of the client-go
package, which is needed for the cf-on-k8s support.

Co-authored-by: Danail Branekov <[email protected]>
danail-branekov added a commit to eirini-forks/cli that referenced this issue Sep 30, 2021
- client-go v0.22 does not work with protobuf v1.3.4.
- protobuf v1.5 leads to a runtime panic in go-loggregator and
go-log-cache. See:
cloudfoundry/go-log-cache#30
- pin go-log-cache to a fork containing this PR that fixes the above
problem: cloudfoundry/go-log-cache#31

Having done all this allows us to use the latest verson of the client-go
package, which is needed for the cf-on-k8s support.

Co-authored-by: Danail Branekov <[email protected]>
danail-branekov added a commit to eirini-forks/cli that referenced this issue Sep 30, 2021
- client-go v0.22 does not work with protobuf v1.3.4.
- protobuf v1.5 leads to a runtime panic in go-loggregator and
go-log-cache. See:
cloudfoundry/go-log-cache#30
- pin go-log-cache to a fork containing this PR that fixes the above
problem: cloudfoundry/go-log-cache#31

Having done all this allows us to use the latest verson of the client-go
package, which is needed for the cf-on-k8s support.

Co-authored-by: Danail Branekov <[email protected]>
danail-branekov added a commit to eirini-forks/cli that referenced this issue Oct 4, 2021
- client-go v0.22 does not work with protobuf v1.3.4.
- protobuf v1.5 leads to a runtime panic in go-loggregator and
go-log-cache. See:
cloudfoundry/go-log-cache#30
- pin go-log-cache to a fork containing this PR that fixes the above
problem: cloudfoundry/go-log-cache#31

Having done all this allows us to use the latest verson of the client-go
package, which is needed for the cf-on-k8s support.

Co-authored-by: Danail Branekov <[email protected]>
danail-branekov added a commit to eirini-forks/cli that referenced this issue Oct 7, 2021
- client-go v0.22 does not work with protobuf v1.3.4.
- protobuf v1.5 leads to a runtime panic in go-loggregator and
go-log-cache. See:
cloudfoundry/go-log-cache#30
- pin go-log-cache to a fork containing this PR that fixes the above
problem: cloudfoundry/go-log-cache#31

Having done all this allows us to use the latest verson of the client-go
package, which is needed for the cf-on-k8s support.

Co-authored-by: Danail Branekov <[email protected]>
gcapizzi pushed a commit to eirini-forks/cli that referenced this issue Oct 14, 2021
- client-go v0.22 does not work with protobuf v1.3.4.
- protobuf v1.5 leads to a runtime panic in go-loggregator and
go-log-cache. See:
cloudfoundry/go-log-cache#30
- pin go-log-cache to a fork containing this PR that fixes the above
problem: cloudfoundry/go-log-cache#31

Having done all this allows us to use the latest verson of the client-go
package, which is needed for the cf-on-k8s support.

Co-authored-by: Danail Branekov <[email protected]>
gcapizzi pushed a commit to eirini-forks/cli that referenced this issue Oct 14, 2021
- client-go v0.22 does not work with protobuf v1.3.4.
- protobuf v1.5 leads to a runtime panic in go-loggregator and
go-log-cache. See:
cloudfoundry/go-log-cache#30
- pin go-log-cache to a fork containing this PR that fixes the above
problem: cloudfoundry/go-log-cache#31

Having done all this allows us to use the latest verson of the client-go
package, which is needed for the cf-on-k8s support.

Co-authored-by: Danail Branekov <[email protected]>
@geofffranks
Copy link
Contributor

Resolved by merging #31

gcapizzi pushed a commit to eirini-forks/cli that referenced this issue Nov 9, 2021
- client-go v0.22 does not work with protobuf v1.3.4.
- protobuf v1.5 leads to a runtime panic in go-loggregator and
go-log-cache. See:
cloudfoundry/go-log-cache#30
- pin go-log-cache to a fork containing this PR that fixes the above
problem: cloudfoundry/go-log-cache#31

Having done all this allows us to use the latest verson of the client-go
package, which is needed for the cf-on-k8s support.

Co-authored-by: Danail Branekov <[email protected]>
gcapizzi pushed a commit to eirini-forks/cli that referenced this issue Nov 22, 2021
- client-go v0.22 does not work with protobuf v1.3.4.
- protobuf v1.5 leads to a runtime panic in go-loggregator and
go-log-cache. See:
cloudfoundry/go-log-cache#30
- pin go-log-cache to a fork containing this PR that fixes the above
problem: cloudfoundry/go-log-cache#31

Having done all this allows us to use the latest verson of the client-go
package, which is needed for the cf-on-k8s support.

Co-authored-by: Danail Branekov <[email protected]>
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

No branches or pull requests

3 participants