Clyde D'Cruz
Clyde D'Cruz

Reputation: 2065

Chaincode not found in channel during invoke

I am trying some code from the fabric-sdk-node v1.0.0-alpha e2e tests. I have the following network configuration:

In short, im trying to accomplish the following

  1. Create a channel
  2. Join peer0, peer1 to the channel
  3. Install, instantiate chaincode
  4. Send invoke and query transactions

After the instantiate operation I can see the following log entry in both of the chaincode container started for peer0 and peer1

Content of both chaincode logs after install + instantiate

########### example_cc Init ###########
Aval = 100, Bval = 200

But when I sent the invoke, the peer gives the following error in the log of peer1:

peer1 log

2017-04-12 10:53:43.966 UTC [sysccapi] deploySysCC -> INFO 035 system chaincode qscc/mychannel(github.com/hyperledger/fabric/core/chaincode/qscc) deployed
2017-04-12 10:53:44.085 UTC [gossip/comm#-1] authenticateRemotePeer -> WARN 036 Remote peer 172.18.0.7:7051 didn't send TLS certificate
2017-04-12 10:53:44.085 UTC [gossip/comm#-1] sendToEndpoint -> WARN 037 Failed obtaining connection for peer0:7051, PKIid:[] reason: Remote peer 172.18.0.7:7051 didn't send TLS certificate
2017-04-12 10:53:55.024 UTC [lccc] Invoke -> ERRO 038 ChaincodeId: end2end does not exist on channel: mychannel(err:chaincode not found end2end)

After the invoke attempt following is the log entries in both the chaincode containers:

peer0 chaincode container log

########### example_cc Init ###########
Aval = 100, Bval = 200
########### example_cc Invoke ###########
Aval = 0, Bval = 300

peer1 chaincode container log

########### example_cc Init ###########
Aval = 100, Bval = 200

What could be the cause of the chaincode not found error? And why does it occur even though the init seems to be successful on both the peers?

Upvotes: 1

Views: 1562

Answers (1)

Gari Singh
Gari Singh

Reputation: 12033

The likely cause of the error is that peer1 is unable to communicate with the orderer node. Even though you were able to install and then instantiate, instantiate is like any there transaction (except it is invoked against the lccc - lifecycle system chaincode). So while the chaincode was init'd as part of endorsing the instantiate proposal, the instantiate transaction was not committed and therefore you can't invoke it (commit basically means adding it to the state of lccc).

The likely cause for this error is that the peer could not communicate with the orderer. You might be able to check your logs for peer1 and look for something like deliver or deliver service to verify

Upvotes: 1

Related Questions