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

"npm run e2e_install" failed #551

Closed conquerorAlex closed 5 years ago

conquerorAlex commented 5 years ago

After executing "npm run e2e_install", it turned out failed when installed caliper-cli. I have tried out the method "npm config set prefix ~/.local" issued by #478, but still can't work. Could you please help me? The detailed error log as follows:

`> caliper-tests-integration@0.1.0 e2e_install /home/code/src/github.com/hyperledger/caliper/packages/caliper-tests-integration

npm run cleanup && npm run start_verdaccio && npm run publish_packages && npm run install_cli && npm run cleanup

caliper-tests-integration@0.1.0 cleanup /home/code/src/github.com/hyperledger/caliper/packages/caliper-tests-integration ./scripts/cleanup.sh

set -o pipefail

Set ARCH ARCH=uname -m

Grab the parent (root) directory. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"

Switch into the integration tests directory to access required npm run commands cd "${DIR}"

echo "cleaning up from ${DIR}" cleaning up from /home/code/src/github.com/hyperledger/caliper/packages/caliper-tests-integration npm run stop_verdaccio

caliper-tests-integration@0.1.0 stop_verdaccio /home/code/src/github.com/hyperledger/caliper/packages/caliper-tests-integration PM2_HOME=.pm2 pm2 stop verdaccio || true

[PM2] Applying action stopProcessId on app [verdaccio](ids: 0) [PM2] verdaccio ✓ ┌───────────┬────┬──────┬─────┬─────────┬─────────┬────────┬─────┬────────┬──────┬──────────┐ │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │ ├───────────┼────┼──────┼─────┼─────────┼─────────┼────────┼─────┼────────┼──────┼──────────┤ │ verdaccio │ 0 │ fork │ 0 │ stopped │ 0 │ 0 │ 0% │ 0 B │ root │ disabled │ └───────────┴────┴──────┴─────┴─────────┴─────────┴────────┴─────┴────────┴──────┴──────────┘ Use pm2 show <id|name> to get more details about an app rm -rf ./.pm2 rm -rf ./scripts/storage rm -rf ${HOME}/.config/verdaccio rm -rf ${HOME}/.npmrc echo "cleanup complete" cleanup complete

caliper-tests-integration@0.1.0 start_verdaccio /home/code/src/github.com/hyperledger/caliper/packages/caliper-tests-integration ./scripts/start-verdaccio.sh

set -o pipefail

Set ARCH ARCH=uname -m

Grab the parent (root) directory. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"

Switch into the integration tests directory to access required npm run commands cd "${DIR}"

Verdaccio server requires a dummy user if publishing via npm echo '//localhost:4873/:_authToken="foo"' > ${HOME}/.npmrc echo fetch-retries=10 >> ${HOME}/.npmrc export npm_config_registry=http://localhost:4873

Start npm server PM2_HOME=.pm2 pm2 start verdaccio -- -l 0.0.0.0:4873 -c scripts/config.yaml

                    -------------

/\\\\\\_/\\____/\\____/\\\\\ \/\\/////////\_\/\\\____/\\\_/\\///////\_ \/\____\/\_\/\\//\_/\\//\\\///____\//\_ \/\\\\\\\/\/\\///\\/\\/\/\____/\\/ \/\\/////////__\/\__\///\\/_\/\_____/\\// \/\_____\/\__\///__\/\_/\\//____ \/\_____\/\_____\/\_/\\/____ \/\_____\/\_____\/\_/\\\\\\\_ _\///__\///__\///\///////////////

                      Community Edition

        Production Process Manager for Node.js applications
                 with a built-in Load Balancer.

            Start and Daemonize any application:
            $ pm2 start app.js

            Load Balance 4 instances of api.js:
            $ pm2 start api.js -i 4

            Monitor in production:
            $ pm2 monitor

            Make pm2 auto-boot at server restart:
            $ pm2 startup

            To go further checkout:
            http://pm2.io/

                    -------------

[PM2] Spawning PM2 daemon with pm2_home=.pm2 [PM2] PM2 Successfully daemonized [PM2] Starting /home/code/src/github.com/hyperledger/caliper/packages/caliper-tests-integration/node_modules/.bin/verdaccio in fork_mode (1 instance) [PM2] Done. ┌───────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐ │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │ ├───────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤ │ verdaccio │ 0 │ fork │ 27497 │ online │ 0 │ 0s │ 2% │ 18.1 MB │ root │ disabled │ └───────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘ Use pm2 show <id|name> to get more details about an app

caliper-tests-integration@0.1.0 publish_packages /home/code/src/github.com/hyperledger/caliper/packages/caliper-tests-integration ./scripts/publish-packages.sh

set -o pipefail

Set ARCH ARCH=uname -m

Grab the parent (root) directory. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"

Switch into the integration tests directory to access required npm run commands cd "${DIR}"

export npm_config_registry=http://localhost:4873 Publish latest packages node ./scripts/npm_publish Publishing package caliper-core to local npm server (attempt 1/5) npm WARN using --force I sure hope you know what you are doing.

npm notice npm notice 📦 caliper-core@0.1.0 npm notice === Tarball Contents ===

npm notice 734B .editorconfig
npm notice 572B .eslintignore
npm notice 5.3kB lib/report/template/report.html
npm notice 3.9kB lib/blockchain-interface.js
npm notice 10.0kB lib/blockchain.js
npm notice 5.2kB lib/caliper-flow.js
npm notice 9.8kB lib/client/caliper-local-client.js

npm notice 9.3kB lib/utils/caliper-utils.js

npm notice 10.2kB lib/client/caliper-zoo-client.js

npm notice 13.5kB lib/client/client-orchestrator.js

npm notice 7.0kB lib/client/client-util.js

npm notice 13.4kB lib/rate-control/compositeRate.js

npm notice 3.3kB lib/config/config-util.js
npm notice 5.0kB lib/config/Config.js
npm notice 4.6kB lib/test/defaultTest.js
npm notice 6.2kB lib/gui/src/demo.js
npm notice 3.9kB lib/rate-control/fixedBacklog.js
npm notice 6.2kB test/rate-control/fixedBacklog.js
npm notice 5.5kB lib/rate-control/fixedFeedbackRate.js npm notice 4.2kB lib/rate-control/fixedRate.js
npm notice 3.5kB test/rate-control/fixedRate.js
npm notice 1.1kB index.js
npm notice 5.3kB lib/rate-control/linearRate.js
npm notice 5.7kB test/rate-control/linearRate.js
npm notice 9.3kB lib/utils/logging-util.js
npm notice 16.0kB lib/monitor/monitor-docker.js
npm notice 2.4kB lib/monitor/monitor-interface.js
npm notice 9.4kB lib/monitor/monitor-process.js
npm notice 16.8kB lib/monitor/monitor.js
npm notice 1.0kB test/ndeep.js

npm notice 3.8kB lib/rate-control/noRate.js

npm notice 4.3kB lib/rate-control/rateControl.js

npm notice 3.1kB lib/rate-control/rateInterface.js
npm notice 8.7kB lib/rate-control/recordRate.js
npm notice 7.8kB lib/rate-control/replayRate.js
npm notice 10.1kB lib/report/report-builder.js
npm notice 8.0kB lib/report/report.js
npm notice 4.8kB lib/transaction-status.js
npm notice 3.0kB lib/utils/version.js
npm notice 8.1kB lib/client/zoo-util.js
npm notice 2.2kB package.json
npm notice 1.1kB lib/gui/README.md
npm notice 3.6kB lib/gui/www/remotecontrol.php
npm notice 91B lib/gui/www/stop.php
npm notice 4.7kB lib/config/default.yaml
npm notice 935B .eslintrc.yml
npm notice === Tarball Details ===

npm notice name: caliper-core
npm notice version: 0.1.0
npm notice package size: 51.3 kB
npm notice unpacked size: 273.0 kB
npm notice shasum: e6c6c032c30b278015dca0ac224b53e56dece23f npm notice integrity: sha512-ymvZwNZmVG6RQ[...]s/tzY6K14qUKg==

npm notice total files: 46

npm notice

Published package caliper-core to local npm server (attempt 1/5) Publishing package caliper-burrow to local npm server (attempt 1/5) npm WARN using --force I sure hope you know what you are doing.

npm notice npm notice 📦 caliper-burrow@0.1.0 npm notice === Tarball Contents ===

npm notice 734B .editorconfig
npm notice 568B .eslintignore
npm notice 8.4kB lib/burrow.js
npm notice 1.6kB lib/burrowClientFactory.js npm notice 1.7kB lib/burrowClientWorker.js

npm notice 685B index.js
npm notice 1.8kB package.json
npm notice 935B .eslintrc.yml

npm notice === Tarball Details ===

npm notice name: caliper-burrow
npm notice version: 0.1.0
npm notice package size: 4.6 kB
npm notice unpacked size: 16.4 kB

npm notice shasum: b9d8396404c7b614f06ac1aab8631e512723318f npm notice integrity: sha512-9gUXiC59Qo5Bu[...]8CcC9UYhaPkUA== npm notice total files: 8
npm notice

Published package caliper-burrow to local npm server (attempt 1/5) Publishing package caliper-composer to local npm server (attempt 1/5) npm WARN using --force I sure hope you know what you are doing.

npm notice

npm notice 📦 caliper-composer@0.1.0 npm notice === Tarball Contents ===

npm notice 734B .editorconfig

npm notice 567B .eslintignore
npm notice 21.3kB lib/composer_utils.js
npm notice 6.3kB lib/composer.js
npm notice 1.6kB lib/composerClientFactory.js npm notice 1.7kB lib/composerClientWorker.js npm notice 689B index.js
npm notice 1.9kB package.json
npm notice 935B .eslintrc.yml
npm notice === Tarball Details ===

npm notice name: caliper-composer

npm notice version: 0.1.0
npm notice package size: 8.4 kB
npm notice unpacked size: 35.7 kB
npm notice shasum: a120736146243c3fbbeaebde82710b10f659a94b npm notice integrity: sha512-IAS859BUufhdx[...]sTZJbfS6V+Nlg== npm notice total files: 9

npm notice

Published package caliper-composer to local npm server (attempt 1/5) Publishing package caliper-fabric to local npm server (attempt 1/5) npm

WARN using --force I sure hope you know what you are doing.

npm notice

npm notice 📦 caliper-fabric@0.1.0 npm notice === Tarball Contents ===

npm notice 734B .editorconfig
npm notice 567B .eslintignore
npm notice 110.4kB lib/fabric.js

npm notice 1.6kB lib/fabricClientFactory.js npm notice 2.0kB lib/fabricClientWorker.js npm notice 48.4kB lib/fabricNetwork.js
npm notice 685B index.js
npm notice 2.0kB package.json
npm notice 935B .eslintrc.yml
npm notice === Tarball Details ===

npm notice name: caliper-fabric

npm notice version: 0.1.0
npm notice package size: 32.5 kB
npm notice unpacked size: 167.3 kB
npm notice shasum: a85b0df131bd4ed78c03167bb94ecdc0ef771f3b npm notice integrity: sha512-oZgC0w5y4u/W4[...]n2Z283nlOkeGw==

npm notice total files: 9

npm notice

Published package caliper-fabric to local npm server (attempt 1/5) Publishing package caliper-iroha to local npm server (attempt 1/5) npm WARN using --force I sure hope you know what you are doing.

npm notice npm notice 📦 caliper-iroha@0.1.0 npm notice === Tarball Contents ===

npm notice 734B .editorconfig

npm notice 567B .eslintignore
npm notice 683B index.js
npm notice 20.2kB lib/iroha.js
npm notice 1.6kB lib/irohaClientFactory.js npm notice 1.7kB lib/irohaClientWorker.js npm notice 1.9kB package.json

npm notice 935B .eslintrc.yml

npm notice === Tarball Details ===

npm notice name: caliper-iroha
npm notice version: 0.1.0
npm notice package size: 7.1 kB
npm notice unpacked size: 28.3 kB
npm notice shasum: 98851288ed3790ac5c20ad522e3f1e3f88e0cd13 npm notice integrity: sha512-uAsI6hNFnLbxT[...]Trak45KuFXLMA== npm notice total files: 8

npm notice

npm notice 734B .editorconfig
npm notice 567B .eslintignore
npm notice 1.1kB lib/batch/BatchBuilder.js

npm notice 2.4kB lib/batch/BatchBuilderFactory.js
npm notice 4.9kB test/Application/BatchBuilderFactory.js

npm notice 756B index.js
npm notice 15.2kB lib/sawtooth.js
npm notice 1.6kB lib/sawtoothClientFactory.js

npm notice 1.7kB lib/sawtoothClientWorker.js
npm notice 1.9kB package.json
npm notice 935B .eslintrc.yml
npm notice === Tarball Details ===

npm notice name: caliper-sawtooth
npm notice version: 0.1.0
npm notice package size: 7.2 kB
npm notice unpacked size: 31.7 kB
npm notice shasum: 743117de7090f4cd451d1e7e248b5c538264b454 npm notice integrity: sha512-0DrPyxIbKx/9M[...]F/TRMqDBi4hRw== npm notice total files: 11
npm notice

Published package caliper-sawtooth to local npm server (attempt 1/5) Publishing package caliper-cli to local npm server (attempt 1/5) npm WARN using --force I sure hope you know what you are doing.

npm notice

npm notice 📦 caliper-cli@0.1.0 npm notice === Tarball Contents ===

npm notice 734B .editorconfig
npm notice 567B .eslintignore
npm notice 1.0kB lib/benchmark.js
npm notice 1.4kB caliper.js
npm notice 1.1kB lib/utils/cmdutils.js
npm notice 614B index.js
npm notice 3.3kB lib/benchmark/lib/runBenchmark.js
npm notice 2.1kB lib/benchmark/runBenchmarkCommand.js
npm notice 2.5kB lib/zooclient/lib/startZooClient.js
npm notice 2.1kB lib/zooclient/startZooClientCommand.js

npm notice 2.5kB lib/zooservice/lib/startZooService.js
npm notice 1.4kB lib/zooservice/startZooServiceCommand.js npm notice 2.5kB lib/zooservice/lib/stopZooService.js
npm notice 1.4kB lib/zooservice/stopZooServiceCommand.js
npm notice 1.0kB lib/zooclient.js

npm notice 1.1kB lib/zooservice.js

npm notice 2.0kB package.json
npm notice 1.3kB lib/zooservice/lib/zookeeper-service.yaml npm notice 935B .eslintrc.yml
npm notice === Tarball Details ===

npm notice name: caliper-cli
npm notice version: 0.1.0
npm notice package size: 5.5 kB
npm notice unpacked size: 29.5 kB
npm notice shasum: bed3e11c340c93d55defdbb42a7bbb48817dfdcb npm notice integrity: sha512-Eb20ki/eB3D6g[...]GdiYRTyWzh+6w== npm notice total files: 19
npm notice

gyp WARN install got an error, rolling back install gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/caliper-cli/node_modules/dtrace-provider/.node-gyp' gyp ERR! System Linux 4.15.0-58-generic gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/local/lib/node_modules/caliper-cli/node_modules/dtrace-provider gyp ERR! node -v v8.10.0 gyp ERR! node-gyp -v v5.0.3 gyp ERR! not ok

pkcs11js@1.0.18 install /usr/local/lib/node_modules/caliper-cli/node_modules/pkcs11js node-gyp rebuild gyp WARN EACCES user "nobody" does not have permission to access the dev dir "/root/.cache/node-gyp/8.10.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/caliper-cli/node_modules/pkcs11js/.node-gyp" gyp WARN install got an error, rolling back install gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/caliper-cli/node_modules/pkcs11js/.node-gyp' gyp ERR! System Linux 4.15.0-58-generic gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/local/lib/node_modules/caliper-cli/node_modules/pkcs11js gyp ERR! node -v v8.10.0 gyp ERR! node-gyp -v v5.0.3 gyp ERR! not ok npm WARN grpc-web-client@0.7.0 requires a peer of @types/google-protobuf@^3.2.5 but none is installed. You must install peer dependencies yourself. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pkcs11js@1.0.18 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pkcs11js@1.0.18 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-08-16T02_43_34_630Z-debug.log Failed to install test package caliper-cli from local npm server (attempt 1/5) Error: Failed to execute "npm install --registry http://localhost:4873 -g caliper-cli@0.1.0" with return code 1 at ChildProcess. (/home/code/src/github.com/hyperledger/caliper/packages/caliper-tests-integration/scripts/npm_install.js:43:31) at emitTwo (events.js:131:20) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)`

Environment

npm version - 6.10.3 Node version - 8.10.0 node-gyp version - 5.0.3 Ubuntu 18.04.3

conquerorAlex commented 5 years ago

Something's wrong about permission, as shows with warn messages: "user "nobody" does not have permission to access the dev dir "/root/.cache/node-gyp/8.10.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/caliper-cli/node_modules/dtrace-provider/.node-gyp"" I also have executed "chmod +777 -R /root/.cache/node-gyp/8.10.0", but got the same error. Could you help me solve this problem ?

nklincoln commented 5 years ago

Super fast way around this could be to simply not use a globally installed package, as you already have the source code you can (for example) run it direct from the packages directory via:

node ./caliper-cli/caliper.js benchmark run --caliper-benchconfig benchmark/composer/config.yaml --caliper-networkconfig network/fabric-v1.3/2org1peercouchdb/composer.json --caliper-workspace ./caliper-samples/
conquerorAlex commented 5 years ago

@nklincoln thank you for your reply. That is great by your way to around this problem to run test case. However, if it is possible, I would like to run test using caliper, in another word, to solve the problem as mentioned above.

nklincoln commented 5 years ago

@conquerorAlex - check out the troubleshooting section here: https://github.com/hyperledger/caliper/blob/master/packages/caliper-tests-integration/README.md

aklenik commented 5 years ago

Caliper is officially published, with detailed docs on install and development. So I'm closing this issue.