6

I'm trying to make the system run properly, by following after this tutorial -

https://hyperledger-fabric.readthedocs.io/en/release-2.0/build_network.html

When in my case the Hyperledger Fabric components run on Kubernetes and I'm running all the commands from within the pod which contain the fabric-tool:2.0.

As I understand, I succeeded in running all the pods and services properly. I succeeded to create the genesis.block, create the network, join the peers to the network, package and install the chain code on each of them and receive the mycc key as in the tutorial.

The problem starts when I try to approve the chaincode -

peer lifecycle chaincode approveformyorg --channelID $CHANNEL_NAME --name mycc --version 1.0 --init-required --package-id $CC_PACKAGE_ID --sequence 1

When I run it I get the following message -

2020-04-15 18:39:04.743 IDT [cli.lifecycle.chaincode] setOrdererClient -> INFO 001 Retrieved channel (orderer-system-channel) orderer endpoint: orderer:31010
Error: timed out waiting for txid on all peers

And also some errors in the Orderer logs - (implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied)

2020-04-15 18:41:24.595 IDT [comm.grpc.server] 1 -> INFO 2bd streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.17.0.14:36484 grpc.code=OK grpc.call_duration=2.180654ms 2020-04-15 18:41:34.574 IDT [common.deliver] deliverBlocks -> WARN 2be [channel: orderer-system-channel] Client authorization revoked for deliver request from 172.17.0.15:42520: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied 2020-04-15 18:41:34.574 IDT [comm.grpc.server] 1 -> INFO 2bf streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.17.0.15:42520 grpc.code=OK grpc.call_duration=1.918542ms 2020-04-15 18:41:45.865 IDT [common.deliver] deliverBlocks -> WARN 2c0 [channel: orderer-system-channel] Client authorization revoked for deliver request from 172.17.0.16:36710: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied 2020-04-15 18:41:45.865 IDT [comm.grpc.server] 1 -> INFO 2c1 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.17.0.16:36710 grpc.code=OK grpc.call_duration=3.452952ms 2020-04-15 18:41:55.196 IDT [common.deliver] deliverBlocks -> WARN 2c2 [channel: orderer-system-channel] Client authorization revoked for deliver request from 172.17.0.17:53220: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied 2020-04-15 18:41:55.196 IDT [comm.grpc.server] 1 -> INFO 2c3 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.17.0.17:53220 grpc.code=OK grpc.call_duration=1.084932ms 2020-04-15 18:42:08.194 IDT [orderer.common.broadcast] Handle -> WARN 2c4 Error reading from 172.17.0.11:50106: rpc error: code = Canceled desc = context canceled 2020-04-15 18:42:08.194 IDT [comm.grpc.server] 1 -> INFO 2c5 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=172.17.0.11:50106 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=30.451678366s 2020-04-15 18:42:22.760 IDT [common.deliver] deliverBlocks -> WARN 2c6 [channel: orderer-system-channel] Client authorization revoked for deliver request from 172.17.0.18:43404: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied 2020-04-15 18:42:22.760 IDT [comm.grpc.server] 1 -> INFO 2c7 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.17.0.18:43404 grpc.code=OK grpc.call_duration=962.109µs 2020-04-15 18:42:33.165 IDT [common.deliver] deliverBlocks -> WARN 2c8 [channel: orderer-system-channel] Client authorization revoked for deliver request from 172.17.0.19:56570: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied

Org1Peer1 logs -

2020-04-18 14:01:44.999 IDT [peer] getLocalAddress -> INFO 003 Auto-detected peer address: 172.17.0.14:30110 2020-04-18 14:01:44.999 IDT [peer] getLocalAddress -> INFO 004 Auto-detect flag is set, returning 172.17.0.14:30110 2020-04-18 14:01:45.194 IDT [gossip.service] New -> INFO 005 Initialize gossip with endpoint org1peer1-svc:30110 2020-04-18 14:01:45.194 IDT [gossip.gossip] New -> INFO 006 Creating gossip service with self membership of Endpoint: org1peer1-svc:30110, InternalEndpoint: org1peer1-svc:30110, PKI-ID: 51b25e96fadae28a11006feffffc06ff47d1cb25bef7c82a04c36c4ddb20e9f9, Metadata: 2020-04-18 14:01:45.195 IDT [gossip.gossip] start -> INFO 007 Gossip instance org1peer1-svc:30110 started 2020-04-18 14:01:45.196 IDT [ledgermgmt] NewLedgerMgr -> INFO 008 Initializing LedgerMgr 2020-04-18 14:01:45.478 IDT [leveldbhelper] openDBAndCheckFormat -> INFO 009 DB is empty Setting db format as 2.0 2020-04-18 14:01:45.503 IDT [fsblkstorage] NewProvider -> INFO 00a Creating new file ledger directory at /var/hyperledger/production/ledgersData/chains/chains 2020-04-18 14:01:45.647 IDT [leveldbhelper] openDBAndCheckFormat -> INFO 00b DB is empty Setting db format as 2.0 2020-04-18 14:01:45.888 IDT [couchdb] handleRequest -> WARN 00c Retrying couchdb request in 125ms. Attempt:1 Error:Get http://localhost:5984/: dial tcp [::1]:5984: connect: cannot assign requested address 2020-04-18 14:01:46.017 IDT [couchdb] handleRequest -> WARN 00d Retrying couchdb request in 250ms. Attempt:2 Error:Get http://localhost:5984/: dial tcp [::1]:5984: connect: cannot assign requested address 2020-04-18 14:01:46.329 IDT [couchdb] handleRequest -> WARN 00e Retrying couchdb request in 500ms. Attempt:3 Error:Get http://localhost:5984/: dial tcp 127.0.0.1:5984: connect: connection refused 2020-04-18 14:01:46.830 IDT [couchdb] handleRequest -> WARN 00f Retrying couchdb request in 1s. Attempt:4 Error:Get http://localhost:5984/: dial tcp [::1]:5984: connect: cannot assign requested address 2020-04-18 14:01:47.952 IDT [couchdb] handleRequest -> WARN 010 Retrying couchdb request in 2s. Attempt:5 Error:Get http://localhost:5984/: dial tcp 127.0.0.1:5984: connect: connection refused 2020-04-18 14:01:49.954 IDT [couchdb] handleRequest -> WARN 011 Retrying couchdb request in 4s. Attempt:6 Error:Get http://localhost:5984/: dial tcp 127.0.0.1:5984: connect: connection refused 2020-04-18 14:01:53.955 IDT [couchdb] handleRequest -> WARN 012 Retrying couchdb request in 8s. Attempt:7 Error:Get http://localhost:5984/: dial tcp 127.0.0.1:5984: connect: connection refused 2020-04-18 14:02:01.956 IDT [couchdb] handleRequest -> WARN 013 Retrying couchdb request in 16s. Attempt:8 Error:Get http://localhost:5984/: dial tcp 127.0.0.1:5984: connect: connection refused 2020-04-18 14:02:23.678 IDT [couchdb] CreateDatabaseIfNotExist -> INFO 014 Created state database _users 2020-04-18 14:02:24.613 IDT [couchdb] CreateDatabaseIfNotExist -> INFO 015 Created state database _replicator 2020-04-18 14:02:26.355 IDT [couchdb] CreateDatabaseIfNotExist -> INFO 016 Created state database fabric__internal 2020-04-18 14:02:26.939 IDT [ledgermgmt] NewLedgerMgr -> INFO 017 Initialized LedgerMgr 2020-04-18 14:02:26.940 IDT [lifecycle] InitializeLocalChaincodes -> INFO 018 Initialized lifecycle cache with 0 already installed chaincodes 2020-04-18 14:02:26.940 IDT [nodeCmd] computeChaincodeEndpoint -> INFO 019 Entering computeChaincodeEndpoint with peerHostname: 172.17.0.14 2020-04-18 14:02:26.940 IDT [nodeCmd] computeChaincodeEndpoint -> INFO 01a Exit with ccEndpoint: 172.17.0.14:7052 2020-04-18 14:02:26.940 IDT [nodeCmd] createChaincodeServer -> WARN 01b peer.chaincodeListenAddress is not set, using 172.17.0.14:7052 2020-04-18 14:02:26.944 IDT [sccapi] DeploySysCC -> INFO 01c deploying system chaincode 'lscc' 2020-04-18 14:02:26.944 IDT [sccapi] DeploySysCC -> INFO 01d deploying system chaincode 'cscc' 2020-04-18 14:02:26.945 IDT [sccapi] DeploySysCC -> INFO 01e deploying system chaincode 'qscc' 2020-04-18 14:02:26.945 IDT [sccapi] DeploySysCC -> INFO 01f deploying system chaincode 'lifecycle' 2020-04-18 14:02:26.945 IDT [nodeCmd] serve -> INFO 020 Deployed system chaincodes 2020-04-18 14:02:26.945 IDT [discovery] NewService -> INFO 021 Created with config TLS: false, authCacheMaxSize: 1000, authCachePurgeRatio: 0.750000 2020-04-18 14:02:26.945 IDT [nodeCmd] registerDiscoveryService -> INFO 022 Discovery service activated 2020-04-18 14:02:26.945 IDT [nodeCmd] serve -> INFO 023 Starting peer with ID=[org1peer1-svc], network ID=[nid1], address=[172.17.0.14:30110] 2020-04-18 14:02:26.945 IDT [nodeCmd] serve -> INFO 024 Started peer with ID=[org1peer1-svc], network ID=[nid1], address=[172.17.0.14:30110] 2020-04-18 14:02:26.945 IDT [nodeCmd] func6 -> INFO 025 Starting profiling server with listenAddress = 0.0.0.0:6060 2020-04-18 14:02:26.945 IDT [kvledger] LoadPreResetHeight -> INFO 026 Loading prereset height from path [/var/hyperledger/production/ledgersData/chains] 2020-04-18 14:02:26.945 IDT [fsblkstorage] preResetHtFiles -> INFO 027 No active channels passed 2020-04-18 14:06:23.402 IDT [ledgermgmt] CreateLedger -> INFO 028 Creating ledger [orderer-system-channel] with genesis block 2020-04-18 14:06:23.450 IDT [fsblkstorage] newBlockfileMgr -> INFO 029 Getting block information from block storage 2020-04-18 14:06:24.348 IDT [couchdb] CreateDatabaseIfNotExist -> INFO 02a Created state database orderer-system-channel 2020-04-18 14:06:25.986 IDT [couchdb] CreateDatabaseIfNotExist -> INFO 02b Created state database orderer-system-channel__lifecycle 2020-04-18 14:06:27.177 IDT [kvledger] CommitLegacy -> INFO 02c [orderer-system-channel] Committed block [0] with 1 transaction(s) in 1153ms (state_validation=0ms block_and_pvtdata_commit=100ms state_commit=1026ms) commitHash=[] 2020-04-18 14:06:27.210 IDT [ledgermgmt] CreateLedger -> INFO 02d Created ledger [orderer-system-channel] with genesis block 2020-04-18 14:06:27.587 IDT [gossip.gossip] JoinChan -> INFO 02e Joining gossip network of channel orderer-system-channel with 3 organizations 2020-04-18 14:06:27.587 IDT [gossip.gossip] learnAnchorPeers -> INFO 02f No configured anchor peers of Org2MSP for channel orderer-system-channel to learn about 2020-04-18 14:06:27.587 IDT [gossip.gossip] learnAnchorPeers -> INFO 030 No configured anchor peers of Org3MSP for channel orderer-system-channel to learn about 2020-04-18 14:06:27.587 IDT [gossip.gossip] learnAnchorPeers -> INFO 031 No configured anchor peers of Org1MSP for channel orderer-system-channel to learn about 2020-04-18 14:06:27.590 IDT [gossip.state] NewGossipStateProvider -> INFO 032 Updating metadata information for channel orderer-system-channel, current ledger sequence is at = 0, next expected block is = 1 2020-04-18 14:06:27.590 IDT [endorser] callChaincode -> INFO 033 finished chaincode: cscc duration: 4192ms channel= txID=22d5a6a6 2020-04-18 14:06:27.590 IDT [comm.grpc.server] 1 -> INFO 034 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.17.0.11:60502 grpc.code=OK grpc.call_duration=4.200507752s 2020-04-18 14:06:33.591 IDT [gossip.election] beLeader -> INFO 035 51b25e96fadae28a11006feffffc06ff47d1cb25bef7c82a04c36c4ddb20e9f9 : Becoming a leader 2020-04-18 14:06:33.591 IDT [gossip.service] func1 -> INFO 036 Elected as a leader, starting delivery service for channel orderer-system-channel 2020-04-18 14:06:33.591 IDT [deliveryClient] StartDeliverForChannel -> INFO 037 This peer will retrieve blocks from ordering service and disseminate to other peers in the organization for channel orderer-system-channel 2020-04-18 14:06:33.596 IDT [peer.blocksprovider] func1 -> WARN 038 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:33.596 IDT [peer.blocksprovider] DeliverBlocks -> WARN 039 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:34.915 IDT [peer.blocksprovider] DeliverBlocks -> WARN 047 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:35.276 IDT [peer.blocksprovider] func1 -> WARN 048 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:35.276 IDT [peer.blocksprovider] DeliverBlocks -> WARN 049 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:35.708 IDT [peer.blocksprovider] func1 -> WARN 04a Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:35.708 IDT [peer.blocksprovider] DeliverBlocks -> WARN 04b Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:36.228 IDT [peer.blocksprovider] func1 -> WARN 04c Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:36.228 IDT [peer.blocksprovider] DeliverBlocks -> WARN 04d Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:36.881 IDT [peer.blocksprovider] func1 -> WARN 04e Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:36.882 IDT [peer.blocksprovider] DeliverBlocks -> WARN 04f Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:37.627 IDT [peer.blocksprovider] func1 -> WARN 050 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:37.627 IDT [peer.blocksprovider] DeliverBlocks -> WARN 051 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:44.281 IDT [peer.blocksprovider] func1 -> WARN 05a Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:44.281 IDT [peer.blocksprovider] DeliverBlocks -> WARN 05b Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:46.501 IDT [peer.blocksprovider] func1 -> WARN 05c Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:46.501 IDT [peer.blocksprovider] DeliverBlocks -> WARN 05d Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:56.200 IDT [peer.blocksprovider] func1 -> WARN 062 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:06:56.200 IDT [peer.blocksprovider] DeliverBlocks -> WARN 063 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:00.802 IDT [peer.blocksprovider] DeliverBlocks -> WARN 065 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:00.802 IDT [peer.blocksprovider] func1 -> WARN 064 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:06.324 IDT [peer.blocksprovider] func1 -> WARN 066 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:06.324 IDT [peer.blocksprovider] DeliverBlocks -> WARN 067 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:12.954 IDT [peer.blocksprovider] func1 -> WARN 068 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:12.954 IDT [peer.blocksprovider] DeliverBlocks -> WARN 069 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:20.906 IDT [peer.blocksprovider] func1 -> WARN 06a Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:20.906 IDT [peer.blocksprovider] DeliverBlocks -> WARN 06b Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:30.449 IDT [peer.blocksprovider] func1 -> WARN 06c Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:30.449 IDT [peer.blocksprovider] DeliverBlocks -> WARN 06d Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:41.899 IDT [peer.blocksprovider] func1 -> WARN 06e Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:41.899 IDT [peer.blocksprovider] DeliverBlocks -> WARN 06f Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:55.641 IDT [peer.blocksprovider] func1 -> WARN 070 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:07:55.641 IDT [peer.blocksprovider] DeliverBlocks -> WARN 071 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:08:12.129 IDT [peer.blocksprovider] func1 -> WARN 072 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:08:12.129 IDT [peer.blocksprovider] DeliverBlocks -> WARN 073 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:08:31.916 IDT [peer.blocksprovider] func1 -> WARN 074 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:08:31.916 IDT [peer.blocksprovider] DeliverBlocks -> WARN 075 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:08:55.657 IDT [peer.blocksprovider] func1 -> WARN 076 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:09:28.078 IDT [lifecycle] InstallChaincode -> INFO 07a Successfully installed chaincode with package ID 'mycc_1:265208bde42d32cc07779c963ccfa379439f1ac64a813bf701e5309ff08bae13' 2020-04-18 14:09:28.078 IDT [endorser] callChaincode -> INFO 07b finished chaincode: _lifecycle duration: 702ms channel= txID=6cf67d2f 2020-04-18 14:09:28.078 IDT [comm.grpc.server] 1 -> INFO 07c unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.17.0.11:34596 grpc.code=OK grpc.call_duration=724.175701ms 2020-04-18 14:09:28.551 IDT [endorser] callChaincode -> INFO 07d finished chaincode: _lifecycle duration: 0ms channel= txID=f5998634 2020-04-18 14:09:28.551 IDT [comm.grpc.server] 1 -> INFO 07e unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.17.0.11:34628 grpc.code=OK grpc.call_duration=1.714696ms 2020-04-18 14:09:58.337 IDT [peer.blocksprovider] func1 -> WARN 07f Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:09:58.337 IDT [peer.blocksprovider] DeliverBlocks -> WARN 080 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:10:39.363 IDT [peer.blocksprovider] func1 -> WARN 081 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:10:39.363 IDT [peer.blocksprovider] DeliverBlocks -> WARN 082 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:10:49.169 IDT [endorser] callChaincode -> INFO 083 finished chaincode: cscc duration: 0ms channel= txID=e48c516f 2020-04-18 14:10:49.169 IDT [comm.grpc.server] 1 -> INFO 084 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.17.0.11:35566 grpc.code=OK grpc.call_duration=1.250385ms 2020-04-18 14:10:51.147 IDT [couchdb] CreateDatabaseIfNotExist -> INFO 085 Created state database orderer-system-channel_lscc 2020-04-18 14:10:52.347 IDT [couchdb] CreateDatabaseIfNotExist -> INFO 086 Created state database orderer-system-channel__lifecycle$$p_implicit_org_$org1$m$s$p 2020-04-18 14:10:53.267 IDT [couchdb] CreateDatabaseIfNotExist -> INFO 087 Created state database orderer-system-channel__lifecycle$$h_implicit_org_$org1$m$s$p 2020-04-18 14:10:53.453 IDT [lifecycle] ApproveChaincodeDefinitionForOrg -> INFO 088 Successfully endorsed chaincode approval with name 'mycc', package ID 'mycc_1:265208bde42d32cc07779c963ccfa379439f1ac64a813bf701e5309ff08bae13', on channel 'orderer-system-channel' with definition {sequence: 1, endorsement info: (version: '1.0', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()} 2020-04-18 14:10:53.453 IDT [endorser] callChaincode -> INFO 089 finished chaincode: _lifecycle duration: 4204ms channel=orderer-system-channel txID=d913be80 2020-04-18 14:10:53.485 IDT [comm.grpc.server] 1 -> INFO 08a unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.17.0.11:35566 grpc.code=OK grpc.call_duration=4.236358061s 2020-04-18 14:11:23.486 IDT [comm.grpc.server] 1 -> INFO 08b streaming call completed grpc.service=protos.Deliver grpc.method=DeliverFiltered grpc.request_deadline=2020-04-18T14:11:23.485+03:00 grpc.peer_address=172.17.0.11:35568 error="context finished before block retrieved: context canceled" grpc.code=Unknown grpc.call_duration=29.988290354s 2020-04-18 14:11:28.591 IDT [peer.blocksprovider] func1 -> WARN 08c Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 2020-04-18 14:11:28.591 IDT [peer.blocksprovider] DeliverBlocks -> WARN 08d Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010

What could be the problem?

The script with which I create the system -

kubectl exec -it fabric-tools -- /bin/bash
cryptogen generate --config /fabric/config/crypto-config.yaml &&
cp -r crypto-config /fabric/ &&
for file in $(find /fabric/ -iname *_sk); do echo $file; dir=$(dirname $file); mv ${dir}/*_sk ${dir}/key.pem; done &&
cp /fabric/config/configtx.yaml /fabric/ &&
cd /fabric &&
configtxgen -profile FourOrgsOrdererGenesis -outputBlock genesis.block -channelID kafka-orderer-channel &&
configtxgen -profile FourOrgsChannel -outputCreateChannelTx orderer-system-channel.tx -channelID orderer-system-channel &&
configtxgen -profile FourOrgsChannel -outputAnchorPeersUpdate ./Org1MSPanchors.tx -channelID orderer-system-channel -asOrg Org1MSP &&
configtxgen -profile FourOrgsChannel -outputAnchorPeersUpdate ./Org2MSPanchors.tx -channelID orderer-system-channel -asOrg Org2MSP &&
configtxgen -profile FourOrgsChannel -outputAnchorPeersUpdate ./Org3MSPanchors.tx -channelID orderer-system-channel -asOrg Org3MSP &&
cd .. &&
chmod a+rx /fabric/* -R 

Create the chaincode -

cd /fabric &&
export CHANNEL_NAME="orderer-system-channel" &&
export ORDERER_URL="orderer:31010" &&
export CORE_PEER_ADDRESSAUTODETECT="false" &&
export CORE_PEER_NETWORKID="nid1" &&
export CORE_PEER_LOCALMSPID="Org1MSP" &&
export CORE_PEER_ADDRESS="org1peer1-svc:30110" &&
export CORE_PEER_MSPCONFIGPATH="/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" &&
export FABRIC_CFG_PATH="/etc/hyperledger/fabric" &&
peer channel create -o ${ORDERER_URL} -c ${CHANNEL_NAME} -f /fabric/${CHANNEL_NAME}.tx &&
chmod a+rx /fabric/* -R 

Join the peers to the channel (same for all the organization) -

export CHANNEL_NAME="orderer-system-channel" &&
export CORE_PEER_NETWORKID="nid1" &&
export ORDERER_URL="orderer:31010" &&
export FABRIC_CFG_PATH="/etc/hyperledger/fabric" &&
export CORE_PEER_LOCALMSPID="Org1MSP" &&
export CORE_PEER_MSPID="Org1MSP" &&
export CORE_PEER_MSPCONFIGPATH="/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" &&
export CORE_PEER_ADDRESS="org1peer1-svc:30110" &&
peer channel fetch newest -o ${ORDERER_URL} -c ${CHANNEL_NAME} &&
chmod a+rx /fabric/* -R &&
peer channel join -b ${CHANNEL_NAME}_newest.block &&
sleep 5 &&
export CORE_PEER_ADDRESS="org1peer2-svc:30110" &&
peer channel fetch newest -o ${ORDERER_URL} -c ${CHANNEL_NAME} &&
peer channel join -b ${CHANNEL_NAME}_newest.block 

Package the chaincode -

cp -r /fabric/config/chaincode $GOPATH/src/ &&
cd /go/src/chaincode &&
GO111MODULE=on go mod vendor &&
cd /fabric &&
chmod a+rx /go/* -R &&
peer lifecycle chaincode package mycc.tar.gz --path /go/src/chaincode/ --lang golang --label mycc_1 &&
chmod a+rx /fabric/* -R 

Install the chaincode -

export CHAINCODE_VERSION="1.0" &&
export FABRIC_CFG_PATH="/etc/hyperledger/fabric" &&
export CORE_PEER_MSPCONFIGPATH="/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" &&
export CORE_PEER_LOCALMSPID="Org1MSP" &&
export CORE_PEER_ADDRESS="org1peer1-svc:30110" &&
peer lifecycle chaincode install mycc.tar.gz &&
peer lifecycle chaincode queryinstalled &&
export CORE_PEER_ADDRESS="org1peer2-svc:30110" &&
peer lifecycle chaincode install mycc.tar.gz &&
peer lifecycle chaincode queryinstalled 

And trying to approve the chaincode -

export CHANNEL_NAME="orderer-system-channel" &&
export CORE_PEER_NETWORKID="nid1" &&
export ORDERER_URL="orderer:31010" &&
export FABRIC_CFG_PATH="/etc/hyperledger/fabric"

export CC_PACKAGE_ID=mycc_1:265208bde42d32cc07779c963ccfa379439f1ac64a813bf701e5309ff08bae13 &&
export CORE_PEER_LOCALMSPID="Org1MSP" &&
export CORE_PEER_MSPID="Org1MSP" &&
export CORE_PEER_MSPCONFIGPATH="/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" &&
export CORE_PEER_ADDRESS="org1peer1-svc:30110"

peer lifecycle chaincode approveformyorg --channelID $CHANNEL_NAME --name mycc --version 1.0 --init-required --package-id $CC_PACKAGE_ID --sequence 1
nirkov
  • 697
  • 10
  • 25

2 Answers2

0

For me this problem was due by a permission issue. Checking your peer and orderer logs it seems you have some communication issues and I think your case might be similar to the one I solved with this question. Notice that also this question might contain useful pointers.

Anyway my suggestion is to set your policies as follows and regenerate the initial artifacts. This should solve both your communication issues and you chaincode lifecyle error:

In your configtx.yaml you should set your organization permissions as follows:

- &Org1
    Name: Org1MSP

    ID: Org1MSP

    MSPDir: crypto-config/peerOrganizations/org1.example.com/msp

    Policies:
        Readers:
            Type: Signature
            Rule: "OR('Org1MSP.member')"
        Writers:
            Type: Signature
            Rule: "OR('Org1MSP.member')"
        Admins:
            Type: Signature
            Rule: "OR('Org1MSP.admin')"
        Endorsement:
            Type: Signature
            Rule: "OR('Org1MSP.member')"

    AnchorPeers:
        - Host: peer0.org1.example.com
          Port: 7051

- &Org2
    Name: Org2MSP

    ID: Org2MSP

    MSPDir: crypto-config/peerOrganizations/org2.example.com/msp

    Policies:
        Readers:
            Type: Signature
            Rule: "OR('Org2MSP.member')"
        Writers:
            Type: Signature
            Rule: "OR('Org2MSP.member')"
        Admins:
            Type: Signature
            Rule: "OR('Org2MSP.admin')"
        Endorsement:
            Type: Signature
            Rule: "OR('Org2MSP.member')"

    AnchorPeers:
        - Host: peer0.org2.example.com
          Port: 9051

After that:

  • regenerate the genesis block
  • regenerate the channel.tx
  • restart your network
rakwaht
  • 3,666
  • 3
  • 28
  • 45
0
  1. Check the log of the peer after you join the channel. I think the peer joins the channel failed. See this error message in your peer log:
2020-04-18 14:06:34.915 IDT [peer.blocksprovider] DeliverBlocks -> WARN 047 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 

2020-04-18 14:06:35.276 IDT [peer.blocksprovider] func1 -> WARN 048 Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 

2020-04-18 14:06:35.276 IDT [peer.blocksprovider] DeliverBlocks -> WARN 049 Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 

2020-04-18 14:06:35.708 IDT [peer.blocksprovider] func1 -> WARN 04a Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010 

2020-04-18 14:06:35.708 IDT [peer.blocksprovider] DeliverBlocks -> WARN 04b Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 

2020-04-18 14:06:36.228 IDT [peer.blocksprovider] func1 -> WARN 04c Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010

2020-04-18 14:06:36.228 IDT [peer.blocksprovider] DeliverBlocks -> WARN 04d Got error while attempting to receive blocks: received bad status FORBIDDEN from orderer channel=orderer-system-channel orderer-address=orderer:31010 

2020-04-18 14:06:36.881 IDT [peer.blocksprovider] func1 -> WARN 04e Encountered an error reading from deliver stream: EOF channel=orderer-system-channel orderer-address=orderer:31010

  1. If join channel successful, make sure you already EnableNodeOUs in /fabric/config/crypto-config.yaml

Ex:

PeerOrgs:
  # ---------------------------------------------------------------------------
  # Org1
  # ---------------------------------------------------------------------------
  - Name: Org1
    Domain: org1.example.com
    EnableNodeOUs: true
harisato
  • 326
  • 1
  • 7