-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Error happens when a program imports grpc more than twice #566
Comments
There's something going wrong on your end. The likely problem is that the trace package is being imported in two different ways. Or do you have it vendored? Or other code registering on /debug/requests? |
This exact thing happened to me, and it was as @dsymonds describes. Not that our environments are likely to be exactly the same, but for reference: We're still using |
@mitake nope - we just vendor everything we use. |
@zellyn thanks, I'll try the building again. |
Please reopen this, this is a problem. I have an application that exposes a grpc service, and the application happens to use etcd which happens to also use grpc. I can't change how etcd vendors grpc, so how do I solve this problem? |
@immesys This is a dependency management problem, not something that we can solve within gRPC. Please look into the dependency management tool you use to see how to avoid double import. |
@immesys using dep will fix the issue for you - it'll ensure there's only one copy in vendor. |
The below error happened when I build a program that imports grpc twice (indirectly).
The root cause of the error seems to be the module
golang.org/x/net/trace
. Its init() registers a handler to the same URL (e.g. /debug/requesets). Therefore importing the module more than twice causes the above panic.I'm not sure here is a suitable place for reporting the problem. I'd like to hear gRPC developers' opinion. Should I go to the issue tracker of golang? Or is a workaround for this problem known?
The text was updated successfully, but these errors were encountered: