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

Error: error:0308010C:digital envelope routines::unsupported when using Node 17 #12246

Closed
Artur- opened this issue Nov 2, 2021 · 7 comments
Closed

Comments

@Artur-
Copy link
Member

Artur- commented Nov 2, 2021

Description of the bug / feature

A Vaadin 14 application does not start is you are using Node 17

2021-11-02 16:05:41.297 ERROR 8489 --- [onPool-worker-1] dev-webpack                              : Webpack failed with the exception:
(node:8503) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
ℹ 「wds」: Project is running at http://localhost:62996/webpack-dev-server/
ℹ 「wds」: webpack output is served from /VAADIN/
ℹ 「wds」: Content not from webpack is served from /Users/artur/test/lts-test, src/main/webapp
node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

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 (/Users/artur/test/lts-test/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/artur/test/lts-test/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/artur/test/lts-test/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/artur/test/lts-test/node_modules/webpack/lib/NormalModule.js:503:5

Minimal reproducible example

  1. vaadin init lts-test
  2. cd lts-test
  3. mvn

Expected behavior

The app starts

Versions:

- Vaadin / Flow version:14.7.3
@Artur-
Copy link
Member Author

Artur- commented Nov 2, 2021

References:

https://nodejs.org/en/blog/release/v17.0.0/

If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A command-line option, --openssl-legacy-provider, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions.

For details about all the features in OpenSSL 3.0 please see the OpenSSL 3.0 release blog.

@Artur-
Copy link
Member Author

Artur- commented Nov 2, 2021

Webpack issue with suggestion for v4 users

webpack/webpack#14532 (comment)

@Artur-
Copy link
Member Author

Artur- commented Nov 2, 2021

Adding

export NODE_OPTIONS=--openssl-legacy-provider

fixes the webpack startup issue but it still does not work because loading localhost:8080 results in

com.vaadin.flow.server.BootstrapException: Unable to read webpack stats file.
	at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.setupFrameworkLibraries(BootstrapHandler.java:956) ~[flow-server-2.7.2.jar:2.7.2]
	at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.setupDocumentHead(BootstrapHandler.java:833) ~[flow-server-2.7.2.jar:2.7.2]
	at com.vaadin.flow.server.BootstrapHandler$BootstrapPageBuilder.getBootstrapPage(BootstrapHandler.java:600) ~[flow-server-2.7.2.jar:2.7.2]
	at com.vaadin.flow.server.BootstrapHandler.synchronizedHandleRequest(BootstrapHandler.java:514) ~[flow-server-2.7.2.jar:2.7.2]
	at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[flow-server-2.7.2.jar:2.7.2]
	at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1559) ~[flow-server-2.7.2.jar:2.7.2]
	at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:252) ~[flow-server-2.7.2.jar:2.7.2]
	at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:111) ~[vaadin-spring-12.4.0.jar:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[tomcat-embed-core-9.0.45.jar:4.0.FR]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:710) ~[tomcat-embed-core-9.0.45.jar:9.0.45]
...
Caused by: java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[na:na]
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:633) ~[na:na]
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:498) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:246) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:351) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:373) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1309) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1057) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589) ~[na:na]
	at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529) ~[na:na]
	at com.vaadin.flow.server.frontend.FrontendUtils.getStatsAssetsByChunkName(FrontendUtils.java:580) ~[flow-server-2.7.2.jar:2.7.2]

The webpack server is running though and is responding on the very port that Java tries to connec to

@pleku
Copy link
Contributor

pleku commented Nov 12, 2021

Maybe Node 17 should be marked as "not supported" for V14 in the meanwhile until this is fixed.

After quickly looking at how it would be possible to "install node 16 to /.vaadin if node 17 is installed globally", but the code for this is all over the place and it seems far from trivial to do it. So maybe worthwhile to try to fix the node 17 issue instead.

@pleku pleku closed this as completed in 5a1260e Nov 16, 2021
OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from P1 - High priority to Closed Nov 16, 2021
Artur- added a commit that referenced this issue Nov 16, 2021
Disallows usage of Node 17.0.

Fixes #12246, #12285
Artur- added a commit that referenced this issue Nov 16, 2021
Disallows usage of Node 17.0.

Fixes #12246, #12285
pleku pushed a commit that referenced this issue Nov 17, 2021
pleku pushed a commit that referenced this issue Nov 17, 2021
Disallows usage of Node 17.0.

Fixes #12246, #12285
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 22.0.0.rc1 and is also targeting the upcoming stable 22.0.0 version.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 21.0.8.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 14.7.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment