Welcome to the Linux Foundation Forum!

when I build fabric chaincode (go) by fabric-sdk-go,I have the question

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,
    This error typically arises when you use a version of Go that is older than 1.16, as older versions do not include the "io/fs" package.

    You can try to Update Go Version: Ensure that you are using Go version 1.16 or newer. You can check your current Go version by running go version in your terminal. If you are using an older version, you should update it to at least 1.16.

    Please let me know if this helps, Bobbi

Categories

Upcoming Training