Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(connector-besu): Cannot find module "bluebird" #840

Closed
jordigiam opened this issue Apr 22, 2021 · 2 comments
Closed

fix(connector-besu): Cannot find module "bluebird" #840

jordigiam opened this issue Apr 22, 2021 · 2 comments
Assignees
Labels
API_Server Besu bug Something isn't working

Comments

@jordigiam
Copy link

Describe the bug

When I try to use the docker image of api-server and I pass as ENV the plugin-ledger-connector-besu I can't use it.

To Reproduce

1.- Run the follow command:

 DOCKER_BUILDKIT=1 docker build --build-arg NPM_PKG_VERSION=fix-quorum-contract-types -f ./packages/cactus-cmd-api-server/Dockerfile . -t cas -t cactus-api-server

2.- Run the follow command:

 docker run \
    --rm \
    --publish 3000:3000 \
    --publish 4000:4000 \
    --env PLUGINS='[
    {
        "packageName": "@hyperledger/cactus-plugin-ledger-connector-besu",
        "type": "org.hyperledger.cactus.plugin_import_type.LOCAL",
        "options": {
            "rpcApiHttpHost": "http://localhost:8545",
            "instanceId": "some-unique-besu-connector-instance-id"
        }
    }
]' \
cas

Logs/Stack traces

2021-04-22T16:17:34.797Z] INFO (config-service): Configuration validation OK.
[2021-04-22T16:17:34.799Z] INFO (api-server): Setting tls.DEFAULT_MAX_VERSION to TLSv1.3...
[2021-04-22T16:17:34.799Z] INFO (api-server): wwwRoot: /usr/src/app/node_modules/@hyperledger/cactus-cockpit/www/
[2021-04-22T16:17:34.799Z] INFO (api-server): resolvedWwwRoot: /usr/src/app/node_modules/@hyperledger/cactus-cockpit/www
[2021-04-22T16:17:34.799Z] INFO (api-server): resolvedIndexHtml: /usr/src/app/node_modules/@hyperledger/cactus-cockpit/www/index.html
[2021-04-22T16:17:34.804Z] INFO (api-server): Cactus Cockpit net.AddressInfo { address: '0.0.0.0', family: 'IPv4', port: 3000 }
[2021-04-22T16:17:34.805Z] INFO (api-server): getOrInitPluginRegistry() initializing a new one...
[2021-04-22T16:17:34.806Z] INFO (api-server): Instantiated empty registry, invoking plugin factories...
[2021-04-22T16:17:34.806Z] INFO (api-server): Creating plugin from package: @hyperledger/cactus-plugin-ledger-connector-besu {
  rpcApiHttpHost: 'http://localhost:8545',
  instanceId: 'some-unique-besu-connector-instance-id'
}
[2021-04-22T16:17:34.806Z] INFO (api-server): Installing @hyperledger/cactus-plugin-ledger-connector-besu for plugin import {
  packageName: '@hyperledger/cactus-plugin-ledger-connector-besu',
  type: 'org.hyperledger.cactus.plugin_import_type.LOCAL',
  options: {
    rpcApiHttpHost: 'http://localhost:8545',
    instanceId: 'some-unique-besu-connector-instance-id'
  }
}
npm WARN deprecated @web3-js/websocket@1.0.30: The branch for this fork was merged upstream, please update your package to websocket@1.0.31
npm WARN deprecated @web3-js/scrypt-shim@0.1.0: This package is deprecated, for a pure JS implementation please use scrypt-js
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated joi@14.3.1: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.

added 247 packages, and removed 310 packages in 37s

4 packages are looking for funding
  run `npm fund` for details
[2021-04-22T16:18:11.268Z] INFO (api-server): Installed @hyperledger/cactus-plugin-ledger-connector-besu OK undefined
[2021-04-22T16:18:11.362Z] INFO (api-server): Shutting down API server ...
[2021-04-22T16:18:11.362Z] INFO (api-server): getOrInitPluginRegistry() initializing a new one...
[2021-04-22T16:18:11.361Z] ERROR (api-server): Failed to start ApiServer: Error: Cannot find module 'bluebird'
Require stack:
- /usr/src/app/node_modules/swarm-js/lib/files.js
- /usr/src/app/node_modules/swarm-js/lib/api-node.js
- /usr/src/app/node_modules/web3-bzz/src/index.js
- /usr/src/app/node_modules/web3/src/index.js
- /usr/src/app/node_modules/@hyperledger/cactus-plugin-ledger-connector-besu/dist/lib/main/typescript/plugin-ledger-connector-besu.js
- /usr/src/app/node_modules/@hyperledger/cactus-plugin-ledger-connector-besu/dist/lib/main/typescript/public-api.js
- /usr/src/app/node_modules/@hyperledger/cactus-plugin-ledger-connector-besu/dist/lib/main/typescript/index.js
- /usr/src/app/node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/api-server.js
- /usr/src/app/node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/src/app/node_modules/swarm-js/lib/files.js:5:9)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
[2021-04-22T16:18:11.362Z] ERROR (api-server): Attempting shutdown...
[2021-04-22T16:18:11.362Z] INFO (api-server): Instantiated empty registry, invoking plugin factories...
[2021-04-22T16:18:11.362Z] INFO (api-server): Creating plugin from package: @hyperledger/cactus-plugin-ledger-connector-besu {
  rpcApiHttpHost: 'http://localhost:8545',
  instanceId: 'some-unique-besu-connector-instance-id'
}
[2021-04-22T16:18:11.362Z] INFO (api-server): Installing @hyperledger/cactus-plugin-ledger-connector-besu for plugin import {
  packageName: '@hyperledger/cactus-plugin-ledger-connector-besu',
  type: 'org.hyperledger.cactus.plugin_import_type.LOCAL',
  options: {
    rpcApiHttpHost: 'http://localhost:8545',
    instanceId: 'some-unique-besu-connector-instance-id'
  }
}

changed 1 package in 45s

4 packages are looking for funding
  run `npm fund` for details
[2021-04-22T16:18:19.386Z] INFO (api-server): Installed @hyperledger/cactus-plugin-ledger-connector-besu OK undefined
[2021-04-22T16:18:19.389Z] ERROR (cactus-api): Cactus API server crashed:  Error: Cannot find module 'bluebird'
Require stack:
- /usr/src/app/node_modules/swarm-js/lib/files.js
- /usr/src/app/node_modules/swarm-js/lib/api-node.js
- /usr/src/app/node_modules/web3-bzz/src/index.js
- /usr/src/app/node_modules/web3/src/index.js
- /usr/src/app/node_modules/@hyperledger/cactus-plugin-ledger-connector-besu/dist/lib/main/typescript/plugin-ledger-connector-besu.js
- /usr/src/app/node_modules/@hyperledger/cactus-plugin-ledger-connector-besu/dist/lib/main/typescript/public-api.js
- /usr/src/app/node_modules/@hyperledger/cactus-plugin-ledger-connector-besu/dist/lib/main/typescript/index.js
- /usr/src/app/node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/api-server.js
- /usr/src/app/node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/src/app/node_modules/swarm-js/lib/files.js:5:9)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/src/app/node_modules/swarm-js/lib/files.js',
    '/usr/src/app/node_modules/swarm-js/lib/api-node.js',
    '/usr/src/app/node_modules/web3-bzz/src/index.js',
    '/usr/src/app/node_modules/web3/src/index.js',
    '/usr/src/app/node_modules/@hyperledger/cactus-plugin-ledger-connector-besu/dist/lib/main/typescript/plugin-ledger-connector-besu.js',
    '/usr/src/app/node_modules/@hyperledger/cactus-plugin-ledger-connector-besu/dist/lib/main/typescript/public-api.js',
    '/usr/src/app/node_modules/@hyperledger/cactus-plugin-ledger-connector-besu/dist/lib/main/typescript/index.js',
    '/usr/src/app/node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/api-server.js',
    '/usr/src/app/node_modules/@hyperledger/cactus-cmd-api-server/dist/lib/main/typescript/cmd/cactus-api.js'
  ]
}

Operating system name, version, build:

$ printf "$(uname -srm)\n$(cat /etc/os-release)\n"
Darwin 19.6.0 x86_64
@jordigiam jordigiam added bug Something isn't working API_Server Besu labels Apr 22, 2021
@elenaizaguirre
Copy link
Contributor

@petermetz I will do this at the same time that #787

@petermetz
Copy link
Contributor

@petermetz I will do this at the same time that #787

@elenaizaguirre Awesome, thank you! Please don't forget to include the fixes #??? syntax to auto-close this one as well.

elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 23, 2021
Closes: hyperledger-cacti#840 & hyperledger-cacti#839
Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 30, 2021
cactus-cmd-api-server can now import plugins specifying
the npm package version as a plugin option

cmd-api-server: add missing dependency bluebird

closes hyperledger-cacti#839 and hyperledger-cacti#840

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Oct 1, 2021
cactus-cmd-api-server can now import plugins specifying
the npm package version as a plugin option

cmd-api-server: add missing dependency bluebird

closes hyperledger-cacti#839 and hyperledger-cacti#840

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Oct 4, 2021
cactus-cmd-api-server can now import plugins specifying
the npm package version as a plugin option

cmd-api-server: add missing dependency bluebird

closes hyperledger-cacti#839 and hyperledger-cacti#840

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Oct 5, 2021
cactus-cmd-api-server can now import plugins specifying
the npm package version as a plugin option

cmd-api-server: add missing dependency bluebird

closes hyperledger-cacti#839 and hyperledger-cacti#840

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Oct 5, 2021
cactus-cmd-api-server can now import plugins specifying
the npm package version as a plugin option

cmd-api-server: add missing dependency bluebird

closes hyperledger-cacti#839 and hyperledger-cacti#840

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Oct 5, 2021
cactus-cmd-api-server can now import plugins specifying
the npm package version as a plugin option

cmd-api-server: add missing dependency bluebird

closes hyperledger-cacti#839 and hyperledger-cacti#840

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
petermetz pushed a commit that referenced this issue Oct 6, 2021
cactus-cmd-api-server can now import plugins specifying
the npm package version as a plugin option

cmd-api-server: add missing dependency bluebird

closes #839 and #840

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
@AzaharaC AzaharaC closed this as completed Oct 7, 2021
RafaelAPB pushed a commit to RafaelAPB/blockchain-integration-framework that referenced this issue Mar 9, 2022
cactus-cmd-api-server can now import plugins specifying
the npm package version as a plugin option

cmd-api-server: add missing dependency bluebird

closes hyperledger-cacti#839 and hyperledger-cacti#840

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API_Server Besu bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants