Hyperledger fabric on AWS, peers get crash after anchor peer update - hyperledger-fabric

I have deployed hyperledger fabric on aws ec2 instances.
peer0.sales.billerxchange.com (ec2 instance 1)
peer1.sales.billerxchange.com (ec2 instance 2)
peer0.employee.billerxchange.com (ec2 instance 3)
peer1.employee.billerxchange.com (ec2 instance 4)
ca.sales.billerxchange.com (ec2 instance 5)
ca.employee.billerxchange.com (ec2 instance 6)
orderer.billerxchange.com (ec2 instance 7)
all peers,ca and orderer are deployed on seperate instances and managed by docker swarm and deployed on docker overlay network.
i'm able join channel but when i try updating anchor peer in channel
peer channel update -c settlement -o orderer.billerxchange.com:7050 -f billerxchangepeer.tx
i updated peer0 as anchor peer peer0 will get update and all the other peers in the network will crash. only peer0 remains up rest all peer containers are stopped or exited. I've attached container logs please check.
2018-09-28 20:14:58.041 UTC [gossip/gossip] learnAnchorPeers -> INFO 032 Learning about the configured anchor peers of BillerXchange for channel settlement : [{peer0.sales.billerxchange.com 7051}]
2018-09-28 20:14:58.042 UTC [committer/txvalidator] Validate -> INFO 033 [settlement] Validated block [1] in 5ms
2018-09-28 20:14:58.046 UTC [gossip/state] commitBlock -> ERRO 034 Got error while committing(unexpected Previous block hash. Expected PreviousHash = [20c677285adc8bb6ecaa08d07f4b56038f1eb646a1e2c46c4915716772ac622b], PreviousHash referred in the latest block= [4abc11f19eed89a96d1fd6280512cea1504c1ff202e4f0d0cc5ad1945648343a]
github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage.(*blockfileMgr).addBlock
/opt/gopath/src/github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage/blockfile_mgr.go:254
github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage.(*fsBlockStore).AddBlock
/opt/gopath/src/github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage/fs_blockstore.go:43
github.com/hyperledger/fabric/core/ledger/ledgerstorage.(*Store).CommitWithPvtData
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgerstorage/store.go:124
github.com/hyperledger/fabric/core/ledger/kvledger.(*kvLedger).CommitWithPvtData
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/kvledger/kv_ledger.go:271
github.com/hyperledger/fabric/core/ledger/ledgermgmt.(*closableLedger).CommitWithPvtData
<autogenerated>:1
github.com/hyperledger/fabric/core/committer.(*LedgerCommitter).CommitWithPvtData
/opt/gopath/src/github.com/hyperledger/fabric/core/committer/committer_impl.go:93
github.com/hyperledger/fabric/gossip/privdata.(*coordinator).StoreBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/privdata/coordinator.go:229
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).commitBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:771
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:558
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
commit failed
github.com/hyperledger/fabric/gossip/privdata.(*coordinator).StoreBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/privdata/coordinator.go:231
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).commitBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:771
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:558
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).commitBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:772
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:558
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361)
2018-09-28 20:14:58.046 UTC [gossip/state] deliverPayloads -> PANI 035 Cannot commit block to the ledger due to unexpected Previous block hash. Expected PreviousHash = [20c677285adc8bb6ecaa08d07f4b56038f1eb646a1e2c46c4915716772ac622b], PreviousHash referred in the latest block= [4abc11f19eed89a96d1fd6280512cea1504c1ff202e4f0d0cc5ad1945648343a]
github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage.(*blockfileMgr).addBlock
/opt/gopath/src/github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage/blockfile_mgr.go:254
github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage.(*fsBlockStore).AddBlock
/opt/gopath/src/github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage/fs_blockstore.go:43
github.com/hyperledger/fabric/core/ledger/ledgerstorage.(*Store).CommitWithPvtData
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgerstorage/store.go:124
github.com/hyperledger/fabric/core/ledger/kvledger.(*kvLedger).CommitWithPvtData
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/kvledger/kv_ledger.go:271
github.com/hyperledger/fabric/core/ledger/ledgermgmt.(*closableLedger).CommitWithPvtData
<autogenerated>:1
github.com/hyperledger/fabric/core/committer.(*LedgerCommitter).CommitWithPvtData
/opt/gopath/src/github.com/hyperledger/fabric/core/committer/committer_impl.go:93
github.com/hyperledger/fabric/gossip/privdata.(*coordinator).StoreBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/privdata/coordinator.go:229
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).commitBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:771
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:558
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
commit failed
github.com/hyperledger/fabric/gossip/privdata.(*coordinator).StoreBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/privdata/coordinator.go:231
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).commitBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:771
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:558
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:563
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
panic: Cannot commit block to the ledger due to unexpected Previous block hash. Expected PreviousHash = [20c677285adc8bb6ecaa08d07f4b56038f1eb646a1e2c46c4915716772ac622b], PreviousHash referred in the latest block= [4abc11f19eed89a96d1fd6280512cea1504c1ff202e4f0d0cc5ad1945648343a]
github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage.(*blockfileMgr).addBlock
/opt/gopath/src/github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage/blockfile_mgr.go:254
github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage.(*fsBlockStore).AddBlock
/opt/gopath/src/github.com/hyperledger/fabric/common/ledger/blkstorage/fsblkstorage/fs_blockstore.go:43
github.com/hyperledger/fabric/core/ledger/ledgerstorage.(*Store).CommitWithPvtData
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgerstorage/store.go:124
github.com/hyperledger/fabric/core/ledger/kvledger.(*kvLedger).CommitWithPvtData
/opt/gopath/src/github.com/hyperledger/fabric/core/ledger/kvledger/kv_ledger.go:271
github.com/hyperledger/fabric/core/ledger/ledgermgmt.(*closableLedger).CommitWithPvtData
<autogenerated>:1
github.com/hyperledger/fabric/core/committer.(*LedgerCommitter).CommitWithPvtData
/opt/gopath/src/github.com/hyperledger/fabric/core/committer/committer_impl.go:93
github.com/hyperledger/fabric/gossip/privdata.(*coordinator).StoreBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/privdata/coordinator.go:229
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).commitBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:771
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:558
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
commit failed
github.com/hyperledger/fabric/gossip/privdata.(*coordinator).StoreBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/privdata/coordinator.go:231
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).commitBlock
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:771
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:558
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:563
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
goroutine 696 [running]:
github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc4202d00b0, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:229 +0x4f4
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc42000e4d8, 0x4, 0x1113a7d, 0x2c, 0xc422400dd0, 0x1, 0x1, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0xf6
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(0xc42000e4d8, 0x1113a7d, 0x2c, 0xc422400dd0, 0x1, 0x1)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159 +0x79
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panicf(0xc42000e4e0, 0x1113a7d, 0x2c, 0xc422400dd0, 0x1, 0x1)
/opt/gopath/src/github.com/hyperledger/fabric/common/flogging/zap.go:74 +0x60
github.com/hyperledger/fabric/gossip/state.(*GossipStateProviderImpl).deliverPayloads(0xc420173980)
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:563 +0x4af
created by github.com/hyperledger/fabric/gossip/state.NewGossipStateProvider
/opt/gopath/src/github.com/hyperledger/fabric/gossip/state/state.go:239 +0x699

Related

Hyperledger fabric peers consistently logging peer changed its PKI-ID logs

I have hyperledger fabric peers running on version 2.3.2 and the peer's certificates are renewed. The peers continuously logging with message peer2.xorg:7051 changed its PKI-ID from xxxxxx to xxxxxxx and then purging xxxxxxxx from membership
Does anyone knows the reason for these continuos logs?
Below are the complete logs:
2022-06-14 08:47:42.647 UTC [comm.grpc.server] 1 -> INFO 10d08 streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.peer_address=10.20.30.140:38550 grpc.peer_subject="CN=peer2.org1.com,OU=peer,O=Hyperledger,ST=North Carolina,C=US" grpc.code=OK grpc.call_duration=24.617863135s
2022-06-14 08:47:42.647 UTC [gossip.discovery] purge -> INFO 10d09 Purging e3c96c537b91675f3a6428a509a287addb65bddeeacb4b5d000b6e4ef567b013 from membership
2022-06-14 08:47:42.647 UTC [gossip.comm] createConnection -> INFO 10d0a Peer peer2.org1.com:7051 changed its PKI-ID from 1c56c0d7a0397dd9c756205197067ef26bef156cdf5ee27af16728a62123fb76 to 9994c9e8d63ae1f6564d1713f9a5393c458a78dfdb915ea2a4a4f6efb6d26dae
2022-06-14 08:47:42.647 UTC [gossip.discovery] purge -> INFO 10d0b Purging 1c56c0d7a0397dd9c756205197067ef26bef156cdf5ee27af16728a62123fb76 from membership
2022-06-14 08:47:42.648 UTC [gossip.comm] createConnection -> INFO 10d0c Peer peer2.org1.com:7051 changed its PKI-ID from da99b167b6c3a7b8289dd943568a382ac0f27d2d0ffcee53725f4fd18a10be9c to 9994c9e8d63ae1f6564d1713f9a5393c458a78dfdb915ea2a4a4f6efb6d26dae
2022-06-14 08:47:42.648 UTC [gossip.discovery] purge -> INFO 10d0d Purging da99b167b6c3a7b8289dd943568a382ac0f27d2d0ffcee53725f4fd18a10be9c from membership
2022-06-14 08:47:42.649 UTC [gossip.comm] createConnection -> INFO 10d0e Peer peer2.org1.com:7051 changed its PKI-ID from 87b299aa1d0a71002dbbac8b0b1bf049a6bd1aa58e669d31f0355587af15a8e9 to 9994c9e8d63ae1f6564d1713f9a5393c458a78dfdb915ea2a4a4f6efb6d26dae
2022-06-14 08:47:42.649 UTC [gossip.comm] func1 -> WARN 10d0f peer2.org1.com:7051, PKIid:87b299aa1d0a71002dbbac8b0b1bf049a6bd1aa58e669d31f0355587af15a8e9 isn't responsive: EOF
2022-06-14 08:47:42.649 UTC [gossip.discovery] purge -> INFO 10d10 Purging 87b299aa1d0a71002dbbac8b0b1bf049a6bd1aa58e669d31f0355587af15a8e9 from membership
2022-06-14 08:47:42.657 UTC [comm.grpc.server] 1 -> INFO 10d11 streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.peer_address=10.20.30.140:38546 grpc.peer_subject="CN=peer2.org1-shared.com,OU=peer,O=Hyperledger,ST=North Carolina,C=US" error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=24.712078411s
2022-06-14 08:47:42.659 UTC [gossip.comm] createConnection -> INFO 10d12 Peer peer2.org1-shared.com:7051 changed its PKI-ID from 5f03f639eb1bc912609b9208a2577cb8575c20a103d71155efe68487dedde236 to 99d3b90022039ca4d3311c96b1ccddc64e58d170f15e39cc18232e43be1c7b63
2022-06-14 08:47:42.659 UTC [gossip.discovery] purge -> INFO 10d13 Purging 5f03f639eb1bc912609b9208a2577cb8575c20a103d71155efe68487dedde236 from membership
2022-06-14 08:47:42.659 UTC [gossip.comm] createConnection -> INFO 10d14 Peer peer2.org1-shared.com:7051 changed its PKI-ID from d4b6c5c8659587ea44ac4ba1f813dc3e52194ca0c2e09b7ecfe1cbd47d1db7c4 to 99d3b90022039ca4d3311c96b1ccddc64e58d170f15e39cc18232e43be1c7b63
2022-06-14 08:47:42.660 UTC [gossip.comm] func1 -> WARN 10d15 peer2.org1-shared.com:7051, PKIid:d4b6c5c8659587ea44ac4ba1f813dc3e52194ca0c2e09b7ecfe1cbd47d1db7c4 isn't responsive: EOF
2022-06-14 08:47:42.660 UTC [gossip.discovery] purge -> INFO 10d16 Purging d4b6c5c8659587ea44ac4ba1f813dc3e52194ca0c2e09b7ecfe1cbd47d1db7c4 from membership
2022-06-14 08:47:42.675 UTC [comm.grpc.server] 1 -> INFO 10d17 unary call completed grpc.service=gossip.Gossip grpc.method=Ping grpc.request_deadline=2022-06-14T08:47:44.674Z grpc.peer_address=10.20.30.140:39676 grpc.peer_subject="CN=peer2.org1.com,OU=peer,O=Hyperledger,ST=North Carolina,C=US" grpc.code=OK grpc.call_duration=62.13µs
2022-06-14 08:47:42.710 UTC [endorser] callChaincode -> INFO 10d18 finished chaincode: assets duration: 37ms channel=assetschannel txID=58a9628e
2022-06-14 08:47:42.711 UTC [comm.grpc.server] 1 -> INFO 10d19 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=10.20.30.140:34366 grpc.peer_subject="CN=fabric-common" grpc.code=OK grpc.call_duration=39.919313ms
2022-06-14 08:47:43.034 UTC [endorser] callChaincode -> INFO 10d1a finished chaincode: assets duration: 35ms channel=assetschannel txID=010913f5
2022-06-14 08:47:43.035 UTC [comm.grpc.server] 1 -> INFO 10d1b unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=10.20.30.140:34366 grpc.peer_subject="CN=fabric-common" grpc.code=OK grpc.call_duration=38.114437ms
2022-06-14 08:47:43.153 UTC [endorser] callChaincode -> INFO 10d1c finished chaincode: assets duration: 49ms channel=assetschannel txID=49d4c88f
2022-06-14 08:47:43.153 UTC [comm.grpc.server] 1 -> INFO 10d1d unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=10.20.30.140:34366 grpc.peer_subject="CN=fabric-common" grpc.code=OK grpc.call_duration=52.987518ms
2022-06-14 08:47:43.279 UTC [endorser] callChaincode -> INFO 10d1e finished chaincode: assets duration: 85ms channel=assetschannel txID=69279b3e
It keeps on purging same PKI ID again and again
After talking to some experts, I got to know that peers might be fetching service discovery cache from other peers. This is why the errors were not being resolved even after restarting a peer.
After restarting all the peers at the same time, the issue was resolved.
Thanks to Yacov Manevich

Endorsement policy failure error is taking a long time in hyperledger fabric v2.2

I have discovery enabled and I am testing if a transaction will fail if the endorsing organizations set in the transaction do not match the organizations actually involved in the transaction.
I am attempting to create a private data collection with ORG1 and as part of the transaction I have used the following method to set the endorsing organizations:
transaction.setEndorsingOrganizations(...['ORG2']);
The test is failing but it is taking 60 seconds to do so.
The logs are as follows:
peer (org1) logs:
2021-01-25 13:31:50.876 UTC [gossip.privdata] StoreBlock -> INFO 055 [default] Received block [15] from buffer
2021-01-25 13:31:50.878 UTC [vscc] Validate -> ERRO 056 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for collection _implicit_org_1 chaincode test-chaincode in tx 15:0 failed: signature set did not satisfy policy
2021-01-25 13:31:50.878 UTC [committer.txvalidator] validateTx -> ERRO 057 Dispatch for transaction txId = 5c52e14fa24a6e90effbd9dffcbb3fbc6cac1091c1bf3b6512616084 returned error: validation of endorsement policy for collection _implicit_org_1 chaincode test-chaincode in tx 15:0 failed: signature set did not satisfy policy
2021-01-25 13:31:50.878 UTC [committer.txvalidator] Validate -> INFO 058 [default] Validated block [15] in 1ms
2021-01-25 13:31:50.878 UTC [gossip.privdata] fetchPrivateData -> WARN 059 Do not know any peer in the channel( default ) that matches the policies , aborting
2021-01-25 13:31:50.878 UTC [gossip.privdata] populateFromRemotePeers -> WARN 05a Failed fetching private data from remote peers for dig2src:[map[{5c52e14fa24a6e90effbd9dffcbb3fbc6cac1091c1bf3b6512616084 test-chaincode _implicit_org_1 15 0}:[]]], err: Empty membership channel=default
2021-01-25 13:31:51.879 UTC [gossip.privdata] fetchPrivateData -> WARN 05b Do not know any peer in the channel( default ) that matches the policies , aborting
2021-01-25 13:31:51.879 UTC [gossip.privdata] populateFromRemotePeers -> WARN 05c Failed fetching private data from remote peers for dig2src:[map[{5c52e14fa24a6e90effbd9dffcbb3fbc6cac1091c1bf3b6512616084 test-chaincode _implicit_org_1 15 0}:[]]], err: Empty membership channel=default
2021-01-25 13:31:52.880 UTC [gossip.privdata] fetchPrivateData -> WARN 05d Do not know any peer in the channel( default ) that matches the policies , aborting
2021-01-25 13:31:52.880 UTC [gossip.privdata] populateFromRemotePeers -> WARN 05e Failed fetching private data from remote peers for dig2src:[map[{5c52e14fa24a6e90effbd9dffcbb3fbc6cac1091c1bf3b6512616084 test-chaincode _implicit_org_1 15 0}:[]]], err: Empty membership channel=default
fetchPrivateData and populateFromRemotePeers warnings repeat over and over until
2021-01-25 13:32:50.873 UTC [gossip.privdata] RetrievePvtdata -> WARN 0d4 Could not fetch all 1 eligible collection private write sets for block [15] (0 from local cache, 0 from transient store, 0 from other peers). Will commit block with missing private write sets:[txID: 5c52e14fa24a6e90effbd9dffcbb3fbc6cac1091c1bf3b6512616084, seq: 0, namespace: test-chaincode, collection: _implicit_org_1, hash: c189e3f3e8546ecde9b98b3aae67885cb8effeac1d35371a512c47db6a84
] channel=default
2021-01-25 13:32:50.873 UTC [validation] preprocessProtoBlock -> WARN 0d5 Channel [default]: Block [15] Transaction index [0] TxId [5c52e14fa24a6e90effbd9dffcbb3fbc6cac1091c1bf3b6512616084] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE]
2021-01-25 13:32:50.903 UTC [kvledger] CommitLegacy -> INFO 0d6 [default] Committed block [15] with 1 transaction(s) in 29ms (state_validation=0ms block_and_pvtdata_commit=11ms state_commit=16ms) commitHash=[bcfc168b343de9297a2cd4d9f202840dbde2478ab898998915b2c589]
2021-01-25 13:33:00.433 UTC [gossip.privdata] fetchPrivateData -> WARN 0d7 Do not know any peer in the channel( default ) that matches the policies , aborting
2021-01-25 13:33:00.433 UTC [gossip.privdata] reconcile -> ERRO 0d8 reconciliation error when trying to fetch missing items from different peers: Empty membership
2021-01-25 13:33:00.434 UTC [gossip.privdata] run -> ERRO 0d9 Failed to reconcile missing private info, error: Empty membership
The problem isn't the result, it's the time it takes to return the error. Anyone know what could be causing this and is it expected behaviour to take this long? In the peer logs it looks like the validation of the endorsement policy fails right at the beginning, but then it continues to try and fetch the private data anyway.
Check the core.yaml. The usual default setting is
pvtData:
pullRetryThreshold: 60s
That looks like the variable that might control that.

Panic when querying the chaincode to fabric-sdk-go

I'm trying to figure out how fabric-sdk-go works.
I created a connection with hyperledger, installed chaincode, but when I try to execute the request for some reason I get an error.
My function:
response, err := setup.client.Query(channel.Request{ChaincodeID: setup.ChainCodeID, Fcn: "invoke", Args: [][]byte{[]byte("query"), []byte("hello")}})
And the output log:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x9384f0]
goroutine 1 [running]:
github.com/hyperledger/fabric-sdk-go/pkg/client/channel.(*Client).Query(0x0, 0xce8db5, 0x5, 0xce9c7d, 0x6, 0xc0001b1bd0, 0x3, 0x3, 0x0, 0x0, ...)
/home/batazor/.gvm/pkgsets/go1.12/global/pkg/mod/github.com/hyperledger/fabric-sdk-go#v1.0.0-alpha5/pkg/client/channel/chclient.go:97 +0xc0
main.(*FabricSetup).QueryHello(0xc000171eb0, 0x0, 0x0, 0x28, 0xc0001b0460)
/home/batazor/.gvm/pkgsets/go1.12/global/src/github.com/batazor/hyperledger-fabric/cmd/hyperledger-fabric/example.go:10 +0x217
main.main()
/home/batazor/.gvm/pkgsets/go1.12/global/src/github.com/batazor/hyperledger-fabric/cmd/hyperledger-fabric/main.go:43 +0x143
P.S. My chaincode -> https://github.com/batazor/hyperledger-fabric/blob/master/chaincode/hello/go/hello.go
I skipped the channel connection setup step
https://github.com/chainHero/heroes-service/blob/master/blockchain/setup.go#L93-L136

panic: runtime error: index out of range When starting the orderer with genesis.block

I'm getting an index out of range when I try to start the orderer. I happens after does the config values of the orderer:
Operations.TLS.Enabled = false
Operations.TLS.PrivateKey = ""
Operations.TLS.Certificate = ""
Operations.TLS.RootCAs = []
Operations.TLS.ClientAuthRequired = false
Operations.TLS.ClientRootCAs = []
Metrics.Provider = "disabled"
Metrics.Statsd.Network = "udp"
Metrics.Statsd.Address = "127.0.0.1:8125"
Metrics.Statsd.WriteInterval = 30s
Metrics.Statsd.Prefix = ""
panic: runtime error: index out of range
goroutine 1 [running]:
github.com/hyperledger/fabric/msp.(*bccspmsp).sanitizeCert(0xc0002079e0, 0xc000111700, 0x26, 0xc000531108, 0x1)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:691 +0x207
github.com/hyperledger/fabric/msp.newIdentity(0xc000111700, 0x1152560, 0xc00000ef98, 0xc0002079e0, 0xc00035e148, 0x1152560, 0xc00000ef98, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/msp/identities.go:47 +0x70
github.com/hyperledger/fabric/msp.(*bccspmsp).getIdentityFromConf(0xc0002079e0, 0xc000354000, 0x3cd, 0x400, 0x1, 0x1, 0x0, 0x7c8088, 0xc0000ac7e0, 0xff)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:161 +0x102
github.com/hyperledger/fabric/msp.(*bccspmsp).setupCAs(0xc0002079e0, 0xc00014b1d0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:134 +0x65d
github.com/hyperledger/fabric/msp.(*bccspmsp).preSetupV1(0xc0002079e0, 0xc00014b1d0, 0xc0005312f0, 0x7d23a0)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:393 +0x64
github.com/hyperledger/fabric/msp.(*bccspmsp).setupV1(0xc0002079e0, 0xc00014b1d0, 0x1, 0x1)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:373 +0x39
github.com/hyperledger/fabric/msp.(*bccspmsp).setupV1-fm(0xc00014b1d0, 0x1026ec0, 0x1a)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:112 +0x34
github.com/hyperledger/fabric/msp.(*bccspmsp).Setup(0xc0002079e0, 0xc00034a300, 0x0, 0xc00034a3c0)
/opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:225 +0x14d
github.com/hyperledger/fabric/msp/cache.(*cachedMSP).Setup(0xc0004f2f90, 0xc00034a300, 0x1159600, 0xc0004f2f90)
/opt/gopath/src/github.com/hyperledger/fabric/msp/cache/cache.go:88 +0x4b
github.com/hyperledger/fabric/common/channelconfig.(*MSPConfigHandler).ProposeMSP(0xc000508550, 0xc00034a300, 0x19, 0xc0005314c8, 0x1, 0x1)
/opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/msp.go:68 +0xc0
github.com/hyperledger/fabric/common/channelconfig.(*OrganizationConfig).validateMSP(0xc00034a2c0, 0x0, 0xffffffffffffffff)
/opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/organization.go:80 +0xc0
github.com/hyperledger/fabric/common/channelconfig.(*OrganizationConfig).Validate(0xc00034a2c0, 0xc000531550, 0x1)
/opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/organization.go:73 +0x2b
github.com/hyperledger/fabric/common/channelconfig.NewOrganizationConfig(0xc0004fcf48, 0x6, 0xc0004f55e0, 0xc000508550, 0x0, 0x0, 0x8)
/opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/organization.go:54 +0x10e
github.com/hyperledger/fabric/common/channelconfig.NewConsortiumConfig(0xc0004f5590, 0xc000508550, 0xc0005316c0, 0xf07a40, 0xc0004f2e70)
/opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/consortium.go:44 +0x196
github.com/hyperledger/fabric/common/channelconfig.NewConsortiumsConfig(0xc0004f5540, 0xc000508550, 0xc000531808, 0x4, 0x1b8ac00)
/opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/consortiums.go:31 +0x103
github.com/hyperledger/fabric/common/channelconfig.NewChannelConfig(0xc0004f5040, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/channel.go:104 +0x392
github.com/hyperledger/fabric/common/channelconfig.NewBundle(0xc0004fd2e0, 0xc, 0xc0004f2780, 0xc000536510, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/bundle.go:196 +0x6b
github.com/hyperledger/fabric/common/channelconfig.NewBundleFromEnvelope(0xc0004f4a50, 0x1444, 0x1500, 0x114b520)
/opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/bundle.go:187 +0x14d
github.com/hyperledger/fabric/orderer/common/server.ValidateBootstrapBlock(0xc000079940, 0xc000079940, 0xc000531be8)
/opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/onboarding.go:349 +0xf7
github.com/hyperledger/fabric/orderer/common/server.Start(0x1013e09, 0x5, 0xc0004c8900)
/opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:97 +0x59
github.com/hyperledger/fabric/orderer/common/server.Main()
/opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:91 +0x1ce
main.main()
/opt/gopath/src/github.com/hyperledger/fabric/orderer/main.go:15 +0x20
I have gone to the place were it does and it is on this function.
func (msp *bccspmsp) sanitizeCert(cert *x509.Certificate) (*x509.Certificate, error) {
if isECDSASignedCert(cert) {
// Lookup for a parent certificate to perform the sanitization
var parentCert *x509.Certificate
chain, err := msp.getUniqueValidationChain(cert, msp.getValidityOptsForCert(cert))
if err != nil {
return nil, err
}
// at this point, cert might be a root CA certificate
// or an intermediate CA certificate
if cert.IsCA && len(chain) == 1 {
// cert is a root CA certificate
parentCert = cert
} else {
parentCert = chain[1]
}
// Sanitize
cert, err = sanitizeECDSASignedCert(cert, parentCert)
if err != nil {
return nil, err
}
}
return cert, nil
}
Its on
parentCert = chain[1]
I know that is a problem on my genesis block on my configtx file, and following the code of the error I guess that is looking at the ca files.
So guessing that I have looked at the files and this is the following structure that I use:
msp
admincerts (the certificate of the admin)
tlscacerts (the tls cert of the tls-ca)
cacerts (the tls cert of the ca cert)
And everything is correct ad far as I know.
EDIT 1:
If put the logs on debug mode it gives the same error information, but is happening after the following:
2019-07-11 08:45:00.119 UTC [common.channelconfig] NewStandardValues -> DEBU 0ed Initializing protos for *channelconfig.OrdererProtos
2019-07-11 08:45:00.119 UTC [common.channelconfig] initializeProtosStruct -> DEBU 0ee Processing field: ConsensusType
2019-07-11 08:45:00.119 UTC [common.channelconfig] initializeProtosStruct -> DEBU 0ef Processing field: BatchSize
2019-07-11 08:45:00.119 UTC [common.channelconfig] initializeProtosStruct -> DEBU 0f0 Processing field: BatchTimeout
2019-07-11 08:45:00.119 UTC [common.channelconfig] initializeProtosStruct -> DEBU 0f1 Processing field: KafkaBrokers
2019-07-11 08:45:00.120 UTC [common.channelconfig] initializeProtosStruct -> DEBU 0f2 Processing field: ChannelRestrictions
2019-07-11 08:45:00.120 UTC [common.channelconfig] initializeProtosStruct -> DEBU 0f3 Processing field: Capabilities
2019-07-11 08:45:00.120 UTC [common.channelconfig] NewStandardValues -> DEBU 0f4 Initializing protos for *channelconfig.OrganizationProtos
2019-07-11 08:45:00.120 UTC [common.channelconfig] initializeProtosStruct -> DEBU 0f5 Processing field: MSP
2019-07-11 08:45:00.120 UTC [common.channelconfig] validateMSP -> DEBU 0f6 Setting up MSP for org OrgMSP
2019-07-11 08:45:00.120 UTC [msp] newBccspMsp -> DEBU 0f7 Creating BCCSP-based MSP instance
2019-07-11 08:45:00.120 UTC [msp] New -> DEBU 0f8 Creating Cache-MSP instance
2019-07-11 08:45:00.120 UTC [msp] Setup -> DEBU 0f9 Setting up MSP instance OrgMSP
2019-07-11 08:45:00.120 UTC [msp.identity] newIdentity -> DEBU 0fa Creating identity instance for cert
Looks like the contents of cacerts and tlscacerts are wrong.
cacerts should contain the CA root certificate which signed the admin certificate
tlscacerts should contain the CA root certificate used to sign TLS certificates.

Orderer capability V1_3 is required but not supported: But, I'm using 1.3.0 images

I set up channel that has following compatibility, (set in configtx.yaml)
Capabilities:
Channel: &ChannelCapabilities
V1_3: true
Orderer: &OrdererCapabilities
V1_3: true
Application: &ApplicationCapabilities
V1_3: true
and started the orderer with well generated genesis block file. I also specified orderer image version:
image: hyperledger/fabric-orderer:1.3.0
and it gives error
2018-11-28 01:36:41.191 UTC [orderer/commmon/multichannel] checkResourcesOrPanic -> PANI 005 [channel testchainid] config requires unsupported orderer capabilities: Orderer capability V1_3 is required but not supported: Orderer capability V
1_3 is required but not supported
panic: [channel testchainid] config requires unsupported orderer capabilities: Orderer capability V1_3 is required but not supported: Orderer capability V1_3 is required but not supported
goroutine 1 [running]:
github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc4201d1600, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:229 +0x4f4
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc42016a270, 0x4, 0xdfecd3, 0xf, 0xc4203a1888, 0x2, 0x2, 0x0, 0x0, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0xf6
github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(0xc42016a270, 0xdfecd3, 0xf, 0xc4203a1888, 0x2, 0x2)
/opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159 +0x79
github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panicf(0xc42016a278, 0xdfecd3, 0xf, 0xc4203a1888, 0x2, 0x2)
/opt/gopath/src/github.com/hyperledger/fabric/common/flogging/zap.go:74 +0x60
github.com/hyperledger/fabric/orderer/common/multichannel.checkResourcesOrPanic(0xeabe80, 0xc4202c8ac0)
/opt/gopath/src/github.com/hyperledger/fabric/orderer/common/multichannel/registrar.go:58 +0x14d
github.com/hyperledger/fabric/orderer/common/multichannel.(*Registrar).newLedgerResources(0xc42027c480, 0xc42016cc80, 0xc42016cc80)
/opt/gopath/src/github.com/hyperledger/fabric/orderer/common/multichannel/registrar.go:259 +0x304
github.com/hyperledger/fabric/orderer/common/multichannel.NewRegistrar(0xea36a0, 0xc42011c2e0, 0xc42015b710, 0xe9b060, 0x15a78b0, 0xc42016a318, 0x1, 0x1, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/orderer/common/multichannel/registrar.go:142 +0x312
github.com/hyperledger/fabric/orderer/common/server.initializeMultichannelRegistrar(0xc4201e0580, 0xe9b060, 0x15a78b0, 0xc42016a318, 0x1, 0x1, 0x0)
/opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:258 +0x250
github.com/hyperledger/fabric/orderer/common/server.Start(0xdf7a5a, 0x5, 0xc4201e0580)
/opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:96 +0x226
github.com/hyperledger/fabric/orderer/common/server.Main()
/opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:75 +0x1d6
main.main()
/opt/gopath/src/github.com/hyperledger/fabric/orderer/main.go:15 +0x20
What should I do to fix this error? What I want to achieve is setting up a network that's only compatible with Hyperledger Fabric 1.3 nodes.
I tried with orderer capability V1_2 and it gives same (except version string) error. Does this mean capability version independent to Hyperledger Fabric version?
In HLF 1.2 & 1.3, the orderer still only supports V1_1 capabilities. So, your configtx.yaml should be:
Capabilities:
Channel: &ChannelCapabilities
V1_3: true
Orderer: &OrdererCapabilities
V1_1: true
Application: &ApplicationCapabilities
V1_3: true

Resources