首页 文章

在Fabric和Composer版本升级后启动hyperledger-composer网络时出错

提问于
浏览
0

我发现启动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

检查先决条件,

  • Fabric 1.2

  • 作曲家0.20.4

  • 节点8.12.0

  • Docker 18.01.1

  • "composer network install"成功,文件出现在/ var / hyperleder / production / chaincodes的docker peer中

运行“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

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

谷歌搜索表明,这种错误“找不到PEM头:未定义”与密钥签名的变化有关 . 在拆除Fabric后,我重新运行了./createPeerAdminCard.sh - 是否有另外一张卡或类似物需要重新创建才能容纳最新版本?

2 回答

  • 0

    回答@Capn Sparrow的最后一句话

    “作曲家网络启动命令HAD的-A和-S参数分别设置为admin和adminpw . ”

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

    使用 composer network start 命令,-A和-S在CA中指定 existing user ,我们需要一组新的凭据(证书和密钥),然后将其绑定到Composer System参与者 .

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

  • 1

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

    具体来说,在/ 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
    

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

    虽然不是原始问题的一部分,但值得注意的是,作曲家网络的-A和-S参数将命令HAD分别设置为admin和adminpw . 请参阅composer issue #3781 .

相关问题