peer channel fectch error: MSP SampleOrg is not defined on channel

389 Views Asked by At

I've deployed Hyperledger Fabric and cd into fabric-samples/test-network, I can run the command ./network.sh up createChannel, the containers' status are "up" and I can delploy a chaincode. However, when I intend to run the command

peer channel fetch config config_block.pb -o $ORDERER_CONTAINER -c $CH_NAME --tls --cafile $TLS_ROOT_CA

to fetch the channel config, I got

2022-05-17 10:09:31.644 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2022-05-17 10:09:31.647 UTC [cli.common] readBlock -> INFO 002 Expect block, but got status: &{FORBIDDEN}
Error: can't read the block: &{FORBIDDEN}

I've checked the orderer's log, and it gives

2022-05-16 11:39:04.803 UTC [policies] SignatureSetToValidIdentities -> WARN 061 invalid identity: certificate subject=CN=peer0.org1.example.com,OU=COP,L=San Francisco,ST=California,C=US serialnumber=268337738708423250738667250199689187829 error="MSP SampleOrg is not defined on channel"
2022-05-16 11:39:04.803 UTC [policies] SignatureSetToValidIdentities -> WARN 062 invalid identity: certificate subject=CN=peer0.org1.example.com,OU=COP,L=San Francisco,ST=California,C=US serialnumber=268337738708423250738667250199689187829 error="MSP SampleOrg is not defined on channel"
2022-05-16 11:39:04.803 UTC [policies] SignatureSetToValidIdentities -> WARN 063 invalid identity: certificate subject=CN=peer0.org1.example.com,OU=COP,L=San Francisco,ST=California,C=US serialnumber=268337738708423250738667250199689187829 error="MSP SampleOrg is not defined on channel"
2022-05-16 11:39:04.803 UTC [common.deliver] deliverBlocks -> WARN 064 [channel: mychannel] Client 12.11.52.5:50846 is not authorized: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Readers' sub-policies to be satisfied: permission denied

I noticed that in the network.sh up createChannel logs, the command run correctly with results like

Fetching the most recent configuration block for the channel
+ peer channel fetch config config_block.pb -o orderer.example.com:7050 --ordererTLSHostnameOverride orderer.example.com -c mychannel --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
2022-05-16 15:35:42.810 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2022-05-16 15:35:42.816 UTC [cli.common] readBlock -> INFO 002 Received block: 1
2022-05-16 15:35:42.816 UTC [channelCmd] fetch -> INFO 003 Retrieving last config block: 1
2022-05-16 15:35:42.818 UTC [cli.common] readBlock -> INFO 004 Received block: 1
Decoding config block to JSON and isolating config to Org2MSPconfig.json
+ configtxlator proto_decode --input config_block.pb --type common.Block
+ jq '.data.data[0].payload.data.config'

I've tried copy the same commands in the logs, and run it in the cli bash The results is still the same.

I can't find similar errors and I don't understand why I got this. Does anyone have any ideas?

2

There are 2 best solutions below

0
On

I solved this problem by modify the docker-compose-test-net.yaml, I split the cli into cli1,cli2,one for each organization, and the peer channel fetch command runs correctly.

0
On

I had this problem recently. Turns out the org names we were using were inconsistent - org1 when registering peers vs. Org1 when performing a later connection