hyperledger / caliper

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

error: [caliper-flow]: Error: when run /packages/caliper-tests-integration/scripts/run-integration-tests.sh #490

Closed jiafeimao-gjf closed 5 years ago

jiafeimao-gjf commented 5 years ago

log

error: [caliper-flow]: Error: Error: Invalid endorsement for marbles@v0 in mychannel from peer0.org1.example.com: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "`

Context

`Benchmark for target Blockchain type fabric-ccp about to start info: [caliper-flow]: ####### Caliper Test ####### info: [caliper-utils]: Executing command: cd /Users/gujiafei1104/Documents/software_package/go_project/src/github.com/hyperledger/caliper/packages/caliper-samples;docker-compose -f network/fabric-v1.4/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s Creating network "2org1peercouchdb_default" with the default driver Creating orderer.example.com ... done Creating ca.org2.example.com ... done Creating couchdb.org2.example.com ... done Creating couchdb.org1.example.com ... done Creating ca.org1.example.com ... done Creating peer0.org1.example.com ... done Creating peer0.org2.example.com ... done info: [adapters/fabric-ccp]: Fabric SDK version: 1.4.3; TLS: none info: [adapters/fabric-ccp]: Org1's registrar enrolled successfully info: [adapters/fabric-ccp]: Org2's registrar enrolled successfully info: [adapters/fabric-ccp]: Org1's admin's materials are successfully loaded info: [adapters/fabric-ccp]: Org2's admin's materials are successfully loaded info: [adapters/fabric-ccp]: client0.org1.example.com's materials are successfully loaded info: [adapters/fabric-ccp]: client0.org2.example.com's materials are successfully loaded info: [adapters/fabric-ccp]: Channel 'mychannel' definiton being generated from description info: [adapters/fabric-ccp]: Channel 'mychannel' successfully created info: [adapters/fabric-ccp]: Sleeping 5s... info: [adapters/fabric-ccp]: Org1's peers successfully joined mychannel: peer0.org1.example.com info: [adapters/fabric-ccp]: Org2's peers successfully joined mychannel: peer0.org2.example.com info: [adapters/fabric-ccp]: Sleeping 5s... info: [adapters/fabric-ccp]: Installing chaincodes for mychannel... info: [adapters/fabric-ccp]: marbles@v0 successfully installed on Org1's peers: peer0.org1.example.com info: [adapters/fabric-ccp]: marbles@v0 successfully installed on Org2's peers: peer0.org2.example.com info: [adapters/fabric-ccp]: simple@v0 successfully installed on Org1's peers: peer0.org1.example.com info: [adapters/fabric-ccp]: simple@v0 successfully installed on Org2's peers: peer0.org2.example.com info: [adapters/fabric-ccp]: Instantiating marbles@v0 in mychannel. This might take some time... error: [caliper-flow]: Error: Error: Invalid endorsement for marbles@v0 in mychannel from peer0.org1.example.com: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "

Expected Behavior

complete Instantiating marbles@v0 in mychannel.

Actual Behavior

error: [caliper-flow]: Error: Error: Invalid endorsement for marbles@v0 in mychannel from peer0.org1.example.com: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "

Possible Fix

next log:

@ampretia/x509@0.4.0 install /chaincode/output/node_modules/@ampretia/x509 node-gyp rebuild

gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:449:14) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:353:11 gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:69:16) gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:81:29) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:90:16 gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5 gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15) gyp ERR! System Linux 4.9.125-linuxkit gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /chaincode/output/node_modules/@ampretia/x509 gyp ERR! node -v v6.9.5 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok marbles@1.0.0 /chaincode/output

Steps to Reproduce

  1. Go into caliper root dir
  2. run three commands: npm install, npm run repoclean, npm run bootstrap\
  3. run export BENCHMARK=fabric-ccp
  4. run ./packages/caliper-tests-integration/scripts/run-integration-tests.sh

Existing issues

none

Context

I want to learn about this tool, so I run the demo at first,then the error appears. If the demo pass, I will test my blockchian sulotion with this tool.

Your Environment

aklenik commented 5 years ago

@jiafeimao-gjf This looks like a Fabric-side error, so you'll need to look at the container logs for details. Which are currently torn down automatically by the network config's end script :) To prevent that, add --caliper-core-skipendscript to the end of this line: https://github.com/hyperledger/caliper/blob/27ec5f94e70a4cb3856f2b1dfd26b3e2f95b087f/packages/caliper-tests-integration/scripts/run-integration-tests.sh#L66

You don't need to run the script again, the CLI is already installed at that point, so just run this from the root of the repo:

caliper benchmark run -c benchmark/simple/config.yaml -n network/fabric-v1.4/2org1peergoleveldb/fabric-ccp-go.yaml -w ./packages/caliper-samples/ --caliper-core-skipendscript

(I used a goleveldb-based network above, it's more lightweight) After the error, run docker logs peer0.org1.example.com

jiafeimao-gjf commented 5 years ago

retry

@aklenik As you said, I add --caliper-core-skipendscript to run :

caliper benchmark run -c benchmark/simple/config.yaml -n network/fabric-v1.4/2org1peergoleveldb/fabric-ccp-go.yaml -w ./packages/caliper-samples/ --caliper-core-skipendscript

but error below:

info: [adapters/fabric-ccp]: Instantiating marbles@v0 in mychannel. This might take some time... error: [caliper-flow]: Error: Error: Invalid endorsement for marbles@v0 in mychannel from peer0.org1.example.com: failed to execute transaction 0c4e3a720591c4938c89d47ef005270471201753edef7b7b4b73cd0384a4b549: error sending: timeout expired while executing transaction at proposalResponses.forEach (/usr/local/lib/node_modules/caliper-cli/node_modules/caliper-fabric-ccp/lib/fabric.js:1166:31) at Array.forEach () at Fabric._instantiateChaincodes (/usr/local/lib/node_modules/caliper-cli/node_modules/caliper-fabric-ccp/lib/fabric.js:1162:35) at info: [demo.js]: [Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0 info: [caliper-flow]:

check logs in peer0.org1.example.com

Then, I check the logs in peer0.org1.example.com:

2019-06-26 02:28:47.303 UTC [endorser] SimulateProposal -> ERRO 058 [mychannel][0c4e3a72] failed to invoke chaincode name:"lscc" , error: timeout expired while executing transaction

my views about this problem

so I make sure that the Fabric version is v1.4.0, then I retry, but same error appears. then I set the Fabric v1.2, v1.3, all is error.

try with network/fabric-v1.1/2org1peergoleveldb/fabric-ccp-go.yaml

Although I see some little errors, but Benchmark run successful!!!

aklenik commented 5 years ago

@jiafeimao-gjf Since you're trying to use the simple benchmark, remove the other chaincode entries from the network configuration file. What are your machine specs?

jiafeimao-gjf commented 5 years ago

@aklenik I removed the other chaincode entries in fabric-ccp-go.yaml like this:

#    - id: marbles
#      version: v0
#      language: golang
#      path: contract/fabric/marbles/go
#      metadataPath: src/contract/fabric/marbles/go/metadata
#    - id: drm
#      version: v0
#      language: golang
#      path: contract/fabric/drm
    - id: simple
      version: v0
      language: golang
      path: contract/fabric/simple/go
#    - id: smallbank
#      version: v0
#      language: golang
#      path: contract/fabric/smallbank

then the error:

info: [adapters/fabric-ccp]: Instantiating simple@v0 in mychannel. This might take some time... error: [caliper-flow]: Error: Error: Invalid endorsement for simple@v0 in mychannel from peer0.org1.example.com: failed to execute transaction ddd52516c3b5c53d76665ffecfdc4fb8bb7b4f12062d7a54ef30704ee868e954: error sending: timeout expired while executing transaction at proposalResponses.forEach (/usr/local/lib/node_modules/caliper-cli/node_modules/caliper-fabric-ccp/lib/fabric.js:1166:31) at Array.forEach () at Fabric._instantiateChaincodes (/usr/local/lib/node_modules/caliper-cli/node_modules/caliper-fabric-ccp/lib/fabric.js:1162:35) at info: [demo.js]: [Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0

machine specs:

What I want to complete eventually

aklenik commented 5 years ago

@jiafeimao-gjf Okay, let's try the following:

  1. Make sure there are no Fabric containers running (clean up every peer, ca, orderer and dev* container)
  2. In the docker-compose file you use, add the following peer settings to the environment section of both peers: https://github.com/hyperledger/caliper/blob/27ec5f94e70a4cb3856f2b1dfd26b3e2f95b087f/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/docker-compose.yaml#L49
    - CORE_CHAINCODE_EXECUTETIMEOUT=30s
    - CORE_CHAINCODE_STARTUPTIMEOUT=600s

Experiment with the values above, hopefully that'll solve your timeout problem.

jiafeimao-gjf commented 5 years ago

@aklenik ok,Benchmark run successful!!! Thank you for your patient guidance!!!