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

Wallet UI build fails with latest nodejs due to openssl algorithm or keysize incompatibility #4216

Closed
nuttycom opened this issue Dec 26, 2021 · 1 comment
Assignees
Labels
bug Something isn't working wallet

Comments

@nuttycom
Copy link

Describe the bug

Under nodejs v17.3.0, the Agoric build fails with the following error:

> @agoric/wallet-ui
$ yarn build:ses && yarn build:react
$ cp ../../../node_modules/ses/dist/lockdown.umd.js public/
$ react-scripts build
Creating an optimized production build...
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/home/nuttycom/projects/agoric-sdk/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/nuttycom/projects/agoric-sdk/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/nuttycom/projects/agoric-sdk/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/nuttycom/projects/agoric-sdk/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/nuttycom/projects/agoric-sdk/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/home/nuttycom/projects/agoric-sdk/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /home/nuttycom/projects/agoric-sdk/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
/home/nuttycom/projects/agoric-sdk/node_modules/react-scripts/scripts/build.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/home/nuttycom/projects/agoric-sdk/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/nuttycom/projects/agoric-sdk/node_modules/webpack/lib/NormalModule.js:417:16)
    at /home/nuttycom/projects/agoric-sdk/node_modules/webpack/lib/NormalModule.js:452:10
    at /home/nuttycom/projects/agoric-sdk/node_modules/webpack/lib/NormalModule.js:323:13
    at /home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/nuttycom/projects/agoric-sdk/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/nuttycom/projects/agoric-sdk/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.3.0

On further investigation, this error is purportedly caused by the software being built relying upon either an algorithm or a key size that is not supported by openssl v.3.0. While the following link suggests a workaround, a much better workaround (if this is indeed the issue) would be to not rely upon deprecated openssl features.

https://exerror.com/opensslerrorstack-error03000086digital-envelope-routinesinitialization-error/

To Reproduce

Steps to reproduce the behavior:

  1. On a fresh Ubuntu linux install, add the nodejs PPA and install nodejs.
  2. Follow the instructions for downloading and building the Agoric software from https://agoric.com/documentation/getting-started/before-using-agoric.html#quick-start

Expected behavior

I expect it to be possible to build the Agoric project using the latest releases of the required tools.

Platform Environment

  • Ubuntu Linux version 21.10, nodejs v17.3.0
  • Agoric-SDK version agoricdev-7-4-g9551cb4e0
@nuttycom nuttycom added the bug Something isn't working label Dec 26, 2021
@samsiegart samsiegart self-assigned this Dec 27, 2021
@samsiegart
Copy link
Contributor

Thanks for reporting this, this appears to be related to webpack/webpack#14532 / nodejs/node#40455. Beyond depending on webpack, this doesn't seem to be caused by any specific implementation details in the wallet UI itself.

I expect it to be possible to build the Agoric project using the latest releases of the required tools.

This would be nice-to-have, but it's not feasible to guarantee that new non-stable versions of node do not break existing code. We should commit to making sure this works in the next LTS version, but per https://nodejs.org/en/about/releases/ "Production applications should only use Active LTS or Maintenance LTS releases.", so for now I'd just recommend sticking to v16.

@dckc dckc added the wallet label Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wallet
Projects
None yet
Development

No branches or pull requests

4 participants