Welcome to the Linux Foundation Forum!

Lab 4.1. Pag 29. chaincode invoke error


Hello there, I almost complete lab 4.1. Everything looks good up to the last test for chain-code invocation.

When I check with querycommited everything looks good:

peer lifecycle chaincode querycommitted --channelID mychannel --name simple_chaincode\
 --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

Committed chaincode definition for chaincode 'simple_chaincode' on channel 'mychannel':

Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]

but then the invoke of put instructions fails:

peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls \
--cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem \
-C mychannel -n simple_chaincode --peerAddresses localhost:7051 \
--tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 \
--tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt \
-c '{"function":"put", "Args":["k","v"]}'

Error: endorsement failure during invoke. response: status:500 
message:"make sure the chaincode simple_chaincode has been successfully defined on channel mychannel and try again: 
chaincode definition for 'simple_chaincode' exists, but chaincode is not installed"

Any tip is greatly appreciated!


  • matisalimba

    I found the problem... I hadn't installed the chaincode on one of the peers. Kind of odd that I was able to approve and commit it without it being installed. But that's it. I won't delete this post in the case is useful to someone else.

  • Bobbijn
    Bobbijn Posts: 193



Upcoming Training