hyperledger / caliper-benchmarks

Sample benchmark files for Hyperledger Caliper https://wiki.hyperledger.org/display/caliper
https://hyperledger.github.io/caliper-benchmarks/
Apache License 2.0
109 stars 118 forks source link

error: [FabricCAClientService.js]: Failed to enroll admin, error:%o message=Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054], stack=Error: Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054] #118

Closed ppsmk388 closed 3 years ago

ppsmk388 commented 3 years ago

I am installing hyperledger caliber using the local NPM found at https://hyperledger.github.io/caliper/v0.3/installing-caliper/. But I invoke the local CLI binary (step 4) using the command,

npx caliper launch master --caliper-workspace . --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-networkconfig networks/fabric/fabric-v1.4.1/2org1peergoleveldb/fabric-go.yaml

my steps:

  1. git clone https://github.com/hyperledger/caliper-benchmarks.git
  2. cd caliper-benchmarks
  3. git checkout v0.3.0
  4. npm init -y npm install --only=prod \ @hyperledger/caliper-cli@0.3.0 npx caliper launch master \ --caliper-bind-sut fabric:1.4.0 \ --caliper-workspace . \ --caliper-benchconfig benchmarks/scenario/simple/config.yaml \ --caliper-networkconfig networks/fabric/fabric-v1.4.1/2org1peergoleveldb/fabric-go.yaml

I got the following log error: 2020.09.27-19:21:09.329 info [caliper] [cli-launch-master] Set workspace path: /home/qwe/caliper-benchmarks 2020.09.27-19:21:09.330 info [caliper] [cli-launch-master] Set benchmark configuration path: /home/qwe/caliper-benchmarks/benchmarks/scenario/simple/config.yaml 2020.09.27-19:21:09.331 info [caliper] [cli-launch-master] Set network configuration path: /home/qwe/caliper-benchmarks/networks/fabric/fabric-v1.4.1/2org1peergoleveldb/fabric-go.yaml 2020.09.27-19:21:09.331 info [caliper] [cli-launch-master] Set SUT type: fabric 2020.09.27-19:21:09.334 info [caliper] [benchmark-validator] No observer specified, will default to none 2020.09.27-19:21:09.334 info [caliper] [caliper-engine] Starting benchmark flow 2020.09.27-19:21:09.339 info [caliper] [adapters/fabric] Initializing standard adaptor compatible with installed SDK: 1.4.0 2020.09.27-19:21:09.826 info [caliper] [caliper-utils] Executing command: cd .; export FABRIC_VERSION=1.4.1;export FABRIC_CA_VERSION=1.4.1;docker-compose -f networks/fabric/docker-compose/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. 2020.09.27-19:21:13.466 info [caliper] [caliper-engine] Executed start command in 3.64 seconds 2020.09.27-19:21:13.466 info [caliper] [adapters/fabric] Fabric SDK version: 1.4.0; TLS: none 2020-09-28T02:21:13.871Z - error: [FabricCAClientService.js]: Failed to enroll admin, error:%o message=Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054], stack=Error: Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054] at ClientRequest.request.on (/home/qwe/caliper-benchmarks/node_modules/fabric-ca-client/lib/FabricCAClient.js:487:12) at ClientRequest.emit (events.js:189:13) at Socket.socketErrorListener (_http_client.js:392:9) at Socket.emit (events.js:189:13) at emitErrorNT (internal/streams/destroy.js:82:8) at emitErrorAndCloseNT (internal/streams/destroy.js:50:3) at process._tickCallback (internal/process/next_tick.js:63:19) 2020.09.27-19:21:13.873 error [caliper] [caliper-engine] Error while performing "init" step: Error: Couldn't enroll Org1's registrar or set it as user context: Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 127.0.0.1:7054] 2020.09.27-19:21:13.873 info [caliper] [caliper-engine] Executed "init" step in 0.407 seconds 2020.09.27-19:21:13.873 info [caliper] [caliper-utils] Executing command: cd .; docker-compose -f networks/fabric/docker-compose/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev -q)\") || docker rmi $(docker images dev -q);rm -rf /tmp/hfc-* The FABRIC_VERSION variable is not set. Defaulting to a blank string. The FABRIC_CA_VERSION variable is not set. Defaulting to a blank string. Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json?all=1: dial unix /var/run/docker.sock: connect: permission denied Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json?all=1: dial unix /var/run/docker.sock: connect: permission denied "docker rm" requires at least 1 argument. See 'docker rm --help'.

Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]

Remove one or more containers Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/json?filters=%7B%22reference%22%3A%7B%22dev%2A%22%3Atrue%7D%7D: dial unix /var/run/docker.sock: connect: permission denied Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/json?filters=%7B%22reference%22%3A%7B%22dev%2A%22%3Atrue%7D%7D: dial unix /var/run/docker.sock: connect: permission denied "docker rmi" requires at least 1 argument. See 'docker rmi --help'.

Usage: docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images 2020.09.27-19:21:14.800 info [caliper] [caliper-engine] Executed end command in 0.927 seconds 2020.09.27-19:21:14.801 error [caliper] [cli-launch-master] Benchmark failed with error code 4 Usage: caliper launch master --caliper-bind-sut fabric:1.4.1 [other options]

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

Error: Benchmark failed with error code 4 at Function.handler (/home/qwe/caliper-benchmarks/node_modules/@hyperledger/caliper-cli/lib/launch/lib/launchMaster.js:70:23) at process._tickCallback (internal/process/next_tick.js:68:7)

yyzdtccjdtc commented 3 years ago

Hi, I have the same problem. Could you tell me how to solve it? Thanks!


Update: I have solve this problem by giving a permission to docker.sock You can try this command to solve this problem.

sudo chmod 666 /var/run/docker.sock