Re: chaincode 2.0 problems
Nikhil Gupta
Hi, Your logs say zero of the endorsement sub-policies were defined. Did you define the endorsement sub policies in configtx.yaml for your organizations? -----fabric@... wrote: ----- To: David Enyeart <enyeart@...> From: "indirajith" Sent by: fabric@... Date: 02/17/2020 09:28AM Cc: fabric <fabric@...> Subject: [EXTERNAL] Re: [Hyperledger Fabric] chaincode 2.0 problems Thank you David Enyeart, As you have suggested, the problem was with credentials and I have fixed them. Now the problem is during the commit stage. Even though both Orgs approved the CC package and they both endorse the commit, it fails with ' (ENDORSEMENT_POLICY_FAILURE) '. The reason behind this is statebased validator fails. I don't know how to meet this state-based endorsement policy. The peer logs are as follows: PEER1_ORG2 2020-02-17 13:40:32.589 UTC [lifecycle] CheckCommitReadiness -> INFO 0c6 Successfully checked commit readiness of chaincode name 'cctest' on channel 'twoorgschannel' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: (<nil>)} 2020-02-17 13:40:32.595 UTC [lifecycle] CommitChaincodeDefinition -> INFO 0c7 Successfully endorsed commit for chaincode name 'cctest' on channel 'twoorgschannel' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: (<nil>)} 2020-02-17 13:40:32.595 UTC [endorser] callChaincode -> INFO 0c8 finished chaincode: _lifecycle duration: 24ms channel=twoorgschannel txID=9cae9eca 2020-02-17 13:40:32.596 UTC [comm.grpc.server] 1 -> INFO 0c9 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=192.168.176.103:37306 grpc.code=OK grpc.call_duration=26.626315ms 2020-02-17 13:40:34.650 UTC [gossip.privdata] StoreBlock -> INFO 0ca [twoorgschannel] Received block [15] from buffer 2020-02-17 13:40:34.651 UTC [vscc] Validate -> ERRO 0cb VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for chaincode _lifecycle in tx 15:0 failed: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 2 of the 'Endorsement' sub-policies to be satisfied 2020-02-17 13:40:34.651 UTC [committer.txvalidator] validateTx -> ERRO 0cc Dispatch for transaction txId = 9cae9eca8ff21e30bbf8e9be2afeef63c88a76178b7e9da077b4012b322c6521 returned error: validation of endorsement policy for chaincode _lifecycle in tx 15:0 failed: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 2 of the 'Endorsement' sub-policies to be satisfied 2020-02-17 13:40:34.651 UTC [committer.txvalidator] Validate -> INFO 0cd [twoorgschannel] Validated block [15] in 1ms 2020-02-17 13:40:34.652 UTC [gossip.privdata] prepareBlockPvtdata -> INFO 0ce Successfully fetched all eligible collection private write sets for block [15] channel=twoorgschannel 2020-02-17 13:40:34.652 UTC [valimpl] preprocessProtoBlock -> WARN 0cf Channel [twoorgschannel]: Block [15] Transaction index [0] TxId [9cae9eca8ff21e30bbf8e9be2afeef63c88a76178b7e9da077b4012b322c6521] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE] 2020-02-17 13:40:34.713 UTC [kvledger] CommitLegacy -> INFO 0d0 [twoorgschannel] Committed block [15] with 1 transaction(s) in 61ms (state_validation=0ms block_and_pvtdata_commit=43ms state_commit=15ms) commitHash=[9d588ecb38fbb6e9b566d58287c642ca7cde5c0fa7d4e354027724eceb7248e9] 2020-02-17 13:40:34.724 UTC [comm.grpc.server] 1 -> INFO 0d1 streaming call completed grpc.service=protos.Deliver grpc.method=DeliverFiltered grpc.request_deadline=2020-02-17T13:41:02.599Z grpc.peer_address=192.168.176.103:37308 error="context finished before block retrieved: context canceled" grpc.code=Unknown grpc.call_duration=2.125516881s PEER2_ORG1 2020-02-17 13:40:32.563 UTC [lifecycle] CheckCommitReadiness -> INFO 09d Successfully checked commit readiness of chaincode name 'cctest' on channel 'twoorgschannel' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: (<nil>)} 2020-02-17 13:40:32.566 UTC [lifecycle] CommitChaincodeDefinition -> INFO 09e Successfully endorsed commit for chaincode name 'cctest' on channel 'twoorgschannel' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: (<nil>)} 2020-02-17 13:40:32.566 UTC [endorser] callChaincode -> INFO 09f finished chaincode: _lifecycle duration: 80ms channel=twoorgschannel txID=9cae9eca 2020-02-17 13:40:32.567 UTC [comm.grpc.server] 1 -> INFO 0a0 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=192.168.176.103:56972 grpc.code=OK grpc.call_duration=82.034915ms 2020-02-17 13:40:34.657 UTC [gossip.privdata] StoreBlock -> INFO 0a1 [twoorgschannel] Received block [15] from buffer 2020-02-17 13:40:34.658 UTC [vscc] Validate -> ERRO 0a2 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for chaincode _lifecycle in tx 15:0 failed: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 2 of the 'Endorsement' sub-policies to be satisfied 2020-02-17 13:40:34.659 UTC [committer.txvalidator] validateTx -> ERRO 0a3 Dispatch for transaction txId = 9cae9eca8ff21e30bbf8e9be2afeef63c88a76178b7e9da077b4012b322c6521 returned error: validation of endorsement policy for chaincode _lifecycle in tx 15:0 failed: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 2 of the 'Endorsement' sub-policies to be satisfied 2020-02-17 13:40:34.659 UTC [committer.txvalidator] Validate -> INFO 0a4 [twoorgschannel] Validated block [15] in 1ms 2020-02-17 13:40:34.659 UTC [gossip.privdata] prepareBlockPvtdata -> INFO 0a5 Successfully fetched all eligible collection private write sets for block [15] channel=twoorgschannel 2020-02-17 13:40:34.659 UTC [valimpl] preprocessProtoBlock -> WARN 0a6 Channel [twoorgschannel]: Block [15] Transaction index [0] TxId [9cae9eca8ff21e30bbf8e9be2afeef63c88a76178b7e9da077b4012b322c6521] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE] 2020-02-17 13:40:34.720 UTC [kvledger] CommitLegacy -> INFO 0a7 [twoorgschannel] Committed block [15] with 1 transaction(s) in 60ms (state_validation=0ms block_and_pvtdata_commit=41ms state_commit=17ms) commitHash=[9d588ecb38fbb6e9b566d58287c642ca7cde5c0fa7d4e354027724eceb7248e9] 2020-02-17 13:40:34.724 UTC [comm.grpc.server] 1 -> INFO 0a8 streaming call completed grpc.service=protos.Deliver grpc.method=DeliverFiltered grpc.request_deadline=2020-02-17T13:41:02.598Z grpc.peer_address=192.168.176.103:56974 error="context finished before block retrieved: context canceled" grpc.code=Unknown grpc.call_duration=2.125825689s Approvals: {
"approvals": {
"org1MSP": true,
"org2MSP": true }
} Thank you. Indirajith
On Thu, 6 Feb 2020 at 14:27, David Enyeart <enyeart@...> wrote:
|
|