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

docs: update to node 20, re-upgrade got to 14.0.0, update other deps #79

Merged
merged 4 commits into from
Jan 6, 2024

Conversation

JacobOaks
Copy link
Contributor

@JacobOaks JacobOaks commented Dec 11, 2023

We had to revert #75 because got 14.0.0 requires node 20.
This PR updates to node 20 for the docs github workflow.
It also re-upgrade got to 14.0.0.

This caused another issue when building the docs:

tip Apply plugin mermaidjs (i.e. "vuepress-plugin-mermaidjs") ...
[info] [webpackbar] Compiling Client
[info] [webpackbar] Compiling Server
/home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:114
			throw e;
			^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/home/runner/work/cff/cff/docs/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/runner/work/cff/cff/docs/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/runner/work/cff/cff/docs/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/runner/work/cff/cff/docs/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/runner/work/cff/cff/docs/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/runner/work/cff/cff/docs/node_modules/cache-loader/dist/index.js:134:7
    at /home/runner/work/cff/cff/docs/node_modules/graceful-fs/graceful-fs.js:61:14
    at FSReqCallback.oncomplete (node:fs:189:23) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

This is apparently a known issue with Node 17.0.0+, which upgrades Node to OpenSSL 3.0. This new version disallows certain legacy operations found to be vulnerable to security attacks.

We can workaround this issue by setting NODE_OPTIONS=--openssl-legacy-provider
when building the docs, which this PR also does.
This is not an ideal solution as using the older OpenSSL version.

The issue is resolved by upgrading the other dependencies in our yarn.lock.

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b1be0ce) 87.20% compared to head (12363e2) 87.20%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #79   +/-   ##
=======================================
  Coverage   87.20%   87.20%           
=======================================
  Files          32       32           
  Lines        2603     2603           
=======================================
  Hits         2270     2270           
  Misses        269      269           
  Partials       64       64           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

We have to revert uber-go#75 because got 14.0.0 requires node 20.
This diff updates to node 20 for the docs github workflow.
It also re-upgrade got to 14.0.0.

Initially, this causes another issue when building the docs:
```
tip Apply plugin mermaidjs (i.e. "vuepress-plugin-mermaidjs") ...
[info] [webpackbar] Compiling Client
[info] [webpackbar] Compiling Server
/home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:114
			throw e;
			^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:68:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/home/runner/work/cff/cff/docs/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/runner/work/cff/cff/docs/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/runner/work/cff/cff/docs/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/runner/work/cff/cff/docs/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/runner/work/cff/cff/docs/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/home/runner/work/cff/cff/docs/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/runner/work/cff/cff/docs/node_modules/cache-loader/dist/index.js:134:7
    at /home/runner/work/cff/cff/docs/node_modules/graceful-fs/graceful-fs.js:61:14
    at FSReqCallback.oncomplete (node:fs:189:23) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
```

This is apparently a known issue with Node >16.
Refs:
* https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported
* vuejs/vuepress#3136

We can workaround this issue by setting `NODE_OPTIONS=--openssl-legacy-provider`
when building the docs, which this PR also does.

I tested the docs workflow using this branch and the env var set,
and it completed successfully:
https://github.com/uber-go/cff/actions/runs/7172095319
@JacobOaks JacobOaks changed the title Update to node 20 and re-upgrade got to 14.0.0 docs: update to node 20 and re-upgrade got to 14.0.0 Dec 11, 2023
@JacobOaks JacobOaks changed the title docs: update to node 20 and re-upgrade got to 14.0.0 [WIP] docs: update to node 20 and re-upgrade got to 14.0.0 Dec 12, 2023
@abhinav
Copy link
Collaborator

abhinav commented Jan 5, 2024

@JacobOaks upgrading all the other dependencies solved that issue. we don't need to use the legacy openssl anymore.

@abhinav abhinav marked this pull request as ready for review January 5, 2024 15:53
@abhinav abhinav changed the title [WIP] docs: update to node 20 and re-upgrade got to 14.0.0 docs: update to node 20, re-upgrade got to 14.0.0, update othe rdeps Jan 5, 2024
@abhinav abhinav changed the title docs: update to node 20, re-upgrade got to 14.0.0, update othe rdeps docs: update to node 20, re-upgrade got to 14.0.0, update other deps Jan 5, 2024
@abhinav
Copy link
Collaborator

abhinav commented Jan 5, 2024

@r-hang This should supersede the other PR upgrading the same dependency.

@r-hang r-hang merged commit 525303a into uber-go:main Jan 6, 2024
6 checks passed
r-hang added a commit that referenced this pull request Jan 6, 2024
#79 landed but ran into build
failures. I was able to reproduce the CI workflow failure by running
'make docs' locally.

Reviewing the contents of #79, setting
export NODE_OPTIONS=--openssl-legacy-provider passes 'make docs' locally.
This PR add this flag option to the docs CI workflow until the SSL issues can
be resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants