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

vision: Error happens when a program imports grpc more than twice #716

Closed
avelino opened this issue Aug 3, 2017 · 2 comments
Closed

vision: Error happens when a program imports grpc more than twice #716

avelino opened this issue Aug 3, 2017 · 2 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@avelino
Copy link

avelino commented Aug 3, 2017

The below error happened when I build a program that imports grpc twice (indirectly).

panic: http: multiple registrations for /debug/requests

goroutine 1 [running]:
net/http.(*ServeMux).Handle(0x529a360, 0x4bdc4ad, 0xf, 0x51900c0, 0x4c1d688)
        /usr/local/Cellar/go/1.8.3/libexec/src/net/http/server.go:2254 +0x610
net/http.(*ServeMux).HandleFunc(0x529a360, 0x4bdc4ad, 0xf, 0x4c1d688)
        /usr/local/Cellar/go/1.8.3/libexec/src/net/http/server.go:2286 +0x55
net/http.HandleFunc(0x4bdc4ad, 0xf, 0x4c1d688)
        /usr/local/Cellar/go/1.8.3/libexec/src/net/http/server.go:2298 +0x4b
golang.org/x/net/trace.init.1()
        /Users/avelino/src/golang.org/x/net/trace/trace.go:115 +0x42
golang.org/x/net/trace.init()
        /Users/avelino/src/golang.org/x/net/trace/trace_go17.go:22 +0x1cd
google.golang.org/grpc.init()
        /Users/avelino/src/google.golang.org/grpc/trace.go:105 +0x87
google.golang.org/genproto/googleapis/cloud/vision/v1.init()
        /Users/avelino/src/google.golang.org/genproto/googleapis/cloud/vision/v1/web_detection.pb.go:194 +0x87
cloud.google.com/go/vision.init()
        /Users/avelino/src/cloud.google.com/go/vision/vision.go:357 +0x52
github.com/nuveo/runners/cicontains.init()
        /Users/avelino/src/github.com/nuveo/runners/cicontains/cicontains.go:150 +0x70
github.com/nuveo/runners/summoner.init()
        /Users/avelino/src/github.com/nuveo/runners/summoner/summoner.go:187 +0x75
github.com/nuveo/instances%2ecore.init()
        /Users/avelino/src/github.com/nuveo/instances.core/instances.go:88 +0x62
github.com/nuveo/application.core/process.init()
        /Users/avelino/src/github.com/nuveo/application.core/process/routers.go:11 +0x8e
main.init()
        /Users/avelino/src/github.com/nuveo/application.core/main.go:48 +0x5d
exit status 2

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?

ref: grpc/grpc-go#566

@jba jba assigned rakyll and unassigned rakyll Aug 3, 2017
@jba
Copy link
Contributor

jba commented Aug 3, 2017

How do you import grpc twice? Is vendoring involved?

@rakyll rakyll changed the title Google Vision: Error happens when a program imports grpc more than twice vision: Error happens when a program imports grpc more than twice Aug 3, 2017
@pongad pongad added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Aug 8, 2017
@jba
Copy link
Contributor

jba commented Aug 22, 2017

Closing due to lack of activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

No branches or pull requests

4 participants