我在启动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
检查先决条件,
运行“ 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日志中的相应错误大得多:
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
自上次工作以来,我已将Composer从0.19更新到0.20.4,并将Fabric从1.1更新到1.2。
Google搜索表明,这种错误“找不到PEM标头:未定义”与密钥签名的更改有关。拆除Fabric后,我重新运行./createPeerAdminCard.sh-是否需要重新创建另一张卡或类似卡以适应最新版本?
答案 0 :(得分: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命令HAD的-A和-S参数分别设置为admin和adminpw。参见作曲家问题#3781。
答案 1 :(得分:1)
回答@Capn Sparrow的最后发言
“将作曲者网络启动命令HAD的-A和-S参数分别设置为admin和adminpw。”
这是正确的预期行为:-)
使用composer network start
命令-A和-S在CA中指定一个现有用户,我们希望为其绑定新的一组凭据(证书和密钥)给作曲家系统的参与者。
当您使用“标准开发结构”时,该CA配置了一个名为“ admin”的用户,其秘密为“ adminpw”。如果您是从头开始构建自己的Fabric,则可以选择第一个默认用户的名称和密码。或者,您可以使用fabric-ca客户端软件在CA中创建其他用户。