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 405 forks source link

Error while performing "test" step: Error #1513

Open nimaafraz opened 9 months ago

nimaafraz commented 9 months ago

Which Caliper version are you using?

0.5.0

Which Node.JS version are you using?

V16

Which operating system are you using?

Ubuntu 22

Please provide some context for your error. For example, when did the error occur? What were you trying to achieve, and how?

Hi, I seem to be getting the following error regardless on NPM installation or the Docker Image of Caliper: Error while performing "test" step: Error: Network configuration version 1.0 is not supported anymore, please use version 2 caliper | at CaliperEngine.connectorFactory [as adapterFactory] (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/node_modules/@hyperledger/caliper-fabric/lib/FabricConnectorFactory.js:125:15) caliper | at CaliperEngine.run (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/manager/caliper-engine.js:109:64) caliper | at processTicksAndRejections (internal/process/task_queues.js:95:5) caliper | at async Function.handler (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/lib/launch/lib/launchManager.js:62:30)

What was the observed incorrect behavior?

Error while performing "test" step: Error

Please provide the error logs and their surroundings.

ubuntu@ubuntu-2204:~$ docker-compose -f networks/fabric/docker-compose/2org1peergoleveldb_solo_raft/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);
ERROR: .FileNotFoundError: [Errno 2] No such file or directory: './networks/fabric/docker-compose/2org1peergoleveldb_solo_raft/docker-compose-tls.yaml'
-bash: test: too many arguments
Error response from daemon: cannot remove container "/peer0.org1.example.com": container is running: stop the container before removing or force remove
Error response from daemon: cannot remove container "/peer0.org2.example.com": container is running: stop the container before removing or force remove
Error response from daemon: cannot remove container "/orderer0.example.com": container is running: stop the container before removing or force remove
Error response from daemon: cannot remove container "/ca.org1.example.com": container is running: stop the container before removing or force remove
Error response from daemon: cannot remove container "/ca.org2.example.com": container is running: stop the container before removing or force remove
ubuntu@ubuntu-2204:~$ docker-compose up
Creating network "ubuntu_default" with the default driver
Pulling caliper (hyperledger/caliper:0.5.0)...
0.5.0: Pulling from hyperledger/caliper
df9b9388f04a: Pull complete
ca7a8472f94a: Pull complete
ab7779030b15: Pull complete
e5e6e80367d5: Pull complete
ffd00d8a7e8d: Pull complete
655894b21129: Pull complete
0d8fb0fcac45: Pull complete
Digest: sha256:3a7df18ef6a17a8c851dac19241049be2375dc892643c576932f360ca9d7198c
Status: Downloaded newer image for hyperledger/caliper:0.5.0
Creating caliper ... done
Attaching to caliper
caliper    | 2024.02.12-17:42:34.795 info  [caliper] [cli-launch-manager]   Binding specification is present, performing binding for "fabric:2.2"
caliper    | 2024.02.12-17:42:34.812 warn  [caliper] [bind]     Working directory not specified. Using "/hyperledger/caliper/workspace"
caliper    | 2024.02.12-17:42:34.812 info  [caliper] [bind]     User-provided arguments for npm: "-g"
caliper    | 2024.02.12-17:42:34.813 info  [caliper] [bind]     Binding for fabric@2.2. This might take some time...
caliper    | 2024.02.12-17:42:34.815 info  [caliper] [bind]     Using working directory: /hyperledger/caliper/workspace
caliper    | 2024.02.12-17:42:34.816 info  [caliper] [bind]     Calling npm with: install -g fabric-network@2.2.12
caliper    | 
caliper    | > pkcs11js@1.3.1 install /home/node/.npm-global/lib/node_modules/fabric-network/node_modules/pkcs11js
caliper    | > node-gyp rebuild
caliper    | 
caliper    | make: Entering directory '/home/node/.npm-global/lib/node_modules/fabric-network/node_modules/pkcs11js/build'
caliper    |   CXX(target) Release/obj.target/pkcs11/src/main.o
caliper    | In file included from ../../nan/nan.h:62,
caliper    |                  from ../src/main.cpp:1:
caliper    | /home/node/.cache/node-gyp/14.19.3/include/node/node.h:793:7: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
caliper    |   793 |       (node::addon_register_func) (regfunc),                          \
caliper    |       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
caliper    | /home/node/.cache/node-gyp/14.19.3/include/node/node.h:827:3: note: in expansion of macro 'NODE_MODULE_X'
caliper    |   827 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
caliper    |       |   ^~~~~~~~~~~~~
caliper    | ../src/main.cpp:27:1: note: in expansion of macro 'NODE_MODULE'
caliper    |    27 | NODE_MODULE(pkcs11, init)
caliper    |       | ^~~~~~~~~~~
caliper    |   CXX(target) Release/obj.target/pkcs11/src/dl.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/const.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/pkcs11/error.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/pkcs11/v8_convert.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/pkcs11/template.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/pkcs11/mech.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/pkcs11/param.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/pkcs11/param_aes.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/pkcs11/param_rsa.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/pkcs11/param_ecdh.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/pkcs11/pkcs11.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/async.o
caliper    |   CXX(target) Release/obj.target/pkcs11/src/node.o
caliper    |   SOLINK_MODULE(target) Release/obj.target/pkcs11.node
caliper    |   COPY Release/pkcs11.node
caliper    | make: Leaving directory '/home/node/.npm-global/lib/node_modules/fabric-network/node_modules/pkcs11js/build'
caliper    | 
caliper    | > protobufjs@6.11.4 postinstall /home/node/.npm-global/lib/node_modules/fabric-network/node_modules/protobufjs
caliper    | > node scripts/postinstall
caliper    | 
caliper    | + fabric-network@2.2.12
caliper    | added 93 packages from 125 contributors in 42.899s
caliper    | 2024.02.12-17:43:18.537 info  [caliper] [cli-launch-manager]   Set workspace path: /hyperledger/caliper/workspace
caliper    | 2024.02.12-17:43:18.538 info  [caliper] [cli-launch-manager]   Set benchmark configuration path: /hyperledger/caliper/workspace/benchmarks/scenario/simple/config.yaml
caliper    | 2024.02.12-17:43:18.539 info  [caliper] [cli-launch-manager]   Set network configuration path: /hyperledger/caliper/workspace/networks/fabric/v2/v2.1.0/2org1peergoleveldb_raft/fabric-node-tls-solo.yaml
caliper    | 2024.02.12-17:43:18.539 info  [caliper] [cli-launch-manager]   Set SUT type: fabric
caliper    | 2024.02.12-17:43:18.554 info  [caliper] [benchmark-validator]  No observer specified, will default to `none`
caliper    | 2024.02.12-17:43:18.555 info  [caliper] [caliper-engine]   Starting benchmark flow
caliper    | 2024.02.12-17:43:18.557 info  [caliper] [caliper-utils]    Executing command: cd /hyperledger/caliper/workspace; export FABRIC_VERSION=2.1.0;export FABRIC_CA_VERSION=1.4.4;docker-compose -f networks/fabric/docker-compose/2org1peergoleveldb_solo_raft/docker-compose-tls.yaml up -d;sleep 20s
caliper    | /bin/sh: docker-compose: not found
caliper    | 2024.02.12-17:43:38.608 info  [caliper] [caliper-engine]   Executed start command in 20.051 seconds
caliper    | 2024.02.12-17:43:38.623 error [caliper] [caliper-engine]   Error while performing "test" step: Error: Network configuration version 1.0 is not supported anymore, please use version 2
caliper    |     at CaliperEngine.connectorFactory [as adapterFactory] (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/node_modules/@hyperledger/caliper-fabric/lib/FabricConnectorFactory.js:125:15)
caliper    |     at CaliperEngine.run (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-core/lib/manager/caliper-engine.js:109:64)
caliper    |     at processTicksAndRejections (internal/process/task_queues.js:95:5)
caliper    |     at async Function.handler (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/lib/launch/lib/launchManager.js:62:30)
caliper    | 2024.02.12-17:43:38.625 info  [caliper] [caliper-engine]   Network configuration attribute "caliper.command.end" is not present, skipping end command
caliper    | 2024.02.12-17:43:38.626 error [caliper] [cli-launch-manager]   Benchmark failed with error code 6
caliper    | Usage:
caliper    |  caliper launch manager --caliper-bind-sut fabric:2.2 [other options]
caliper    | 
caliper    | Options:
caliper    |   --help, -h           Show usage information  [boolean]
caliper    |   --version            Show version information  [boolean]
caliper    |   --caliper-bind-sut   The name and version of the platform to bind to  [string]
caliper    |   --caliper-bind-cwd   The working directory for performing the SDK install  [string]
caliper    |   --caliper-bind-args  Additional arguments to pass to "npm install". Use the "=" notation when setting this parameter  [string]
caliper    |   --caliper-bind-file  Yaml file to override default (supported) package versions when binding an SDK  [string]
caliper    | 
caliper    | Error: Benchmark failed with error code 6
caliper    |     at Function.handler (/home/node/.npm-global/lib/node_modules/@hyperledger/caliper-cli/lib/launch/lib/launchManager.js:70:23)
caliper    |     at processTicksAndRejections (internal/process/task_queues.js:95:5)
caliper exited with code 1

Please provide your benchmark configuration file content, if possible.

No response

Please provide your network configuration file content, if possible.

No response

Please provide your workload module content, if possible.

No response

Please provide any additional information you deem relevant to the error.

No response

davidkel commented 9 months ago

Looks like you are trying to run caliper 5.0 against a very old set of caliper-benchmarks. As the error says you are using a network configuration file at version 1.0 (probably from that old set of caliper-benchmarks) and that format of the network configuration file is no supported by caliper, so caliper 5.0 will not work. You could try an older version of caliper but be aware that help cannot be provided for older versions of caliper or caliper-benchmarks

nimaafraz commented 9 months ago

Thanks @davidkel, Is there a new version of Caliper-Benchmarks? I'm using v0.4.0 of https://github.com/hyperledger/caliper-benchmarks.Also, I tried with calliper 0.4.0 and ran into the same issue.

BEst,

davidkel commented 9 months ago

@nimaafraz the main branch works with caliper 5.0, but the whole mechanism of setting up fabric networks has been removed as this is not something that caliper wanted to try to maintain or encourage even given the complexity required to create a fabric network. It's best left to Hyperledger Fabric or the various projects that all try to setup a fabric network. With Caliper now and the benchmarks, they expect a fabric network to already exist and you need to build your own network configuration file. Caliper benchmarks does include a sample one that should work with the fabric test network from fabric samples but that is it. A network configuration file for fabric pretty much now just consists of

  1. The fabric channels on the fabric network and the chaincodes deployed to the channels)
  2. The MSP id and identities in that MSP you want Caliper to use to interact with and an associated fabric connection profile which describes how to connect to a fabric network