hyperledger-caliper / caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
https://hyperledger-caliper.github.io/caliper/
Apache License 2.0
654 stars 403 forks source link

error: [Peer.js]: sendProposal - timed out after:480000 #262

Closed conquerorAlex closed 5 years ago

conquerorAlex commented 5 years ago

I just run the latest version of caliper using goleveldb, but it doesn't work. The command that I used is: npm test -- simple -c benchmark/simple/config.yaml -n network/fabric-v1.1/2org2peergoleveldb/fabric-go.json. Does it used wrong way?

The log as follows: root@host3:~/gopath/src/github.com/hyperledger/caliper# npm test -- simple -c benchmark/simple/config.yaml -n network/fabric -v1.1/2org2peergoleveldb/fabric-go.json

caliper@0.1.0 test /root/gopath/src/github.com/hyperledger/caliper npm run lint && npm run nyc && npm run e2e "simple" "-c" "benchmark/simple/config.yaml" "-n" "network/fabric-v1.1/2org2peergoleveldb/fabric-go.json"

caliper@0.1.0 lint /root/gopath/src/github.com/hyperledger/caliper npx eslint .

caliper@0.1.0 nyc /root/gopath/src/github.com/hyperledger/caliper nyc mocha --recursive -t 10000

fixedRate controller implementation

init

  ✓ should set the sleep time for a single client if no clients are specified
  ✓ should set the sleep time for a single client
  ✓ should set the sleep time for multiple clients
  ✓ should set the sleep time to zero if 0 tps specified
#applyRateControl
  ✓ should sleep for the full ammount of time if there is zero elapsed time
  ✓ should reduce the sleep time based on the elapsed time difference
  ✓ should not sleep if the elapsed time difference is below the 5ms threshold
  ✓ should not sleep if the sleepTime is zero

pidRate controller implementation

init

  ✓ should set all gain values from constructor options
  ✓ should set a default sleep if no starting tps is provided
  ✓ should set logging if showVars option is provided
  ✓ should not set logging if no log option is provided
#applyRateControl
  logging actions
    ✓ should provide logging if log option is set to be true
    ✓ should not provide logging if log option is not set
    ✓ should not provide logging if log option is set to be false
  sleep actions
    ✓ should not modify sleep time if no load error and isolated proportional gain
    ✓ should reduce sleep time if negative load error and isolated proportional gain
    ✓ should increase sleep time if positive load error and isolated proportional gain
    ✓ should not modify sleep time if no integral error and isolated integral gain
    ✓ should reduce sleep time if negative integral error and isolated integral gain
    ✓ should increase sleep time if positive integral error and isolated integral gain
    ✓ should not modify sleep time if no derivative error and isolated derivative gain
    ✓ should reduce sleep time if negative derivative error and isolated derivative gain
    ✓ should increase sleep time if positive derivative error and isolated derivative gain
    ✓ should sleep if above the 5ms threshold
    ✓ should not sleep if below the 5ms threshold

BatchBuilderFactory implementation

getBatchBuilder

  ✓ should error with no batch builders defined
  ✓ should error if there is no matching family
  ✓ should error if there is no matching family+version
  ✓ should alter version v0 to 1.0
  ✓ should error if unable to import the file
  ✓ should be able to return a batch builder

32 passing (20ms)

=============================== Coverage summary =============================== Statements : 5.67% ( 67/1181 ) Branches : 7.39% ( 26/352 ) Functions : 4.42% ( 10/226 ) Lines : 5.72% ( 67/1171 )

caliper@0.1.0 e2e /root/gopath/src/github.com/hyperledger/caliper node ./scripts/test.js "simple" "benchmark/simple/config.yaml" "network/fabric-v1.1/2org2peergoleveldb/fabric-go.json"

info: [bench-flow.js]: ####### Caliper Test ###### info: [bench-flow.js]: Executing command: docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s Creating network "2org1peergoleveldb_default" with the default driver Creating orderer.example.com ... done Creating ca.org2.example.com ... done Creating ca.org1.example.com ... done Creating peer0.org1.example.com ... done Creating peer0.org2.example.com ... done info: [create-channel.js]: Creating mychannel... info: [create-channel.js]: Created mychannel successfully info: [create-channel.js]: Sleeping 5s... info: [join-channel.js]: Joining channels... info: [join-channel.js]: Joining mychannel... info: [join-channel.js]: Successfully joined peerOrg1's peers to mychannel info: [join-channel.js]: Successfully joined peerOrg2's peers to mychannel info: [join-channel.js]: Successfully joined mychannel info: [install-chaincode.js]: Installing chaincodes... info: [packager/Node.js]: packaging Node from /root/gopath/src/github.com/hyperledger/caliper/src/contract/fabric/marbles-norichquery/node info: [packager/Node.js]: packaging Node from /root/gopath/src/github.com/hyperledger/caliper/src/contract/fabric/marbles-norichquery/node info: [install-chaincode.js]: Installed chaincode marbles successfully in all peers info: [packager/Node.js]: packaging Node from /root/gopath/src/github.com/hyperledger/caliper/src/contract/fabric/simple/node info: [packager/Node.js]: packaging Node from /root/gopath/src/github.com/hyperledger/caliper/src/contract/fabric/simple/node info: [install-chaincode.js]: Installed chaincode simple successfully in all peers info: [instantiate-chaincode.js]: Instantiating chaincodes...

error: [Peer.js]: sendProposal - timed out after:480000 error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT at Timeout._onTimeout (/root/gopath/src/github.com/hyperledger/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: [instantiate-chaincode.js]: Failed to instantiate chaincodes: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. at Object.instantiateChaincode (/root/gopath/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:353:19) at at process._tickCallback (internal/process/next_tick.js:189:7) error: [fabric.js]: Fabric chaincode install failed: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. at Object.instantiateChaincode (/root/gopath/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:353:19) at at process._tickCallback (internal/process/next_tick.js:189:7) error: [bench-flow.js]: Error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. at Object.instantiateChaincode (/root/gopath/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:353:19) at at process._tickCallback (internal/process/next_tick.js:189:7) info: [demo.js]: [Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0 info: [bench-flow.js]: Executing command: docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose-tls.yaml down;docker rm $(docker ps -aq);docker rmi $(docker images dev* -q) Stopping peer0.org1.example.com ... done Stopping peer0.org2.example.com ... done Stopping ca.org2.example.com ... done Stopping ca.org1.example.com ... done Stopping orderer.example.com ... done Removing peer0.org1.example.com ... done Removing peer0.org2.example.com ... done Removing ca.org2.example.com ... done Removing ca.org1.example.com ... done

houqinghui commented 5 years ago

@lenoAlex have you solved your problem? the error is "failed to instantiate chaincodes, failed to send instantiate proposal or receive valid response response null or status is not 200" please run the command again, if the error still appear, please check the version of grpc, make the verison is 1.10.1

conquerorAlex commented 5 years ago

@houqinghui the versions of libraries are:

npm list grpc caliper@0.1.0 /root/gopath/src/github.com/hyperledger/caliper ├─┬ fabric-client@1.1.0 │ └── grpc@1.10.1 deduped └── grpc@1.10.1 npm list fabric-client caliper@0.1.0 /root/gopath/src/github.com/hyperledger/caliper └── fabric-client@1.1.0 npm list fabric-ca-client caliper@0.1.0 /root/gopath/src/github.com/hyperledger/caliper └── fabric-ca-client@1.1.0

After running the same command again, the error still appear. And the strange thing is there is only two peers of docker created and running, as you can seen in logs.

info: [bench-flow.js]: ####### Caliper Test ###### info: [bench-flow.js]: Executing command: docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s Creating ca.org1.example.com ... done Creating orderer.example.com ... done Creating ca.org2.example.com ... done Creating peer0.org2.example.com ... done Creating peer0.org1.example.com ... done info: [create-channel.js]: Creating mychannel... info: [create-channel.js]: Created mychannel successfully info: [create-channel.js]: Sleeping 5s... info: [join-channel.js]: Joining channels... info: [join-channel.js]: Joining mychannel... info: [join-channel.js]: Successfully joined peerOrg1's peers to mychannel info: [join-channel.js]: Successfully joined peerOrg2's peers to mychannel info: [join-channel.js]: Successfully joined mychannel info: [install-chaincode.js]: Installing chaincodes... info: [packager/Node.js]: packaging Node from /root/gopath/src/github.com/hyperledger/caliper/src/contract/fabric/marbles-norichquery/node info: [packager/Node.js]: packaging Node from /root/gopath/src/github.com/hyperledger/caliper/src/contract/fabric/marbles-norichquery/node info: [install-chaincode.js]: Installed chaincode marbles successfully in all peers info: [packager/Node.js]: packaging Node from /root/gopath/src/github.com/hyperledger/caliper/src/contract/fabric/simple/node info: [packager/Node.js]: packaging Node from /root/gopath/src/github.com/hyperledger/caliper/src/contract/fabric/simple/node info: [install-chaincode.js]: Installed chaincode simple successfully in all peers info: [instantiate-chaincode.js]: Instantiating chaincodes...

aklenik commented 5 years ago

@lenoAlex Timeout also occurs if there was an error during chaincode instantiation. Please ensure that there are no leftover Docker containers and chaincode Docker images (the end script should take care of this).

Then, while you're waiting for the instantiation (but before the timeout), take a look at the container logs of one of the chaincode containers: docker logs dev<something> and its corresponding peer.

houqinghui commented 5 years ago

@lenoAlex i came accross the same question, follow the below steps that solve my problem.

  1. run docker ps to check the running docker containers.
  2. run docker rm all the docker names to delete the running docker containers.
  3. run the caliper.
conquerorAlex commented 5 years ago

@houqinghui @aklenik after updating to the latest version, the testing successful.

conquerorAlex commented 5 years ago

it is strange that the timeout problem occurs casually. Sometimes, the testing running successful, but others failed. the version of caliper used for testing is the latest. And others as follows: caliper@0.1.0 /root/gopath/src/github.com/hyperledger/caliper ├─┬ fabric-client@1.1.0 │ └── grpc@1.10.1 deduped └── grpc@1.10.1 caliper@0.1.0 /root/gopath/src/github.com/hyperledger/caliper └── fabric-ca-client@1.1.0

conquerorAlex commented 5 years ago

after replacing "src/contract/fabric/simple/node" to "contract/fabric/simple/go" of the chaincode, the problem solved. as for the reason why chaincode is node type causes casually testing failed is still not clear.

panyu4 commented 5 years ago

Issues #165 gives the answer. Just run npm install -g node-gyp node-pre-gyp before you use command node benchmark/simple/main.js to run the simple test. If you still have doubt on it, feel free to open it again.