-
Notifications
You must be signed in to change notification settings - Fork 122
Description
Describe the bug, including details regarding any error messages, version, and platform.
See the following comment on apache/arrow#322.
A few weeks ago, the apache/arrow-site deployment workflow (.github/workflows/deploy.yml) started failing with the following output:
.
.
.
npm ci
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
added [13](https://github.com/apache/arrow-site/actions/runs/4257427943/jobs/7407542742#step:9:14)2 packages, and audited 133 packages in 2s
17 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npx webpack --mode=production
rm -f javascript/main.js
node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at BulkUpdateDecorator.hashFactory (/home/runner/work/arrow-site/arrow-site/node_modules/webpack/lib/util/createHash.js:[14](https://github.com/apache/arrow-site/actions/runs/4257427943/jobs/7407542742#step:9:15)4:18)
at BulkUpdateDecorator.update (/home/runner/work/arrow-site/arrow-site/node_modules/webpack/lib/util/createHash.js:46:50)
at RawSource.updateHash (/home/runner/work/arrow-site/arrow-site/node_modules/webpack-sources/lib/RawSource.js:64:8)
at NormalModule._initBuildHash (/home/runner/work/arrow-site/arrow-site/node_modules/webpack/lib/NormalModule.js:753:[17](https://github.com/apache/arrow-site/actions/runs/4257427943/jobs/7407542742#step:9:18))
at handleParseResult (/home/runner/work/arrow-site/arrow-site/node_modules/webpack/lib/NormalModule.js:817:10)
at /home/runner/work/arrow-site/arrow-site/node_modules/webpack/lib/NormalModule.js:908:4
at processResult (/home/runner/work/arrow-site/arrow-site/node_modules/webpack/lib/NormalModule.js:640:11)
at /home/runner/work/arrow-site/arrow-site/node_modules/webpack/lib/NormalModule.js:692:5 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.14.1
rake aborted!
Command failed with status (1): [npx webpack --mode=production...]
/home/runner/work/arrow-site/arrow-site/Rakefile:37:in `block in <top (required)>'
/home/runner/work/arrow-site/arrow-site/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/hostedtoolcache/Ruby/3.0.2/x64/bin/bundle:[23](https://github.com/apache/arrow-site/actions/runs/4257427943/jobs/7407542742#step:9:24):in `load'
/opt/hostedtoolcache/Ruby/3.0.2/x64/bin/bundle:23:in `<main>'
Tasks: TOP => generate => javascript/main.js
(See full trace by running task with --trace)
Error: Process completed with exit code 1.This appears to be related to the use of Webpack by apache/arrow-site and the following issues:
- nodejs 17: digital envelope routines::unsupported webpack/webpack#14532 (comment)
- Webpack Hash is not FIPS-Compliant webpack/webpack#13572
- allow to configure all hash functions used webpack/webpack#14306
My high level understanding is that in Node 18 (the build output above shows Node.js v18.14.1 is being used), the md4 hashing algorithm is deprecated (more specifically, it seems that Node 18 uses OpenSSL 3.0, which has deprecated md4) and the version of Webpack used by apache/arrow-site (v5.21.2) seems to default to using md4.
Webpack v5.61.0 added a WASM md4 implementation as a fallback. However, the advice in webpack/webpack#14532 (comment) recommends setting output.hasFunction in the Webpack config to use an alternative hashing algorithm instead. Specifically, it recommends using xxhash64 (which is planned to be the default hashing algorithm when Webpack 6 is released).
It seems that the version of Node.js in the ubuntu-latest GitHub Actions runner image (used by deploy.yml) was bumped to v18 on Februrary 13, 2023. This would explain why this issue started appearing a few weeks ago.
Workarounds
There are a few different approaches we could pursue to address this issue:
-
We could choose to pin the version of Node.js used by the GitHub Actions runner to v16 for the
actions/setup-nodeaction to work around this issue. Of course, this would mean we would be continuing to rely on an outdated version of Node.js, which doesn't seem ideal in the long term. -
We could follow the advice in nodejs 17: digital envelope routines::unsupported webpack/webpack#14532 (comment) and set
output.hashFunctionin the Webpack config to use an alternative hashing algorithm, likexxhash64. -
We could follow the advice of @avantgardnerio in DataFusion Substrait blog post #322 (comment) and move away from relying on the proprietary
ubuntu-latestimage, which is subject to sudden updates like the Node.js one that caused this issue. Instead, we can use the officialubuntu:latestcontainer image (this is the approach followed by arrow-ballista).ubuntu:latestwouldn't have unexpected library updates, and it would also be possible to run the container image locally for debugging purposes.
Component(s)
Website