Details
-
Bug
-
Status: Closed
-
Medium
-
Resolution: Invalid: Environment Issue
-
None
-
None
-
None
Description
golang.org/x/net is naughty and acquires a hardcoded resource "/debug/requests" in its init function, meaning that if the package is imported twice (ostensibly from different paths, such as a vendored version and a non-vendored version), the program panics upon startup.
panic: http: multiple registrations for /debug/requests
goroutine 1 [running]:
net/http.(*ServeMux).Handle(0x1b67dc0, 0x137c787, 0xf, 0x1433900, 0x13aaf80)
{{ /usr/lib/go-1.10/src/net/http/server.go:2353 +0x239 }}
net/http.(*ServeMux).HandleFunc(0x1b67dc0, 0x137c787, 0xf, 0x13aaf80)
{{ /usr/lib/go-1.10/src/net/http/server.go:2368 +0x55 }}
net/http.HandleFunc(0x137c787, 0xf, 0x13aaf80)
{{ /usr/lib/go-1.10/src/net/http/server.go:2380 +0x4b }}
github.com/hyperledger/fabric/vendor/golang.org/x/net/trace.init.0()
{{ /home/vdods/files/gopath/src/github.com/hyperledger/fabric/vendor/golang.org/x/net/trace/trace.go:115 +0x42 }}
The fix for this is to not vendor golang.org/x/net (even though it's their fault that this is happening).