Re: peer lifecycle chaincode commit error 500


Will Lahti
 

Hey Antoni,
As pointed out by the output of CheckCommitReadiness, with your current network configuration, the peer is looking at both Org1 and Org2 for approvals before the chaincode definition can be committed. The signature policy you're setting in the definition is the endorsement policy for the chaincode itself. To commit a chaincode definition, the lifecycle endorsement policy must be satisfied. By default, that is set to a majority of the endorsement policies for each organization participating in the channel.
 
To get things working, you'll either need to
1) submit an approval using credentials for org1 (easiest given your current configuration)
2) update the LifecycleEndorsement policy for the channel from "MAJORITY Endorsement" to "ANY Endorsement" in configtx.yaml (assuming this is a network you don't mind spinning up fresh, otherwise you'll need to perform a config update to update the policy).
 
Feel free to reach out to me directly if you need further assistance!
 
Regards,
Will Lahti
Software Developer - Hyperledger Fabric + IBM Blockchain
E-mail: wtlahti@...
 
 

----- Original message -----
From: "Antoni Massó Mola" <antonimassomola@...>
Sent by: fabric@...
To: fabric@...
Cc:
Subject: [EXTERNAL] [Hyperledger Fabric] peer lifecycle chaincode commit error 500
Date: Thu, Jun 11, 2020 5:15 PM
 
Hello,

Im stuck at the peer lifecycle chaincode commit command.
I execute the following commands until I get an error on the above command.
 
export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/peerOrganizations/org2/users/Admin@org2/msp
export CORE_PEER_ADDRESS=peer0-org2-service:10051
export CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/peerOrganizations/org2/peers/org2-peer0.default.svc.cluster.local/tls/ca.crt
export CORE_PEER_LOCALMSPID=org2
 
peer lifecycle chaincode package o-test7.tar.gz --path /chainset/hyperledger-config/chaincode/src/o-test --label o-test7
 
peer lifecycle chaincode install o-test7.tar.gz
 
peer lifecycle chaincode approveformyorg --tls lifecycle chaincode approveformyorg -o orderer0-service:7050 --tls --cafile /etc/hyperledger/orderers/msp/tlscacerts/ca-root-7054.pem --channelID o-testing --name o-test7 --version 1 --init-required --sequence 1 --waitForEvent --signature-policy "OR ('org2.peer')" --package-id o-test7:757e5f9ddab38a34b8086649fce8a7de4be1567f2cb3249cbecad1c54f80e96d
 
peer lifecycle chaincode approveformyorg -o orderer0-service:7050 --tls --cafile /etc/hyperledger/orderers/msp/tlscacerts/ca-root-7054.pem --channelID o-testing --name o-test7 --version 1 --sequence 1 --waitForEvent --signature-policy "OR ('org2.peer')" --package-id o-test7:757e5f9ddab38a34b8086649fce8a7de4be1567f2cb3249cbecad1c54f80e96d
 
peer lifecycle chaincode checkcommitreadiness --channelID o-testing --name o-test7 --version 1 --sequence 1 --signature-policy "OR ('org2.peer')" --output json
 
{
"approvals": {
"org1": false,
"org2": true
}
}
peer lifecycle chaincode commit -o orderer0-service:7050 --tls --cafile /etc/hyperledger/orderers/msp/tlscacerts/ca-root-7054.pem --channelID o-testing --name o-test7 --version 1 --sequence 1 --init-required --signature-policy "OR ('org2.peer')" --peerAddresses peer0-org2-service:9051 --tlsRootCertFiles /etc/hyperledger/fabric/peerOrganizations/org2/peers/org2-peer0.default.svc.cluster.local/tls/ca.crt

Error: proposal failed with status: 500 - failed to invoke backing implementation of 'CommitChaincodeDefinition': chaincode definition not agreed to by this org (org2)

Any idea what I'm doing wrong?

Thanks
 

Join fabric@lists.hyperledger.org to automatically receive all group messages.