【问题标题】:Error starting hyperledger-composer network after Fabric and Composer version upgradeFabric 和 Composer 版本升级后启动 hyperledger-composer 网络时出错
【发布时间】:2018-11-06 23:38:13
【问题描述】:

我在启动 hyperledger-composer 网络时遇到了一个错误,在 composer-wiki 中没有得到回答。

✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers. 
Response from attempted peer comms was an error: Error: transaction returned with failure: can't find PEM header: undefined 
Command failed

检查先决条件,

  • 面料 1.2
  • 作曲家 0.20.4
  • 节点 8.12.0
  • Docker 18.01.1
  • “composer network install”成功,文件出现在 docker peer 的 /var/hyperleder/production/chaincodes

运行“composer network start”命令后,“docker ps”会显示新的 docker 实例,名称为:

dev-peer0.org1.example.com-<<business-network-name>>-0.0.7

但是任何尝试 ping 都会导致这样的失败:

Error: Error trying to ping. Error: make sure the chaincode <<business-network-name>> has been successfully instantiated and try again: getccdata composerchannel/<<business-network-name>> responded with error: could not find chaincode with name '<<business-network-name>>'

查看dev-peer0的日志,结果如下:

2018-11-05T05:03:18.227Z [4264161f] ERROR    :Composer                 :Init()                    can't find PEM header: undefined
2018-11-05T05:03:18.227Z [4264161f] VERBOSE  :Composer                 :@PERF Init()              Total (ms) duration for txnID [4264161fc30a61c70884d4c7efb460fea6a755d07bc4852875c393346795227a]: 929.00
2018-11-05T05:03:18.228Z ERROR [lib/handler.js] [composerchannel-4264161f]Calling chaincode Init() returned error response [can't find PEM header: undefined]. Sending ERROR message back to peer 

peer0日志中对应的error要大一大截:

2018-11-05 05:03:18.229 UTC [endorser] SimulateProposal -> ERRO 439d [composerchannel][4264161f] failed to invoke chaincode name:"lscc" , error: transaction returned with failure: can't find PEM header: undefined
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:202
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:131
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:173
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:287
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:501
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:31
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
    /opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:112
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:923
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1148
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:637
runtime.goexit
    /opt/go/src/runtime/asm_amd64.s:2361
2018-11-05 05:03:18.229 UTC [endorser] SimulateProposal -> DEBU 439e [composerchannel][4264161f] Exit

自从上次工作以来,我已将作曲家从 0.19 更新到 0.20.4,并将 Fabric 从 1.1 更新到 1.2。

谷歌搜索表明这种错误“找不到 PEM 标头:未定义”与密钥签名的更改有关。拆下 Fabric 后,我重新运行 ./createPeerAdminCard.sh - 是否需要重新创建另一张卡或类似卡以适应最新版本?

【问题讨论】:

  • dev-peer0... docker 容器的日志中是否有错误?同样,peer0.org1... 容器中是否有错误?看起来您正在启动网络的 v0.0.7 - v0.0.6 是否启动正常? - 如果是这样,您在版本之间做了哪些更改?
  • 我没有看到那个错误,但是如果你怀疑卡,那么我会使用composer card delete 删除现有的卡,然后确保环境变量 FABRIC_VERSION 设置为 hlfv12 - 然后运行 ​​createPeerAdminCard 脚本再次。
  • 另一条评论,您应该专门使用 Fabric 1.2.1 和 Composer 0.20.4(也许这就是您的意思,而不是 1.2 Fabric FYI)
  • @PaulO'Mahony 感谢您的指点,但我在 Fabric 发布页面上看不到 1.2.1:github.com/hyperledger/fabric#releases。你能确认一下吗?

标签: hyperledger-composer


【解决方案1】:

感谢@R Thatcher 让我找到了正确的方向。这一切都归结为不匹配的卡片,并通过清除所有内容并重新开始来解决。

具体来说,在 /fabric-dev-servers 中:

./stopFabric.sh 
./teardownFabric.sh
composer card list
composer card delete -c admin@<business-network-name>
composer card delete -c PeerAdmin@hlfv1
./startFabric.sh
./createPeerAdminCard.sh

然后切换到 composer/business-network-name 目录:

composer network install --card PeerAdmin@hlfv1 --archiveFile business-network-name\@0.0.7.bna 
composer network start -c PeerAdmin@hlfv1 -n business-network-name -V 0.0.7 -A admin -S adminpw --file networkadmin.card
composer card import --file networkadmin.card --card admin@business-network-name
composer network ping -c admin@business-network-name

所以是的,这是关于不匹配的卡,而不是作为新部署的一部分清理它们。

虽然不是原始问题的一部分,但还值得注意的是,composer network start 命令的 -A 和 -S 参数必须分别设置为 admin 和 adminpw。请参阅作曲家问题#3781

【讨论】:

    【解决方案2】:

    回答@Capn Sparrow 的最后一句话

    "composer network start 命令的 -A 和 -S 参数必须分别设置为 admin 和 adminpw。"

    这是正确和预期的行为:-)

    使用composer network start 命令,-A 和 -S 指定 CA 中的现有用户,我们需要一组新的凭据(证书和密钥),然后将其绑定到作曲系统参与者。

    当您使用“标准开发结构”时,CA 配置了一个名为“admin”的用户,其密码为“adminpw”。如果您从头开始构建自己的 Fabric,您可以选择您的第一个默认用户的名称和密码。或者,您可以使用 fabric-ca 客户端软件在 CA 中创建其他用户。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-24
      • 2023-04-01
      • 1970-01-01
      相关资源
      最近更新 更多