peer channel creation fails in Hyperledger Fabric

拥有回忆 提交于 2019-11-27 11:42:59

Error: Got unexpected status: BAD_REQUEST -- Error authorizing update: Error validating DeltaSet: Policy for [Groups] /Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining

This usually indicates that the signer of the channel creation transaction does not have admin rights for one of the consortium orgs, however, it may indicate a failure for a number of other reasons.

Unfortunately, the error must be somewhat cryptic, to avoid leaking information about consortium or channel membership. To get the underlying cause, you will need to check the orderer logs. If it is not already set, you will want to turn the log level up to debug in orderer.yaml or alternately by setting ORDERER_GENERAL_LOGLEVEL=debug before starting the orderer. In your orderer logs, you will see the same error text as output by the peer client, but in the preceding lines you will see additional causes for your error.

The most common reasons are:

  1. The identity is not in the list of admins for the org.
  2. The identity's certificate is not validly signed by the org CA chain.
  3. The identity's org is not known to the orderer.

Some other unlikely possibilities because you are using the peer binary and not custom code:

  1. The signature does not match the identity or signed bytes.
  2. The identity is malformed.

Assuming that the cause is not obvious from the orderer logs, if you post them here, I'd be happy to help diagnose them.

Oh, and as a helpful tip. You may see a more human readable version of your genesisblock by using configtxgen -inspectBlock <genesis.block>.

Edit: Looking back a the top of your post I see this output in the orderer log:

ERRO 02d Principal deserialization failure (The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority) for identity

This would indicate that the certificate claims to be issued by a CA, but is not signed by the CA the orderer knows about (error type 2 above). This would commonly happen if you bootstrapped the orderer, then regenerated the crypto material for your environment without removing the orderer's storage directory.

It's important to remember that the ORDERER_GENERAL_GENESISFILE is only read if the system is not already bootstrapped, so changing the genesis block for the orderer will have no affect unless the orderer storage is also deleted.

This has nothing to do with TLS, since the request has reached the orderer. Have it been a TLS issue - you wouln't have gotten the following error:

Error: Got unexpected status: BAD_REQUEST -- Error authorizing update: Error validating DeltaSet: Policy for [Groups] /Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining

Now, the error basically means that you tried to send a transaction for channel creation, but the transaction was signed by a user (a client certificate) that isn't a channel admin.

You need to prefix the command with something similar to this:

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp

Below solution worked for me.

Go inside your peer docker container. Go to /etc/hyperledger/msp/users/Admin@org1.example.com/msp and run export CORE_PEER_MSPCONFIGPATH=$PWD

Run your peer channel create command again with appropriate flags.

in my case, it was some missing entries in the docker-compose file for orderer:

ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt] was changed to ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt, /etc/hyperledger/crypto/peerORG1/tls/ca.crt, /etc/hyperledger/crypto/peerORG2/tls/ca.crt, /etc/hyperledger/crypto/peerORG3/tls/ca.crt] and then it worked.

so that's something you might want to check, especially if you have a customized setup.

In my case, the only thing that was missing was to define the CORE_PEER_MSPCONFIGPATH correctly. Using fabric 1.1 Hope it will help others.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!