Welcome to the Linux Foundation Forum!

cannot find package "io/fs" in any of (hyperledger fabric chaincode build)

installing chaincode failed: Multiple errors occurred: - Transaction processing for endorser [localhost:7051]: Chaincode status Code: (500) UNKNOWN. Description: chaincode installed to peer but could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 1 "/chaincode/input/src/github.com/fyx_chain.com/fyx_chain/chaincode/vendor/golang.org/x/net/http2/transport.go:19:2: cannot find package "io/fs" in any of:
/chaincode/input/src/github.com/fyx_chain.com/fyx_chain/chaincode/vendor/io/fs (vendor tree)
/usr/local/go/src/io/fs (from $GOROOT)
/chaincode/input/src/io/fs (from $GOPATH)
/go/src/io/fs
" - Transaction processing for endorser [localhost:7151]: Chaincode status Code: (500) UNKNOWN. Description: chaincode installed to peer but could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 1 "/chaincode/input/src/github.com/fyx_chain.com/fyx_chain/chaincode/vendor/golang.org/x/net/http2/transport.go:19:2: cannot find package "io/fs" in any of:
/chaincode/input/src/github.com/fyx_chain.com/fyx_chain/chaincode/vendor/io/fs (vendor tree)
/usr/local/go/src/io/fs (from $GOROOT)
/chaincode/input/src/io/fs (from $GOPATH)
/go/src/io/fs

Answers

  • Bobbijn
    Bobbijn Posts: 193

    Hello,

    Please let me know if the suggestion from your previous post resolved the issue, if not you can try :smile:
    Verify Go Version in Dockerfile: The primary suspect in this scenario is the Go version being used in your Docker container. As mentioned previously, "io/fs" is available in Go 1.16 and later. Ensure that the Dockerfile used for building the chaincode specifies FROM golang:1.16 or a newer version. This step is crucial because even if your local environment has the correct Go version, the Docker container might not.

    Let me know if this helped, Bobbi

Categories

Upcoming Training