Welcome to the Linux Foundation Forum!

Not able to install go lang chaincode in my hyperledger fabric network with any version

my chaincode runs without any issues when debugging in the same Go environment using a dedicated VSCode extension, but fails during installation on your actual network and return error "Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 1 "vendor/golang.org/x/net/http2/transport.go:19:2: cannot find package "." in:
/chaincode/input/src/vendor/io/fs
""

Answers

  • Bobbijn
    Bobbijn Posts: 193

    Hello rbadrana,

    From the error message you've provided, it seems like there's an issue with one of your Go dependencies., The Fabric network is looking for a version of Go that doesn't what is loaded. Here are a few suggestions you could try:

    Check the Go version: Make sure the Go version used in your Hyperledger Fabric network matches the Go version you have loaded.

    Update the Fabric Peer Image: If you're using Docker, ensure you're using a fabric-peer docker image that supports the Go version your chaincode is written in.

    This forum supports the Lab exercises, it would help if you could pinpoint what exercise you are experiencing the issue.

    I hope this helps. Bobbi

  • rbadrana
    rbadrana Posts: 2

    thank you mam for your reply, i got the error, Although i was installing latest fabric version, I forgot to update my file base.yaml of project which was downloading fabric 2.1 images.
    "version: "2"
    services:
    peer-base:
    image: hyperledger/fabric-peer:2.1
    environment:"
    .......................
    ......................."

    so i updated this with " image: hyperledger/fabric-peer:2.4" and problem solved.
    Thankyou once again

  • Bobbijn
    Bobbijn Posts: 193

    :)

  • @Bobbijn said:
    :)

    I have same 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

    go version 1.17 peer docker images 2.2

  • Bobbijn
    Bobbijn Posts: 193

    Hello,

    The issue you're facing with installing chaincode, as indicated by the error message, seems to be related to the Go version and the Docker environment setup. Please check your setup files. Let me know if this resolves your issues. Bobbi

Categories

Upcoming Training