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

Proto file registration panic on startup #108

Closed
torkelrogstad opened this issue Mar 2, 2021 · 3 comments
Closed

Proto file registration panic on startup #108

torkelrogstad opened this issue Mar 2, 2021 · 3 comments

Comments

@torkelrogstad
Copy link

I'm integrating Faraday into an application that communicates with gRPC, and I'm running into issues when importing the generated Faraday Go code: panic: proto: file "rpc.proto" is already registered. See this related issue on the golang/protobuf tracker: golang/protobuf#1122.

This is the line that panics:
https://github.com/lightninglabs/faraday/blob/master/frdrpc/rpc.pb.go#L1630

I'm no expert on technicalities of Protobuf/gRPC, but I see that other Go sources I'm using that's compiled from Proto files don't have the problematic reigstration function. These Go sources are compiled with a newer gRPC stack, specifically protoc-gen-go 1.25.0 and protoc 3.13.0. Could it be that compiling the Faraday Go sources with the newer gRPC stack would solve this?

The only real workaround right now is setting an environment variable, and I would have to make sure that this environment variable is properly set on all developer machines, production machines and CI systems. Sounds like a hassle...

@guggero
Copy link
Member

guggero commented Mar 2, 2021

I think the main issue here is that the rpc.proto has the same name as lnd's rpc.proto. A simple fix would be to rename it. Also updating the grpc library to the same version we now use in lnd should turn the panic into a warning.
@carlaKC do you have time to look at this?

@carlaKC
Copy link
Contributor

carlaKC commented Mar 3, 2021

Yeah will pick this up!

@torkelrogstad
Copy link
Author

Closed in #110

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