Hyperledger Fabric 2.0 byfn.sh安装链码时出错 [英] Hyperledger Fabric 2.0 byfn.sh error installing chaincode

查看:150
本文介绍了Hyperledger Fabric 2.0 byfn.sh安装链码时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有与该问题所指出的问题完全相同的问题:错误:未能认可chaincode安装:rpc错误:code =不可用desc =运输即将结束

I have the exact same issue as pointed out in this question: Error: failed to endorse chaincode install: rpc error: code = Unavailable desc = transport is closing

如果您选择回答这个问题,请检查链接中的问题,因为我的问题与我的问题完全相同,但我的环境如下:

If you are choosing to answer this question, please do review the question in the link as my issue is exactly the same except that my environment is as follows:

    OS: RHEL 7.7
    Go version: 1.13.7
    Node version: 12.13.0
    Docker version: 18.09.7 (Client and Engine)
    NO INTERNET ACCESS

我使用以下命令执行脚本:

I execute the script with the following command:

./byfn.sh up -a -s couchdb -l javascript -v

我可以添加到另一个(未回答)问题的唯一另一件事是peer0.org1.example.com的docker日志的输出:

The only other thing I can add to the other (unanswered) question is the output of the docker logs for peer0.org1.example.com:

2020-04-15 20:52:21.548 UTC [gossip.channel] reportMembershipChanges -> INFO 05d [[mychannel] Membership view has changed. peers went online:  [[peer0.org2.example.com:9051 ] [peer1.org2.example.com:10051 ]] , current view:  [[peer1.org1.example.com:8051] [peer0.org2.example.com:9051 ] [peer1.org2.example.com:10051 ]]]
2020-04-15 20:57:20.764 UTC [endorser] callChaincode -> INFO 05e finished chaincode: _lifecycle duration: 300000ms channel= txID=dfbc8dc6
2020-04-15 20:57:20.764 UTC [endorser] SimulateProposal -> ERRO 05f failed to invoke chaincode _lifecycle, error: timeout expired while executing transaction
github.com/hyperledger/fabric/core/chaincode.(*Handler).Execute
    /go/src/github.com/hyperledger/fabric/core/chaincode/handler.go:1215
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).execute
    /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:272
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Invoke
    /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:202
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
    /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:155
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
    /go/src/github.com/hyperledger/fabric/core/endorser/support.go:126
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
    /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:114
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
    /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:173
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposalSuccessfullyOrError
    /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:377
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
    /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:320
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
    /go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
    /go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler.func1
    /go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:107
github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
    /go/src/github.com/hyperledger/fabric/common/grpclogging/server.go:92
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
    /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
    /go/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:31
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
    /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
    /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler
    /go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:109
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
    /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:995
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
    /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1275
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
    /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:710
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1357
error sending
failed to execute transaction dfbc8dc6777361d37da9a542fbe95ef35c6188d4f2719b80c4827b724f92b87f
github.com/hyperledger/fabric/core/chaincode.processChaincodeExecutionResult
    /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:161
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
    /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:156
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
    /go/src/github.com/hyperledger/fabric/core/endorser/support.go:126
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
    /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:114
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
    /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:173
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposalSuccessfullyOrError
    /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:377
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
    /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:320
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
    /go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
    /go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler.func1
    /go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:107
github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
    /go/src/github.com/hyperledger/fabric/common/grpclogging/server.go:92
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
    /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
    /go/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:31
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
    /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
    /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler
    /go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:109
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
    /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:995
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
    /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1275
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
    /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:710
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1357 channel= txID=dfbc8dc6
2020-04-15 20:57:20.764 UTC [comm.grpc.server] 1 -> INFO 060 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.23.0.17:60354 grpc.code=OK grpc.call_duration=5m0.001572359s
2020-04-15 20:58:51.215 UTC [lifecycle] InstallChaincode -> INFO 061 Successfully installed chaincode with package ID 'mycc_1:1a85dbaa408ea570f05740792f9cd3c140d2b3c40b2bea1002d33aa13fb3d6e6'

编辑(4/17/2020)一些新信息:

EDIT (4/17/2020) SOME NEW INFO:

  1. 对等生命周期chaincode安装命令在5分钟后始终失败(根据上述docker日志的超时).
  2. 随后(请参阅docker日志的最后两行),确实安装了链码.
  3. 我修改了first-network/scripts/utils.sh函数installChaincode到下面的代码,然后一切正常完成成功.

    installChaincode() {
      PEER=$1
      ORG=$2
      setGlobals $PEER $ORG
      set -x
      peer lifecycle chaincode install mycc.tar.gz >&log.txt
      res=$?
      set +x
      cat log.txt
      if [ ${CC_RUNTIME_LANGUAGE} = "node" ];
      then
            echo "chaincode install returned $res"
            echo "sleeping for 10 minutes..."
            sleep 600
      else
            verifyResult $res "installation on peer${PEER}.org${ORG} has failed"
      fi
      echo "== Chaincode is installed on peer${PEER}.org${ORG} =============== "
      echo
    }

我想知道为什么即使在后台运行SimulateProposal命令后,对等生命周期链代码安装也会在大约一分钟后返回错误(请参阅上面的docker日志-前几行).

I wonder why the peer lifecycle chaincode install returns an error after about a minute or so even though there is a SimulateProposal command working in the background (see docker logs above - first few lines).

然后,如果安装命令返回错误,为什么链码安装实际上可以工作?之所以这样说,是因为随后对queryInstalled的调用从byfn.sh脚本中成功返回.

And then, why does the chaincode install actually work if the installation command returns an error? I say this because a subsequent call to queryInstalled returns successful from the byfn.sh script.

推荐答案

由于您使用的是Hyperledger Fabric,因此我不建议您构建 byfn .它已从HLF不推荐使用.相反,请尝试使用HLF建议的 test-network .

Since you are using Hyperledger Fabric, I wouldn't recommend building the byfn. It has been deprecated from HLF. Instead, try with test-network as it's suggested from HLF.

对于2.0版本,他们添加了注释在页面顶部.

For the 2.0 version, they have added the note on top of the page.

这篇关于Hyperledger Fabric 2.0 byfn.sh安装链码时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆