Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-12031

Vendoring of golang.org/x/net causes panic

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Medium
    • Resolution: Invalid: Environment Issue
    • None
    • None
    • fabric-peer
    • None
    • Hide
      Presumably importing github.com/golang/protobuf/proto and github.com/hyperledger/fabric/core/chaincode/shim at the same time would produce this, as I believe github.com/hyperledger/fabric/core/chaincode/shim uses the vendored version of golang.org/x/net

      One workaround is to delete github.com/hyperledger/fabric/vendor/golang.org/x/net from your local copy.
      Show
      Presumably importing github.com/golang/protobuf/proto and github.com/hyperledger/fabric/core/chaincode/shim at the same time would produce this, as I believe github.com/hyperledger/fabric/core/chaincode/shim uses the vendored version of golang.org/x/net One workaround is to delete github.com/hyperledger/fabric/vendor/golang.org/x/net from your local copy.

    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).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vdods Victor Dods
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: