Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instantiate chaincodes Error #137

Closed
bitpeng opened this issue Jul 18, 2018 · 11 comments
Closed

instantiate chaincodes Error #137

bitpeng opened this issue Jul 18, 2018 · 11 comments

Comments

@bitpeng
Copy link
Contributor

bitpeng commented Jul 18, 2018

root@ubuntu:/smbshare/caliper# node benchmark/simple/main.js
TAP version 13

#######Caliper Test######

docker-compose -f network/fabric/simplenetwork/docker-compose.yaml up -d
Creating network "simplenetwork_default" with the default driver
Creating orderer.example.com
Creating ca_peerOrg1
Creating simplenetwork_peer_1
Creating ca_peerOrg2
Creating simplenetwork_ca_1
Creating peer1.org2.example.com
Creating peer1.org1.example.com
Creating peer0.org1.example.com
Creating peer0.org2.example.com

create mychannel......

ok 1 created mychannel successfully

Sleep 5s......

Join channel......

join mychannel

ok 2 Successfully joined mychannel

install all chaincodes......

info: [packager/Golang.js]: packaging GOLANG from contract/fabric/simple/go
info: [packager/Golang.js]: packaging GOLANG from contract/fabric/simple/go
ok 3 Installed chaincode simple successfully in all peers

Instantiate chaincode......

error: [Peer.js]: sendProposal - timed out after:120000
error: [Peer.js]: sendProposal - timed out after:120000
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/smbshare/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/smbshare/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
error: [Peer.js]: sendProposal - timed out after:120000
error: [Peer.js]: sendProposal - timed out after:120000
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/smbshare/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/smbshare/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
not ok 4 Failed to instantiate chaincodes, Error: Failed to send instantiate due to error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting... at Client.newDefaultKeyValueStore.then.then.then.then (/smbshare/caliper/src/fabric/e2eUtils.js:375:19) at at process._tickCallback (internal/process/next_tick.js:188:7) at Client.newDefaultKeyValueStore.then.then.then.then.then (/smbshare/caliper/src/fabric/e2eUtils.js:388:15) at at process._tickCallback (internal/process/next_tick.js:188:7)

operator: fail
at: chaincodes.reduce.then.catch (/smbshare/caliper/src/fabric/instantiate-chaincode.js:60:19)
stack: |-
  Error: Failed to instantiate chaincodes, Error: Failed to send instantiate due to error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting...
      at Client.newDefaultKeyValueStore.then.then.then.then (/smbshare/caliper/src/fabric/e2eUtils.js:375:19)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)
      at Client.newDefaultKeyValueStore.then.then.then.then.then (/smbshare/caliper/src/fabric/e2eUtils.js:388:15)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)
      at Test.assert [as _assert] (/smbshare/caliper/node_modules/tape/lib/test.js:224:54)
      at Test.bound [as _assert] (/smbshare/caliper/node_modules/tape/lib/test.js:76:32)
      at Test.fail (/smbshare/caliper/node_modules/tape/lib/test.js:317:10)
      at Test.bound [as fail] (/smbshare/caliper/node_modules/tape/lib/test.js:76:32)
      at chaincodes.reduce.then.catch (/smbshare/caliper/src/fabric/instantiate-chaincode.js:60:19)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

...
fabric.installSmartContract() failed, Error: Fabric: instantiate chaincodes failed
at chaincodes.reduce.then.catch (/smbshare/caliper/src/fabric/instantiate-chaincode.js:61:31)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
[Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0
unexpected error, Error: Fabric: instantiate chaincodes failed
at chaincodes.reduce.then.catch (/smbshare/caliper/src/fabric/instantiate-chaincode.js:61:31)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
docker-compose -f network/fabric/simplenetwork/docker-compose.yaml down;docker rm $(docker ps -aq);docker rmi $(docker images dev* -q)

@aklenik
Copy link
Contributor

aklenik commented Jul 18, 2018

Based on the default settings you use for the benchmark, you are running 7 nodes/containers (1 orderer, 2 CAs, 4 peers) on the same physical machine. If that machine is not "strong" enough (the containers interfere with each other due to the common physical resource), 2 minutes won't be enough to instantiate a chaincode (which involves building a docker image, and running the chaincode Init function on each peer).

Try increasing the timeout value. Unfortunately, it is currently hard-coded, so you have to modify this line.

@bitpeng
Copy link
Contributor Author

bitpeng commented Jul 18, 2018

@aklenik thanks a lot, your kind help came to my rescue.

@OC0311
Copy link

OC0311 commented Sep 5, 2018

@aklenik I tried to add up to six minutes, but time out came. Is there any other reason for this problem?

@caohuilong
Copy link

@aklenik I tried to add up to six minutes, but time out came. Is there any other reason for this problem?

I set up the caliper environment in a VM. I meet the same problem and can't solve it according to your advise. @aklenik

@aklenik
Copy link
Contributor

aklenik commented Oct 8, 2018

@PoormaJin @cao0507 The timeout error can also mean that an error occurred in your chaincode Init function. Take a look at the chaincode logs: docker logs dev-something
For some reason, this hangs the execution and times out (for Fabric v1.1 at least).

@caohuilong
Copy link

@PoormaJin @cao0507 The timeout error can also mean that an error occurred in your chaincode Init function. Take a look at the chaincode logs: docker logs dev-something
For some reason, this hangs the execution and times out (for Fabric v1.1 at least).

Thank you for your reply, but I have solved the problem. My problem maybe result from the pre-requisites, when i install the node-gyp correctly the benchmark run successfully.

@revobd
Copy link

revobd commented Oct 16, 2018

@PoormaJin @cao0507 The timeout error can also mean that an error occurred in your chaincode Init function. Take a look at the chaincode logs: docker logs dev-something
For some reason, this hangs the execution and times out (for Fabric v1.1 at least).

Thank you for your reply, but I have solved the problem. My problem maybe result from the pre-requisites, when i install the node-gyp correctly the benchmark run successfully.

How did you install node-gyp? I am facing the same issue during instantiation of chaincode.

@caohuilong
Copy link

@revobd
$ npm install -g node-gyp

@revobd
Copy link

revobd commented Oct 16, 2018

@revobd
$ npm install -g node-gyp

Thanks. I did that but still had the same issue. It finally worked after doubling the timeout.

@nurhazbiy
Copy link

for newer version (caliper 0.3.2) how do i change the timeout?

@aklenik
Copy link
Contributor

aklenik commented Jul 28, 2020

@nurhazbiy Here are the config keys you can set for the Fabric adapter: https://hyperledger.github.io/caliper/v0.3.2/runtime-config/#fabric-adapter-settings
You need caliper-fabric-timeout-chaincodeinstantiate, and the one after probably. The peers also have a timeout setting, you should check those too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants