【发布时间】: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。你能确认一下吗?
-
@CapnSparrow - 没问题 -> github.com/hyperledger/fabric/releases/tag/v1.2.1