Topics

Duplicate chaincode registration if CORE_PEER_CHAINCODEADDRESS is set empty

Siddharth Jain
 

We are running a peer in dev mode. Previously we had registered a chaincode against the peer. When we restarted the peer we got this error

135: return errors.Errorf("duplicate chaincodeID: %s", h.chaincodeID)

Upon investigating we realized we had set the CORE_PEER_CHAINCODEADDRESS field to empty string (Case 1). Previously we had set it when we registered the chaincode. We re-started the peer resetting the CORE_PEER_CHAINCODEADDRESS and now the error is gone (Case 2). But this is very puzzling. 

So curious what is going on here? How come there is a duplicate registration event in Case 1?

In case 1 we see:

2020-05-27 10:50:29.658 PDT [nodeCmd] computeChaincodeEndpoint -> INFO 00a Entering computeChaincodeEndpoint with peerHostname: 10.167.66.82
2020-05-27 10:50:29.659 PDT [nodeCmd] computeChaincodeEndpoint -> INFO 00b Exit with ccEndpoint: 10.167.66.82:8052

In case 2 we see:

2020-05-27 10:55:29.960 PDT [nodeCmd] computeChaincodeEndpoint -> INFO 00a Entering computeChaincodeEndpoint with peerHostname: 10.167.66.82
2020-05-27 10:55:29.960 PDT [nodeCmd] computeChaincodeEndpoint -> INFO 00b Exit with ccEndpoint: 127.0.0.1:8052