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
642 stars 403 forks source link

Follow the 0.3.2 fabric tutorial will produce errors #995

Closed litong01 closed 3 years ago

litong01 commented 3 years ago

When follow the 0.3.2 fabric tutorials here https://hyperledger.github.io/caliper/v0.3.2/fabric-tutorial/benchmark-fabric-tutorial/ , it will produce errors

Context

Set up a fabric network and then follow the tutorial to run the benchmark test

Expected Behavior

bench mark test run successfully

Actual Behavior

Produced error

Possible Fix

Steps to Reproduce

Follow the tutorials listed above.

Please see the error below

/hyperledger/caliper/workspace $ caliper launch master --caliper-benchconfig run/caliperbenchmarkconfig.yaml --caliper-networkconfig run/calipernetworkconfig.json --caliper
-workspace ./ --caliper-flow-only-test --caliper-fabric-gateway-usegateway --caliper-fabric-gateway-discovery
2020.09.12-12:52:09.950 info  [caliper] [cli-launch-master]     Set workspace path: /hyperledger/caliper/workspace
2020.09.12-12:52:09.951 info  [caliper] [cli-launch-master]     Set benchmark configuration path: /hyperledger/caliper/workspace/run/caliperbenchmarkconfig.yaml
2020.09.12-12:52:09.951 info  [caliper] [cli-launch-master]     Set network configuration path: /hyperledger/caliper/workspace/run/calipernetworkconfig.json
2020.09.12-12:52:09.952 info  [caliper] [cli-launch-master]     Set SUT type: fabric:2.1.0
2020.09.12-12:52:09.953 error [caliper] [cli-launch-master]     Unexpected error during benchmark execution: Error: Module "fabric:2.1.0" could not be loaded: Error: Cannot find module 'fabric:2.1.0'
Searched paths: /home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/common/utils/node_modules,/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/common/node_modules,/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/node_modules,/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/node_modules,/home/node/.npm-global/lib/node_modules/@hyperledger/node_modules,/home/node/.npm-global/lib/node_modules,/home/node/.npm-global/node_modules,/home/node/node_modules,/home/node_modules,/node_modules
Usage:
 caliper launch master --caliper-bind-sut fabric:1.4.1 [other options]

Options:
  --help, -h           Show usage information  [boolean]
  --version            Show version information  [boolean]
  --caliper-bind-sut   The name and version of the platform to bind to  [string]
  --caliper-bind-cwd   The working directory for performing the SDK install  [string]
  --caliper-bind-args  Additional arguments to pass to "npm install". Use the "=" notation when setting this parameter  [string]
  --caliper-bind-file  Yaml file to override default (supported) package versions when binding an SDK  [string]

Error: Module "fabric:2.1.0" could not be loaded: Error: Cannot find module 'fabric:2.1.0'
Searched paths: /home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/common/utils/node_modules,/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/common/node_modules,/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/node_modules,/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/node_modules,/home/node/.npm-global/lib/node_modules/@hyperledger/node_modules,/home/node/.npm-global/lib/node_modules,/home/node/.npm-global/node_modules,/home/node/node_modules,/home/node_modules,/node_modules
    at Function.loadModule (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/common/utils/caliper-utils.js:104:19)
    at Function.loadModuleFunction (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/common/utils/caliper-utils.js:146:35)
    at Function.handler (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/lib/launch/lib/launchMaster.js:58:47)
    at Object.module.exports.handler (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/lib/launch/launchMasterCommand.js:46:43)
    at Object.runCommand (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/node_modules/yargs/lib/command.js:240:40)
    at Object.parseArgs [as _parseArgs] (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/node_modules/yargs/yargs.js:1154:41)
    at Object.runCommand (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/node_modules/yargs/lib/command.js:198:30)
    at Object.parseArgs [as _parseArgs] (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/node_modules/yargs/yargs.js:1154:41)
    at Object.get [as argv] (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/node_modules/yargs/yargs.js:1088:21)
    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/caliper.js:39:5)
litong01 commented 3 years ago

This problem was due to a wrong configuration in the network config json file. I am closing this since it is no longer valida.