Welcome to the Linux Foundation Forum!

Lab 4: Error: error getting chaincode deployment spec for ccForAll: error getting chaincode package

In lab 4, when trying to install chaincode on any peer, I got the following error:

Error: error getting chaincode deployment spec for ccForAll: error getting chaincode package bytes: failed to calculate dependencies: incomplete package: google.golang.org/protobuf/encoding/prototext

Somehow running the following command before the chaincode installation fixes this error (not sure anymore where I found it, but it was not part of the lab guide):

docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_ADDRESS=peer0.org1.example.com:7051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp cli go get github.com/hyperledger/fabric-chaincode-go/shim

I thought it was worth sharing, in case someone also encounters this.

Also, is there anyone that can explain to me why the chaincode installation does not work for me without this command, but works for others without it?

Comments

  • Thanks @Rickos95! I was encountering the same problem with:
    Error: error getting chaincode code ccForAll: error getting chaincode package bytes: Error obtaining dependencies for github.com/hyperledger/fabric-chaincode-go/shim: command <go list -f {{ join .Deps "\n"}} github.com/hyperledger/fabric-chaincode-go/shim>: failed with error: "exit status 1" can't load package: package github.com/hyperledger/fabric-chaincode-go/shim: cannot find package "github.com/hyperledger/fabric-chaincode-go/shim" in any of: /opt/go/src/github.com/hyperledger/fabric-chaincode-go/shim (from $GOROOT) /opt/gopath/src/github.com/hyperledger/fabric-chaincode-go/shim (from $GOPATH)

    After running the command you pasted, I was able to install chaincode.
    2020-10-25 09:41:23.599 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc 2020-10-25 09:41:23.599 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc 2020-10-25 09:41:24.854 UTC [chaincodeCmd] install -> INFO 005 Installed remotely response:<status:200 payload:"OK" >

Categories

Upcoming Training