错误:出现意外状态:BAD_REQUEST

时间:2017-05-22 17:58:03

标签: kubernetes hyperledger-fabric

我相信我在Kubernetes上有一个orderer,两个peer和一个cli

尝试在peer内发出cli个命令会导致错误。

更新:我尝试在docker-compose下运行相同的crypto-config,并从peer channel create收到相同的错误。这表明我的cli命令或crypto-config本身的某些内容不正确。

对于有助于我的调试步骤,我将不胜感激。

可能与我之前提出的问题中总结的问题有关:
Received AliveMessage from a peer with the same PKI-ID as myself

cli内:

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com CORE_PEER_LOCALMSPID="OrdererMSP" \
peer channel create \
--orderer orderer.default.svc.cluster.local:7050 \
--chain ch01 \
--file channel.170511.tx

结果:

2017-05-22 17:36:52.235 UTC [logging] InitFromViper -> DEBU 001 Setting default logging level to DEBUG for command 'channel'
2017-05-22 17:36:52.235 UTC [msp] GetLocalMSP -> DEBU 002 Returning existing local MSP
2017-05-22 17:36:52.236 UTC [msp] GetDefaultSigningIdentity -> DEBU 003 Obtaining default signing identity
Error: Got unexpected status: BAD_REQUEST
Usage:
  peer channel create [flags]

巧合地在orderer

2017-05-22 17:36:52.326 UTC [orderer/main] Deliver -> DEBU 11f Starting new Deliver handler
2017-05-22 17:36:52.326 UTC [orderer/common/deliver] Handle -> DEBU 120 Starting new deliver loop
2017-05-22 17:36:52.326 UTC [orderer/common/deliver] Handle -> DEBU 121 Attempting to read seek info message
2017-05-22 17:36:52.332 UTC [orderer/main] Broadcast -> DEBU 122 Starting new Broadcast handler
2017-05-22 17:36:52.333 UTC [orderer/common/broadcast] Handle -> DEBU 123 Preprocessing CONFIG_UPDATE
2017-05-22 17:36:52.333 UTC [orderer/multichain] Process -> DEBU 124 Processing channel creation request for channel ch01
2017-05-22 17:36:52.333 UTC [msp] GetLocalMSP -> DEBU 125 Returning existing local MSP
2017-05-22 17:36:52.333 UTC [msp] GetDefaultSigningIdentity -> DEBU 126 Obtaining default signing identity
2017-05-22 17:36:52.333 UTC [msp] GetLocalMSP -> DEBU 127 Returning existing local MSP
2017-05-22 17:36:52.333 UTC [msp] GetDefaultSigningIdentity -> DEBU 128 Obtaining default signing identity
2017-05-22 17:36:52.333 UTC [msp] Sign -> DEBU 129 Sign: plaintext: [[REDACTED]]...[[REDACTED]] 
2017-05-22 17:36:52.333 UTC [msp] Sign -> DEBU 12a Sign: digest: [[REDACTED]] 
2017-05-22 17:36:52.333 UTC [msp] GetLocalMSP -> DEBU 12b Returning existing local MSP
2017-05-22 17:36:52.333 UTC [msp] GetDefaultSigningIdentity -> DEBU 12c Obtaining default signing identity
2017-05-22 17:36:52.333 UTC [msp] GetLocalMSP -> DEBU 12d Returning existing local MSP
2017-05-22 17:36:52.333 UTC [msp] GetDefaultSigningIdentity -> DEBU 12e Obtaining default signing identity
2017-05-22 17:36:52.333 UTC [msp] Sign -> DEBU 12f Sign: plaintext: [[REDACTED]]...[[REDACTED]] 
2017-05-22 17:36:52.333 UTC [msp] Sign -> DEBU 130 Sign: digest: [[REDACTED]] 
2017-05-22 17:36:52.334 UTC [orderer/common/broadcast] Handle -> DEBU 131 Broadcast is filtering message of type 4 for channel testchainid
2017-05-22 17:36:52.334 UTC [common/policies] GetPolicy -> DEBU 132 Returning policy Writers for evaluation
2017-05-22 17:36:52.334 UTC [cauthdsl] func1 -> DEBU 133 Gate evaluation starts: (&{N:1 policies:<signed_by:0 > })
2017-05-22 17:36:52.334 UTC [cauthdsl] func2 -> DEBU 134 Principal evaluation starts: (&{%!s(int32=0)}) (used [%!s(bool=false)])
2017-05-22 17:36:52.334 UTC [msp] newIdentity -> DEBU 135 Creating identity instance for ID &{OrdererMSP DEFAULT}
2017-05-22 17:36:52.334 UTC [msp] Validate -> INFO 136 MSP OrdererMSP validating identity
2017-05-22 17:36:52.334 UTC [cauthdsl] func2 -> DEBU 137 Principal evaluation fails: (&{%!s(int32=0)})%!(EXTRA []bool=[false])
2017-05-22 17:36:52.334 UTC [cauthdsl] func1 -> DEBU 138 Gate evaluation fails: (&{N:1 policies:<signed_by:0 > })
2017-05-22 17:36:52.334 UTC [cauthdsl] func1 -> DEBU 139 Gate evaluation starts: (&{N:1 policies:<signed_by:0 > })
2017-05-22 17:36:52.334 UTC [cauthdsl] func2 -> DEBU 13a Principal evaluation starts: (&{%!s(int32=0)}) (used [%!s(bool=false)])
2017-05-22 17:36:52.334 UTC [msp] newIdentity -> DEBU 13b Creating identity instance for ID &{OrdererMSP DEFAULT}
2017-05-22 17:36:52.334 UTC [cauthdsl] func2 -> DEBU 13c Principal evaluation fails: (&{%!s(int32=0)})%!(EXTRA []bool=[false])
2017-05-22 17:36:52.334 UTC [cauthdsl] func1 -> DEBU 13d Gate evaluation fails: (&{N:1 policies:<signed_by:0 > })
2017-05-22 17:36:52.334 UTC [cauthdsl] func1 -> DEBU 13e Gate evaluation starts: (&{N:1 policies:<signed_by:0 > })
2017-05-22 17:36:52.334 UTC [cauthdsl] func2 -> DEBU 13f Principal evaluation starts: (&{%!s(int32=0)}) (used [%!s(bool=false)])
2017-05-22 17:36:52.334 UTC [msp] newIdentity -> DEBU 140 Creating identity instance for ID &{OrdererMSP DEFAULT}
2017-05-22 17:36:52.334 UTC [cauthdsl] func2 -> DEBU 141 Principal evaluation fails: (&{%!s(int32=0)})%!(EXTRA []bool=[false])
2017-05-22 17:36:52.334 UTC [cauthdsl] func1 -> DEBU 142 Gate evaluation fails: (&{N:1 policies:<signed_by:0 > })
2017-05-22 17:36:52.334 UTC [orderer/common/broadcast] Handle -> WARN 143 Rejecting broadcast message because of filter error: Rejected by rule: *sigfilter.sigFilter
2017-05-22 17:36:52.336 UTC [orderer/common/deliver] Handle -> WARN 144 Error reading from stream: stream error: code = 1 desc = "context canceled"

crypto-config:

OrdererOrgs:
  - Name: Orderer
    Domain: default.svc.cluster.local
    Specs:
      - Hostname: orderer
PeerOrgs:
  - Name: Org1
    Domain: org1.svc.cluster.local
    Template:
      Count: 2
    Users:
      Count: 2
  - Name: Org2
    Domain: org2.svc.cluster.local
    Template:
      Count: 2
    Users:
      Count: 2

3 个答案:

答案 0 :(得分:0)

请将频道名称仅保留为小案例。这解决了我的问题。

在创建通道工件之前,将通道名称设置为小写字母,如下所示:     export CHANNEL_NAME = casesensitivechannelname

创建频道时使用相同的频道名称。

答案 1 :(得分:0)

我认为您没有很好地指定MSP目录和MSP身份。

CORE_PEER_MSPCONFIGPATH应与您的证书目录一致。与CORE_PEER_LOCALMSPID相同。在我的意见中,这就是问题所在。

确保crypto-config文件,configtx文件和docker-compose文件的配置一致。

  • 当您执行cryptogen工具时,它会创建一个包含您需要的所有证书的目录树。它遵循您在此文件中定义的域和主机。
  • 执行configtxgen工具时,为每个组织定义MSP目录。
  • 最后,在docker-compose文件中,您还可以定义MSP ID和MSP配置路径的目录。

在您的情况下,您可以在此处定义:

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com CORE_PEER_LOCALMSPID="OrdererMSP"

答案 2 :(得分:0)

使用“对等频道列表”查看现有频道列表。您无法创建与现有频道同名的新频道。