向对等方发送 Hyperledger Fabric 的链码实例化请求时出现 OCI 运行时错误 [英] OCI runtime error when sending Hyperledger Fabric's chaincode instantiation request to peers

查看:32
本文介绍了向对等方发送 Hyperledger Fabric 的链码实例化请求时出现 OCI 运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将 Hyperledger Fabric Java SDK 与 GO 链码结合使用,尝试使用以下命令启动链码后出现错误channel.sendInstantiationProposal(instantiateProposalRequest, company.getPeers());.

Using the Hyperledger Fabric Java SDK with GO chaincode, I'm getting an error after trying to initiate my chaincode using channel.sendInstantiationProposal(instantiateProposalRequest, company.getPeers());.

这是在我成功安装链码之后.调用上述方法后,我最终会得到这个错误:

This is after I successfully installed the chaincode. After calling said method, I will eventually get this error:

[dockercontroller] 开始->ERRO 352 start-could not start container: API error (404): {"message":"oci runtime error: container_linux.go:247: 启动容器进程导致"exec: \"chaincode\": 可执行在 $PATH" "} 中找不到文件.

[dockercontroller] Start -> ERRO 352 start-could not start container: API error (404): {"message":"oci runtime error: container_linux.go:247: starting container process caused "exec: \"chaincode\": executable file not found in $PATH" "}.

这本身就很奇特,因为 chaincode 不是我所知道的二进制文件.这可能意味着peer chaincode?

This is peculiar on its own, since chaincode is not a binary that I'm aware of. Does it perhaps mean peer chaincode?

版本

  • 超级账本结构:1.0.4
  • 码头工人:17.05.0-ce
  • 码头工人撰写:1.17.0
  • 超级账本/fabric-orderer:1.0.0
  • 超级账本/fabric-peer:1.0.0
  • 超级账本/fabric-ccenv:1.0.0
  • 超级账本/fabric-ca:1.0.0
  • 超级账本/fabric-baseos:0.3.1
  • tomcat(码头集装箱):8.5.23

我的实例化提案请求如下所示(使用反射打印):

My instantiation proposal request looks like this (printed with Reflection):

tomcat              | 2017-12-01 10:41:03 DEBUG Debug:24 - org.hyperledger.fabric.sdk.InstantiateProposalRequest
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:33 -   getProposalWaitTime: 20000
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:33 -   getChaincodeName: test_cc_go
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:33 -   getChaincodePath: super/test_cc
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:33 -   getChaincodeVersion: 0.0.1
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:43 -   getChaincodeEndorsementPolicy:
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:24 -     org.hyperledger.fabric.sdk.ChaincodeEndorsementPolicy
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:43 -       getChaincodeEndorsementPolicyAsBytes:
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:24 -         [B
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:41 -   getTransientMap:
tomcat              | {}
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:33 -   getChaincodeLanguage: GO_LANG
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:43 -   getChaincodeID:
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:24 -     org.hyperledger.fabric.sdk.ChaincodeID
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:41 -       getFabricChaincodeID:
tomcat              | path: "super/test_cc"
tomcat              | name: "test_cc_go"
tomcat              | version: "0.0.1"
tomcat              |
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:33 -       getVersion: 0.0.1
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:33 -       getName: test_cc_go
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:33 -       getPath: super/test_cc
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:33 -   getFcn: init
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:38 -   getArgBytes: null
tomcat              | 2017-12-01 10:41:03 DEBUG Debug:41 -   getArgs:
tomcat              | [testarg!]

看起来它无法正确创建容器,因为我得到 stop container dev-peer0.company.org-test_cc_go-0.0.1(Container not running: dev-peer0.company.org-test_cc_go-0.0.1) 主要错误之前.

It looks like it fails to properly create a container, since I'm getting stop container dev-peer0.company.org-test_cc_go-0.0.1(Container not running: dev-peer0.company.org-test_cc_go-0.0.1) before the main error.

我的 tomcat 容器和其中一个同行的完整日志:

The full log of my tomcat container and one of the peers:

tomcat              | 2017-12-01 10:41:03 DEBUG HyperledgerConfigurator:370 - Building instantiateProposalRequest...
tomcat              | 2017-12-01 10:41:03 DEBUG HyperledgerConfigurator:391 - Reading endorsement policy from path: /etc/hyperledger/chaincodeendorsementpolicy.yaml
tomcat              | 2017-12-01 10:41:03 DEBUG HyperledgerConfigurator:404 - Sending instantiation request to all peers...
tomcat              | 2017-12-01 10:41:03 DEBUG NettyClientHandler:147 -
tomcat              | ----------------OUTBOUND--------------------
tomcat              | [id: 0x0d3de89a, L:/172.18.0.11:41906 - R:peer0.company.org/172.18.0.8:7051] HEADERS: streamId=7, headers=GrpcHttp2OutboundHeaders[:authority: peer0.company.org, :path: /protos.Endorser/ProcessProposal, :method: POST, :scheme: https, content-type: application/grpc, te: trailers, user-agent: grpc-java-netty/1.5.0, grpc-accept-encoding: gzip], streamDependency=0, weight=16, exclusive=false, padding=0, endStream=false
tomcat              | ------------------------------------
tomcat              | 2017-12-01 10:41:03 DEBUG NettyClientHandler:147 -
tomcat              | ----------------OUTBOUND--------------------
tomcat              | [id: 0x0d3de89a, L:/172.18.0.11:41906 - R:peer0.company.org/172.18.0.8:7051] DATA: streamId=7, padding=0, endStream=true, length=1247, bytes=00000004da0a8f090a93070a72080310011a0c08bfe384d10510c082fc8102221270726573746174696f6e2d6368616e6e656c2a403263393063616131343431...
tomcat              | ------------------------------------
peer0.company.org      | 2017-12-01 10:41:03.545 UTC [endorser] ProcessProposal -> DEBU 2f9 Entry
peer0.company.org      | 2017-12-01 10:41:03.545 UTC [protoutils] ValidateProposalMessage -> DEBU 2fa ValidateProposalMessage starts for signed proposal 0xc42177e420
peer0.company.org      | 2017-12-01 10:41:03.545 UTC [protoutils] validateChannelHeader -> DEBU 2fb validateChannelHeader info: header type 3
peer0.company.org      | 2017-12-01 10:41:03.545 UTC [protoutils] checkSignatureFromCreator -> DEBU 2fc checkSignatureFromCreator starts
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [protoutils] checkSignatureFromCreator -> DEBU 2fd checkSignatureFromCreator info: creator is &{DCMSP 47c36cc8e5813d60b506bf2f8757150a0ee044e386f271d8f7df23626c0c3131}
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [protoutils] checkSignatureFromCreator -> DEBU 2fe checkSignatureFromCreator info: creator is valid
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [protoutils] checkSignatureFromCreator -> DEBU 2ff checkSignatureFromCreator exists successfully
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [protoutils] validateChaincodeProposalMessage -> DEBU 300 validateChaincodeProposalMessage starts for proposal 0xc420307400, header 0xc42177e450
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [protoutils] validateChaincodeProposalMessage -> DEBU 301 validateChaincodeProposalMessage info: header extension references chaincode name:"lscc"
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [endorser] ProcessProposal -> DEBU 302 processing txid: 2c90caa144141c930234edc062ab6c2f85df97905bc4596ed8f425eecaf88bb6
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [fsblkstorage] retrieveTransactionByID -> DEBU 303 retrieveTransactionByID() - txId = [2c90caa144141c930234edc062ab6c2f85df97905bc4596ed8f425eecaf88bb6]
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [lockbasedtxmgr] NewTxSimulator -> DEBU 304 constructing new tx simulator
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [lockbasedtxmgr] newLockBasedTxSimulator -> DEBU 305 constructing new tx simulator [7ee0c1a2-4569-49a4-bbca-dd6eb4b6688e]
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [endorser] simulateProposal -> DEBU 306 Entry - txid: 2c90caa144141c930234edc062ab6c2f85df97905bc4596ed8f425eecaf88bb6 channel id: super-channel
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [endorser] callChaincode -> DEBU 307 Entry - txid: 2c90caa144141c930234edc062ab6c2f85df97905bc4596ed8f425eecaf88bb6 channel id: super-channel version: 1.0.0
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [ccprovider] NewCCContext -> DEBU 308 NewCCCC (chain=super-channel,chaincode=lscc,version=1.0.0,txid=2c90caa144141c930234edc062ab6c2f85df97905bc4596ed8f425eecaf88bb6,syscc=true,proposal=0xc420307400,canname=lscc:1.0.0
peer0.company.org      | 2017-12-01 10:41:03.546 UTC [chaincode] Launch -> DEBU 309 chaincode is running(no need to launch) : lscc:1.0.0
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] Execute -> DEBU 30a Entry
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] Execute -> DEBU 30b chaincode canonical name: lscc:1.0.0
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] sendExecuteMessage -> DEBU 30c [2c90caa1]Inside sendExecuteMessage. Message TRANSACTION
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] setChaincodeProposal -> DEBU 30d Setting chaincode proposal context...
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] setChaincodeProposal -> DEBU 30e Proposal different from nil. Creating chaincode proposal context...
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] sendExecuteMessage -> DEBU 30f [2c90caa1]sendExecuteMsg trigger event TRANSACTION
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] processStream -> DEBU 310 [2c90caa1]Move state message TRANSACTION
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] HandleMessage -> DEBU 311 [2c90caa1]Fabric side Handling ChaincodeMessage of type: TRANSACTION in state ready
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] filterError -> DEBU 312 Ignoring NoTransitionError: no transition
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] processStream -> DEBU 313 [2c90caa1]sending state message TRANSACTION
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] func1 -> DEBU 314 [2c90caa1]Received message TRANSACTION from shim
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] handleMessage -> DEBU 315 [2c90caa1]Handling ChaincodeMessage of type: TRANSACTION(state:ready)
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] beforeTransaction -> DEBU 316 [2c90caa1]Received TRANSACTION, invoking transaction on chaincode(Src:ready, Dst:ready)
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] handleGetState -> DEBU 317 [2c90caa1]Sending GET_STATE
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] processStream -> DEBU 318 [2c90caa1]Received message GET_STATE from shim
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] HandleMessage -> DEBU 319 [2c90caa1]Fabric side Handling ChaincodeMessage of type: GET_STATE in state ready
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] afterGetState -> DEBU 31a [2c90caa1]Received GET_STATE, invoking get state from ledger
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] filterError -> DEBU 31b Ignoring NoTransitionError: no transition
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] func1 -> DEBU 31c [2c90caa1] getting state for chaincode lscc, key test_cc_go, channel super-channel
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [stateleveldb] GetState -> DEBU 31d GetState(). ns=lscc, key=test_cc_go
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] func1 -> DEBU 31e [2c90caa1]No state associated with key: test_cc_go. Sending RESPONSE with an empty payload
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [chaincode] 1 -> DEBU 31f [2c90caa1]handleGetState serial send RESPONSE
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] func1 -> DEBU 320 [2c90caa1]Received message RESPONSE from shim
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] handleMessage -> DEBU 321 [2c90caa1]Handling ChaincodeMessage of type: RESPONSE(state:ready)
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] sendChannel -> DEBU 322 [2c90caa1]before send
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] sendChannel -> DEBU 323 [2c90caa1]after send
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] afterResponse -> DEBU 324 [2c90caa1]Received RESPONSE, communicated (state:ready)
peer0.company.org      | 2017-12-01 10:41:03.547 UTC [shim] handleGetState -> DEBU 325 [2c90caa1]GetState received payload RESPONSE
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] handlePutState -> DEBU 326 [2c90caa1]Inside putstate
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] handlePutState -> DEBU 327 [2c90caa1]Sending PUT_STATE
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] processStream -> DEBU 328 [2c90caa1]Received message PUT_STATE from shim
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] HandleMessage -> DEBU 329 [2c90caa1]Fabric side Handling ChaincodeMessage of type: PUT_STATE in state ready
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] filterError -> DEBU 32a Ignoring NoTransitionError: no transition
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] func1 -> DEBU 32b [2c90caa1]state is ready
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] func1 -> DEBU 32c [2c90caa1]Completed PUT_STATE. Sending RESPONSE
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] 1 -> DEBU 32d [2c90caa1]enterBusyState trigger event RESPONSE
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] processStream -> DEBU 32e [2c90caa1]Move state message RESPONSE
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] HandleMessage -> DEBU 32f [2c90caa1]Fabric side Handling ChaincodeMessage of type: RESPONSE in state ready
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] filterError -> DEBU 330 Ignoring NoTransitionError: no transition
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] processStream -> DEBU 331 [2c90caa1]sending state message RESPONSE
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] func1 -> DEBU 332 [2c90caa1]Received message RESPONSE from shim
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] handleMessage -> DEBU 333 [2c90caa1]Handling ChaincodeMessage of type: RESPONSE(state:ready)
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] sendChannel -> DEBU 334 [2c90caa1]before send
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] sendChannel -> DEBU 335 [2c90caa1]after send
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] handlePutState -> DEBU 336 [2c90caa1]Received RESPONSE. Successfully updated state
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] afterResponse -> DEBU 337 [2c90caa1]Received RESPONSE, communicated (state:ready)
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] func1 -> DEBU 338 [2c90caa1]Transaction completed. Sending COMPLETED
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] func1 -> DEBU 339 [2c90caa1]Move state message COMPLETED
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] handleMessage -> DEBU 33a [2c90caa1]Handling ChaincodeMessage of type: COMPLETED(state:ready)
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [shim] func1 -> DEBU 33b [2c90caa1]send state message COMPLETED
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] processStream -> DEBU 33c [2c90caa1]Received message COMPLETED from shim
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] HandleMessage -> DEBU 33d [2c90caa1]Fabric side Handling ChaincodeMessage of type: COMPLETED in state ready
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] HandleMessage -> DEBU 33e [2c90caa144141c930234edc062ab6c2f85df97905bc4596ed8f425eecaf88bb6]HandleMessage- COMPLETED. Notify
peer0.company.org      | 2017-12-01 10:41:03.548 UTC [chaincode] notify -> DEBU 33f notifying Txid:2c90caa144141c930234edc062ab6c2f85df97905bc4596ed8f425eecaf88bb6
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [chaincode] Execute -> DEBU 340 Exit
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [ccprovider] NewCCContext -> DEBU 341 NewCCCC (chain=super-channel,chaincode=test_cc_go,version=0.0.1,txid=2c90caa144141c930234edc062ab6c2f85df97905bc4596ed8f425eecaf88bb6,syscc=false,proposal=0xc420307400,canname=test_cc_go:0.0.1
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [chaincode] Launch -> DEBU 342 launchAndWaitForRegister fetched 1587 bytes from file system
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [chaincode] getArgsAndEnv -> DEBU 343 Executable is chaincode
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [chaincode] getArgsAndEnv -> DEBU 344 Args [chaincode -peer.address=peer0.company.org:7051]
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [chaincode] launchAndWaitForRegister -> DEBU 345 start container: test_cc_go:0.0.1(networkid:dev,peerid:peer0.company.org)
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [chaincode] launchAndWaitForRegister -> DEBU 346 start container with args: chaincode -peer.address=peer0.company.org:7051
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [chaincode] launchAndWaitForRegister -> DEBU 347 start container with env:
peer0.company.org      |    CORE_CHAINCODE_ID_NAME=test_cc_go:0.0.1
peer0.company.org      |    CORE_PEER_TLS_ENABLED=true
peer0.company.org      |    CORE_CHAINCODE_LOGGING_LEVEL=debug
peer0.company.org      |    CORE_CHAINCODE_LOGGING_SHIM=debug
peer0.company.org      |    CORE_CHAINCODE_LOGGING_FORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [container] lockContainer -> DEBU 348 waiting for container(dev-peer0.company.org-test_cc_go-0.0.1) lock
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [container] lockContainer -> DEBU 349 got container (dev-peer0.company.org-test_cc_go-0.0.1) lock
peer0.company.org      | 2017-12-01 10:41:03.549 UTC [dockercontroller] Start -> DEBU 34a Cleanup container dev-peer0.company.org-test_cc_go-0.0.1
peer0.company.org      | 2017-12-01 10:41:03.550 UTC [dockercontroller] stopInternal -> DEBU 34b Stop container dev-peer0.company.org-test_cc_go-0.0.1(Container not running: dev-peer0.company.org-test_cc_go-0.0.1)
peer0.company.org      | 2017-12-01 10:41:03.550 UTC [dockercontroller] stopInternal -> DEBU 34c Kill container dev-peer0.company.org-test_cc_go-0.0.1 (API error (500): {"message":"Cannot kill container dev-peer0.company.org-test_cc_go-0.0.1: Container 935c3c20aca77b6a8a398aea553e524a734a30f6dfceab5fd4ca4683b3e1eb8f is not running"}
peer0.company.org      | )
peer0.company.org      | 2017-12-01 10:41:03.611 UTC [dockercontroller] stopInternal -> DEBU 34d Removed container dev-peer0.company.org-test_cc_go-0.0.1
peer0.company.org      | 2017-12-01 10:41:03.611 UTC [dockercontroller] Start -> DEBU 34e Start container dev-peer0.company.org-test_cc_go-0.0.1
peer0.company.org      | 2017-12-01 10:41:03.611 UTC [dockercontroller] getDockerHostConfig -> DEBU 34f docker container hostconfig NetworkMode: compose_default
peer0.company.org      | 2017-12-01 10:41:03.612 UTC [dockercontroller] createContainer -> DEBU 350 Create container: dev-peer0.company.org-test_cc_go-0.0.1
peer0.company.org      | 2017-12-01 10:41:03.754 UTC [dockercontroller] createContainer -> DEBU 351 Created container: dev-peer0.company.org-test_cc_go-0.0.1
peer0.company.org      | 2017-12-01 10:41:04.514 UTC [dockercontroller] Start -> ERRO 352 start-could not start container: API error (404): {"message":"oci runtime error: container_linux.go:247: starting container process caused "exec: \"chaincode\": executable file not found in $PATH"
"}
peer0.company.org      | 2017-12-01 10:41:04.514 UTC [container] unlockContainer -> DEBU 353 container lock deleted(dev-peer0.company.org-test_cc_go-0.0.1)
peer0.company.org      | 2017-12-01 10:41:04.514 UTC [chaincode] Launch -> ERRO 354 launchAndWaitForRegister failed Error starting container: API error (404): {"message":"oci runtime error: container_linux.go:247: starting container process caused "exec: \"chaincode\": executable file not found in $PATH"
"}
peer0.company.org      | 2017-12-01 10:41:04.514 UTC [endorser] callChaincode -> DEBU 355 Exit
peer0.company.org      | 2017-12-01 10:41:04.514 UTC [endorser] simulateProposal -> ERRO 356 failed to invoke chaincode name:"lscc"  on transaction 2c90caa144141c930234edc062ab6c2f85df97905bc4596ed8f425eecaf88bb6, error: Error starting container: API error (404): {"message":"oci runtime error: container_linux.go:247: starting container process caused "exec: \"chaincode\": executable file not found in $PATH"
"}

如果有人能给我一些指导,那将不胜感激!提前谢谢!

If anyone can give me some direction, that would greatly be appreciated! Thank you in advance!

链码是这样放在对等节点上的:

Here's how the chaincode is put on the peers:

链代码源位于 /etc/hyperledger/chaincode/src/super/test_cc/test_cc.go 我正在使用 client.sendInstallProposal(installProposalRequest, company.getPeers()); 命令将其发送给对等方.以下是安装提案的外观以及对等方的响应之后的外观:

The chaincode source is located at /etc/hyperledger/chaincode/src/super/test_cc/test_cc.go and I'm using the client.sendInstallProposal(installProposalRequest, company.getPeers()); command to send it to the peers. Here's how the install proposal looks and how the peers' reponses look afterwards:

2017-12-03 17:08:25 INFO  HyperledgerConfigurator:326 - Installing super.chaincode as company into channel super-channel
tomcat              | 2017-12-03 17:08:25 DEBUG HyperledgerConfigurator:330 - Chaincode source path: /etc/hyperledger/chaincode/
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:24 - org.hyperledger.fabric.sdk.InstallProposalRequest
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:41 -   getChaincodeSourceLocation: 
tomcat              | /etc/hyperledger/chaincode
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:38 -   getChaincodeInputStream: null
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:33 -   getProposalWaitTime: 20000
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:33 -   getChaincodeName: test_cc_go
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:33 -   getChaincodePath: super/test_cc
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:33 -   getChaincodeVersion: 0.0.1
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:38 -   getChaincodeEndorsementPolicy: null
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:38 -   getTransientMap: null
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:33 -   getChaincodeLanguage: GO_LANG
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:43 -   getChaincodeID:
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:24 -     org.hyperledger.fabric.sdk.ChaincodeID
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:41 -       getFabricChaincodeID: 
tomcat              | path: "super/test_cc"
tomcat              | name: "test_cc_go"
tomcat              | version: "0.0.1"
tomcat              | 
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:33 -       getVersion: 0.0.1
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:33 -       getName: test_cc_go
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:33 -       getPath: super/test_cc
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:31 -   getFcn: null
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:38 -   getArgBytes: null
tomcat              | 2017-12-03 17:08:25 DEBUG Debug:38 -   getArgs: null
tomcat              | 2017-12-03 17:08:25 DEBUG HyperledgerConfigurator:350 - Sending chaincode installation request...
...
tomcat              | 2017-12-03 17:08:25 DEBUG HyperledgerConfigurator:361 - Responses:
tomcat              | 2017-12-03 17:08:25 DEBUG HyperledgerConfigurator:363 - TransactionID: fd72977b40808609e781cd658454f7753599ec8c27f61acb4629fae4dc520e10, peer: peer0.company.org, decision: SUCCESS
tomcat              | 2017-12-03 17:08:25 DEBUG HyperledgerConfigurator:363 - TransactionID: fd72977b40808609e781cd658454f7753599ec8c27f61acb4629fae4dc520e10, peer: peer1.company.org, decision: SUCCESS

peer 的链码位于 /var/hyperledger/production/chaincodes/test_cc_go.0.0.1,但这不在其路径 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.它也不是它试图调用的 chaincode.

The chaincode of the peer is found at /var/hyperledger/production/chaincodes/test_cc_go.0.0.1, but this is not in its path /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. It's also not called chaincode which it tries to call.

推荐答案

原来我的链码使用了依赖项(在我的例子中是 scrypt),这导致构建失败.该代码将通过其单元测试并正常编译,但因此无法在对等设备上运行.您可能希望将 go 依赖项安装到 ccenv(用于编译链代码)上,或者在我的情况下,我放弃了它,转而支持 Hyperledger Fabric 1.1 的内置加密支持.

Turns out my chaincode used a dependency (scrypt in my case), which caused the build to fail. The code would pass its unit test and compile just fine, but it wouldn't run on peers because of this. You may want to install your go dependencies onto your ccenv (which is used to compile your chaincode), or in my case I ditched it in favor of Hyperledger Fabric 1.1's built-in encryption support.

这篇关于向对等方发送 Hyperledger Fabric 的链码实例化请求时出现 OCI 运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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