Matias Salimbene
Matias Salimbene

Reputation: 605

required chaincodes are not installed on sufficient peers

I'm working with hyperledger fabric on the IBM Blockchain Platform service. I've been able to test chain codes with no problems, however, after the last update, I started to get the error required chain codes are not installed on sufficient peers that looks simple but the problem is that the chaincode is in fact installed in all peers.

Log for Peer1

2021-10-28 20:12:53.535 UTC [lifecycle] CheckCommitReadiness -> INFO 111c Successfully
checked commit readiness of chaincode name 'test-cc' on channel 'testchannel2' with
definition {sequence: 5, endorsement info: (version: '0.0.9', plugin: 'escc', init
required: false), validation info: (plugin: 'vscc', policy:
'12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}

Log for Peer2

2021-10-28 20:12:25.575 UTC [lifecycle] CheckCommitReadiness -> INFO 7bf1 Successfully
checked commit readiness of chaincode name 'test-cc' on channel 'testchannel2' with
definition {sequence: 5, endorsement info: (version: '0.0.9', plugin: 'escc', init
required: false), validation info: (plugin: 'vscc', policy:
'12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}

However, when I execute the newly committed chaincode, I get:

2021-10-28 20:20:00.004 UTC [discovery] chaincodeQuery -> ERRO 1126 Failed constructing
descriptor for chaincode chaincodes:<name:"test-cc" > ,: required chaincodes are not
installed on sufficient peers

Any ideas?

Upvotes: 0

Views: 285

Answers (2)

Matias Salimbene
Matias Salimbene

Reputation: 605

The problem was related to how I was deploying the CC. IBM Blockchain platform has a way to install CC on peer copying from another, simply uploading the CC again (for each peer). I tried again using the "copy from another" peer method and it worked. So, perhaps I was choosing a different version when uploading from my laptop.

Upvotes: 0

Dave Enyeart
Dave Enyeart

Reputation: 2573

CheckCommitReadiness only checks if the chaincode definition has been approved. It does not check if the chaincode has actually been installed on the peers. Use queryinstalled for that. If you find that the chaincode is indeed installed on each peer, then the next thing to check is that the discovery service can see each of the peers where the chaincode is installed. To check that, look in the peer logs for the "Membership view" messages. If the "Membership view" is incomplete, then it is likely a gossip configuration issue across the peers.

Upvotes: 1

Related Questions