Error: Error getting chaincode code chaincode: <go, [env]>: failed with error: "exec: not started" - hyperledger-fabric

I have created hyperledger in azure blockchain and created fabric-ca, orderer and 2 peer nodes. I am able to create channel and 2 peers joined in the channel. I am not able to install chaincode. The commands are executed form Git bash. Getting below error while running the command from peer node. Please help...
root#d62e3aedc701:/# peer chaincode install -n balcc -v 1.0 -p Chaincode/fabric-samples/balance-transfer/artifacts/src/github.com/example_cc/go/
2018-05-25 05:32:42.702 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-05-25 05:32:42.702 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: Error getting chaincode code chaincode: : failed with error: "exec: not started"

In my case, I just reinstall go and this problem fix.

Related

Chaincode path does not exist

Problem:
I have set up a Hyperledger Fabric network. When I try to install a chaincode it is only installed in the first peer. But when I try to install chaincode on other peers it was failed by saying that chaincode does not exist.
This is the command I issued on the first peer.
peer chaincode install -n fabcar -v 1.0.0 -l node -p /opt/gopath/src/github.com/chaincode/fabcar/javascript-low-level
This is the output after the command.
2020-03-01 07:27:26.245 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2020-03-01 07:27:26.245 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2020-03-01 07:27:26.705 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
This is the command I issued on the second peer.
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/doctor.hrm.com/users/Admin#doctor.hrm.com/msp CORE_PEER_ADDRESS=peer1.doctor.hrm.com:10051 CORE_PEER_LOCALMSPID="DoctorMSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/doctor.hrm.com/peers/peer1.doctor.hrm.com/tls/ca.crt peer chaincode install -n fabcar -v 1.0.0 -l node -p /opt/gopath/src/github.com/fabcar/javascript-low-level
This is the error that was given to me.
2020-03-01 07:34:28.268 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2020-03-01 07:34:28.268 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: error getting chaincode code fabcar: path to chaincode does not exist: /opt/gopath/src/github.com/fabcar/javascript-low-level
Can someone help me with this to find the issue?
Check your GOPATH set in cli container docker-compose.yaml file.
If GOPATH=/opt/gopath then you should give path inside src folder. So you should give path in peer chaincode install as github.com/fabcar/javascript-low-level
so your command will be
peer chaincode install -n fabcar -v 1.0.0 -l node -p github.com/chaincode/fabcar/javascript-low-level
so check your GOPATH set in cli container of docker-compose.yaml and accordingly set the path in peer chaincode install command

Please tell me how to solve path to chaincode does not exist

What I did:
Get into the cli container.
Make channel.
Join channel.
What I'm doing:
peer chaincode install.
I want to install the Chaincode which I have made and is on the GitHub.
So I think it can be installed like example02.
I didn't change the code in docker-compose-cli.yaml and others as well.
When I use the command "peer Chaincode install", it says "path to chaincode does not exist".
root#7fdb5cf9a746:/opt/gopath/src/github.com/hyperledger/fabric/peer#
peer chaincode install -n mycc -v 1.0 -p github.com/Gela-Gunp/OriginChaincodeForMe
2019-01-22 07:48:52.599 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2019-01-22 07:48:52.599 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2019-01-22 07:48:52.599 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-01-22 07:48:52.599 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
Error: Error getting chaincode code chaincode: path to chaincode does not exist: github.com/Gela-Gunp/OriginChaincodeForMe
Maybe I should do something before Chaincode install.
But I don't know what that is.
#gelatine, in your chaincode install command "-p" flag indicates your chaincode's source path (Note: local path)..
It can be like your command, but you should have those directories mounted inside your cli container. Also don't forget to take care of the GOPATH env variable :p
Please go thorough the Fabric chaincode reference docs:
Fabric Chaincode for developers

Hyperledger - peer unable to instantiate chaincode after joining channel

I currently have a running Kafka-based hyperledger running on docker.
The full container list is as such:
2x orderer
2x peer
1x certificate-authority
3x zookeeper
4x kafka nodes
1x cli tools
I have sucessfully created a channel using cli by the following command
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/users/Admin#company/msp" peer0.company peer channel create -o orderer0.company:7050 -c messagebus -f /etc/hyperledger/configtx/channel.tx
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp/users/Admin#company/msp" peer0.company peer channel join -b messagebus.block
I can see the peer is joined using the following command:
docker exec cli peer channel list
2019-01-07 16:54:41.784 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
Channels peers has joined:
messagebus
I then want to init and instantiate my chaincode as such
#install the chaincode
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/company/users/Admin#company/msp" cli peer chaincode install -n testnet -v 1.0 -p "$CC_SRC_PATH" -l "$LANGUAGE"
2019-01-07 16:46:23.154 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-01-07 16:46:23.154 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2019-01-07 16:46:23.615 UTC [chaincodeCmd] install -> INFO 005 Installed remotely response:<status:200 payload:"OK" >
#instantiate the chaincode
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/company/users/Admin#company/msp" cli peer chaincode instantiate -o orderer0.company:7050 -C messagebus -n testnet -l "$LANGUAGE" -v 1.0 -c '{"Args":[""]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
2019-01-07 16:46:24.210 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-01-07 16:46:24.210 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
Error: error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [messagebus] creator org [Org1MSP]
As the final line shows, the access is denied to the channel.
I am also unable to join a Java SDK client to the channel and receive similar access denied errors.
I see the following logs in the peer0 container:
2019-01-07 16:46:23.611 UTC [endorser] callChaincode -> INFO 0f1 [][bfb2e2d4] Entry chaincode: name:"lscc"
2019-01-07 16:46:23.614 UTC [lscc] executeInstall -> INFO 0f2 Installed Chaincode [gmex] Version [1.0] to peer
2019-01-07 16:46:23.614 UTC [endorser] callChaincode -> INFO 0f3 [][bfb2e2d4] Exit chaincode: name:"lscc" (2ms)
2019-01-07 16:46:23.614 UTC [comm.grpc.server] 1 -> INFO 0f4 unary call completed {"grpc.start_time": "2019-01-07T16:46:23.61Z", "grpc.service": "protos.Endorser", "grpc.method": "ProcessProposal", "grpc.peer_address": "XXX.XXX.X.XXX:123", "grpc.code": "OK", "grpc.call_duration": "3.771114ms"}
2019-01-07 16:46:24.214 UTC [protoutils] ValidateProposalMessage -> WARN 0f5 channel [messagebus]: MSP error: the supplied identity is not valid: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.company")
this leads me to believe the peer is not correctly setup... however it is able to create the channel successfully.
Any pointers would be appreciated

Unable to install Hyperledger Fabric Marbles chaincode from a repository to a peer

I'm using this Hyperledger Fabric tutorial, I am block on the step 1 of part Install chaincode on all peers
When I run the command peer chaincode install -n marblesp -v 1.0 -p github.com/chaincode/marbles02_private/go/I have the following result containing an error :
2018-12-10 13:19:37.515 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-12-10 13:19:37.515 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: Error getting chaincode code chaincode: path to chaincode does not exist: /opt/gopath/src/github.com/fabric-samples/chaincode/marbles02_private
Could you help me please? thanks
Do you have the chaincodes in this path? Be sure you have the chaincode in this path.
Do you have Go installed? If yes, do you export the Go path?
Try with this:
export PATH=$PATH:/usr/local/go/bin

Fail to instantiate the chaincode in first network of fabric-samples

The official hyperledger fabric v1.0.0 gives a simple demo by using docker.
What i am doing is to avoid docker and directly run them on the machine. Thanks to the answer from my previous question, I have successfully launched 1 solo orderer, two peers (each from one org), created and joined the channels from peers, installed the chaincode on two peers.
The client side's command to install chaincode is
peer chaincode install -n myC1 -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
Both peers return the following message and I think it should be correct.
2017-09-11 16:34:26.361 SGT [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2017-09-11 16:34:26.361 SGT [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2017-09-11 16:34:26.556 SGT [main] main -> INFO 003 Exiting.....
However, when i try to instantiate the chaincode as follows
peer chaincode instantiate -o orderer.example.com:7040 --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C $CHANNEL_NAME -n myC1 -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')
Client console returns the error message
2017-09-11 17:00:18.181 SGT [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2017-09-11 17:00:18.181 SGT [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: Error endorsing chaincode: rpc error: code = Unknown desc = Failed to init chaincode(handler not found for chaincode myC1:1.0)
The console of Peer0.org2 gives NO error message. But Peer0.org1's console gives the following:
2017-09-11 17:00:18.183 SGT [chaincode] Launch -> ERRO 032 sending init failed(handler not found for chaincode myC1:1.0)
2017-09-11 17:00:18.184 SGT [endorser] simulateProposal -> ERRO 033 failed to invoke chaincode name:"lscc" on transaction a665c5305c5e3f158d272e4a39b04611e5335406e2a7c7057f11d32d8e07670e, error: Failed to init chaincode(handler not found for chaincode myC1:1.0)
Can any one help me to solve this problem and give me a simple explanation??

Resources