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

Ubuntu 18.04.6 LTS + Eclipse 2023-03 M2: Language server startup fails because GLIBC_2.28 requirement #1096

Open
germanicianus opened this issue Feb 18, 2023 · 11 comments

Comments

@germanicianus
Copy link

I only found that out when looking at the first language server error message directly after starting Eclipse and then trying to get node installation info on command-line which immediately threw below error.

./node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ./node)`

In fact Ubuntu 18.04.6 LTS is now excluded from using the embedding node despite it is still supported until 2028.

See also nodejs/node#42351 and below info.

Eclipse:

eclipse.buildId=4.27.0.20230202-0736
java.version=17.0.6
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -data file:/<eclipse-workspace-path>/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product

Error:

java.util.concurrent.CompletionException: java.lang.RuntimeException: java.io.IOException: Unable to start language server: ProcessStreamConnectionProvider [commands=[/<eclipse-installation-path>/eclipse64_202303_m2/.node/node-v18.12.1-linux-x64/bin/node, /<eclipse-installation-path>/eclipse64_202303_m2/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/node_modules/typescript-language-server/lib/cli.js, --stdio], workingDir=/<eclipse-installation-path>/eclipse64_202303_m2/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/]
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.RuntimeException: java.io.IOException: Unable to start language server: ProcessStreamConnectionProvider [commands=[/<eclipse-installation-path>/eclipse64_202303_m2/.node/node-v18.12.1-linux-x64/bin/node, /<eclipse-installation-path>/eclipse64_202303_m2/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/node_modules/typescript-language-server/lib/cli.js, --stdio], workingDir=/<eclipse-installation-path>/eclipse64_202303_m2/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/]
	at org.eclipse.lsp4e.LanguageServerWrapper.lambda$0(LanguageServerWrapper.java:270)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	... 6 more
Caused by: java.io.IOException: Unable to start language server: ProcessStreamConnectionProvider [commands=[/<eclipse-installation-path>/eclipse64_202303_m2/.node/node-v18.12.1-linux-x64/bin/node, /<eclipse-installation-path>/eclipse64_202303_m2/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/node_modules/typescript-language-server/lib/cli.js, --stdio], workingDir=/<eclipse-installation-path>/eclipse64_202303_m2/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/]
	at org.eclipse.lsp4e.server.ProcessStreamConnectionProvider.start(ProcessStreamConnectionProvider.java:57)
	at org.eclipse.wildwebdeveloper.ui.preferences.ProcessStreamConnectionProviderWithPreference.start(ProcessStreamConnectionProviderWithPreference.java:120)
	at org.eclipse.lsp4e.LoggingStreamConnectionProviderProxy.start(LoggingStreamConnectionProviderProxy.java:218)
	at org.eclipse.lsp4e.LanguageServerWrapper.lambda$0(LanguageServerWrapper.java:268)
	... 7 more
@akurtakov
Copy link
Contributor

This project is not building nodejs but using the binaries from https://nodejs.org/en/ so I am sure you will face the same issue if you download latest 18.x release and try using it . So you would have to request support there.

@germanicianus
Copy link
Author

germanicianus commented Feb 18, 2023

@akurtakov, let me explain my reasoning behind opening the bug here.

TL;DR: Implement a global Eclipse preferences page for WWD showing node installation problems on page load, include used node path and supported node versions.

This project is [...] using the binaries from https://nodejs.org/en/

Yes, and the WWD devs decide which version to bundle. They could even implement a mechanism of putting a setting into the Eclipse preferences dialog where the user decides which node version to use, limiting the choice to the node versions compatible with the currently installed WWD Eclipse plugin. See https://nodejs.org/en/download/releases/.

Above would also enable the user to choose a node version compatible with his platform, in my case not requiring glibc 2.28.

Currently the user experience with WWD problem handling is sub-optimal - saying it nicely.

A normal user trying to get a quick start would download Eclipse IDE for Enterprise Java and Web Developers, start it, create some Web project with Javascript support, only to see that Javascript completion doesn't work without any useful hint.

I work on a daily basis with Eclipse using it for Java development and I know where to look for errors/problems, e.g. in the Eclipse Error Log View and Console View. In contrast, a fresh user will have big problems getting started and most probably bounce off using Eclipse for Javascript development. He will then most likely choose e.g. Visual Studio Code.

What I experienced roughly:

  • See that Javascript completion doesn't work in my old Eclipse.
  • Download newest Eclipse IDE for Enterprise Java and Web Developers version to be on the safe side, expecting to Javascript completion to work out of the box for a new Web project.
  • See that it still doesn't work without any useful hint.
  • Look into Eclipse Console and Error Log seeing a large number of
org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream closed
  • Fiddle with the Eclipse and project preferences dialog to see if there is some wrong setting.
  • After some tries, stumble upon a quite useful error message in the Eclipse Error Log at the very beginning in the log:
Caused by: java.io.IOException: Unable to start language server: ProcessStreamConnectionProvider [commands=[/<eclipse-installation-path>/eclipse64_202303_m2/.node/node-v18.12.1-linux-x64/bin/node, /<eclipse-installation-path>/eclipse64_202303_m2/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/node_modules/typescript-language-server/lib/cli.js, --stdio], workingDir=/<eclipse-installation-path>/eclipse64_202303_m2/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/]
  • Search the web for a solution.
  • Try to execute the command manually in bash, get error
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ./node)`
  • Search the web for a solution. Found a possible one: Install an external node version via apt and make WWD use it.
  • Search the Eclipse and project preferences dialogs for a WWD option to set external node location. Result: There is none. Search the web again and found the info that the system property org.eclipse.wildwebdeveloper.embedder.node.feature must be set to the path to achieve that. This info is really hidden if one doesn't know what to search for - on https://github.com/eclipse/wildwebdeveloper/blob/master/org.eclipse.wildwebdeveloper.embedder.node/README.md.
  • Fail to make WWD use external node version via system property in Eclipse ini. WWD was still using the integrated one.
  • Launch Eclipse manually in bash via
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_17.0.6.v20230125-1136/jre/bin/java -Dorg.eclipse.wildwebdeveloper.nodeJSLocation=$(which node) -jar plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
  • See that completion still doesn't work - seeing below error logged in bash.
/<eclipse-installation-path>/eclipse64_202303_m2/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/node_modules/typescript-language-server/lib/cli.js:8
import { readFileSync } from 'node:fs';
^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
  • Execute node --version which outputs v8.10.0.

So at the end it's still not working.

How should a usual/fresh user ever know what to do to make Eclipse with WWD work for Javascript development?!

There was NOT A SINGLE graphical notification in Eclipse on startup which a fresh user would see that something really bad happened. At least there should be some prominent setting or notification section in the Eclipse preferences which would have made the user aware.

My least effort suggestion for the beginning is:

  • Implement a global Eclipse preferences page for WWD which checks for possible node problems on opening the page and shows the results.
  • On that page also show an info which node versions the currently installed WWD plugin supports.

That would HUGELY improve the user experience and prevent unnecessary troubleshooting steps. Additionally it would reduce the fresh user bounce A LOT. If I wouldn't wouldn't have been a loyal Eclipse user I would have been bounced off right in the beginning.

@akurtakov
Copy link
Contributor

Thanks for the detailed explanation! Having such a setting, notification and etc. would be a very nice addition, but we will need help as current wwd developers are more than totally occupied with duties on core eclipse, jdt, m2e, lsp4e and more so this issue just never makes it up to the top of the todo list.
What do you think about trying to provide a PR improving the situation as you have already investigated it?

@germanicianus
Copy link
Author

What do you think about trying to provide a PR improving the situation as you have already investigated it?

I'll look into that, but can't promise anything. I never did Eclipse plugin development before, so I would need to get started with that. Additionally I'm also really occupied currently. 😞

Just keep this issue open or create a separate issue or task list with my suggested improvements - see the end of my #1096 (comment).

@germanicianus
Copy link
Author

germanicianus commented Feb 18, 2023

@akurtakov, after some more research about which node requires which glibc version, I came up with the following results.

The glibc 1.28 requirement has been introduced with node 18.0.0 - see the node changelog.

The node platform build documentation containing the glibc requirements has been updated with PR nodejs/node#42659. See also the comments and linked issues there.

Imho the best solution for the issue is to wait for PR nodejs/unofficial-builds#69 to be merged and to use the resulting build for WWD inclusion which lowers the glibc version requirement from 1.28 to 2.17.

@germanicianus
Copy link
Author

I managed to get WWD working with node v17.9.1. Steps:

/home/someuser/node/node-v17.9.1-linux-x64/
  • Add below line to the end of the vmargs list in file eclipse.ini using above path.
-Dorg.eclipse.wildwebdeveloper.nodeJSLocation=/home/someuser/node/node-v17.9.1-linux-x64/bin/node
  • Start Eclipse normally and enjoy Javascript completion. You will see an Info log entry similar to below in the Eclipse Error Log View which indicates correct startup.
[Info]	[lspserver] Using Typescript version (bundled) 4.9.3 from path "/<eclipse_installation_path>/plugins/org.eclipse.wildwebdeveloper_1.0.1.202211171559/node_modules/typescript/lib/tsserver.js"

If the given node path is incorrect, you will get below Eclipse error dialog popup and an error similar to below in the Error Log View.
node_path_incorrect

java.io.IOException: Cannot run program "/home/someuser/node/node-v17.9.1-linux-x64/bin": error=13, Permission denied

If the path is correct, but node fails to start - like for node v8.10.0 I mentioned in #1096 (comment) - you will NOT get an Eclipse error dialog popup!

@akurtakov, is there any official source for the node versions supported by each WWD plugin?

@germanicianus
Copy link
Author

germanicianus commented Feb 18, 2023

One more finding regarding the node compatibility check:

  • When the integrated node version is used by default and errors out, NO Eclipse error dialog popup is shown.
  • When the same integrated node executable is set via the system property org.eclipse.wildwebdeveloper.nodeJSLocation and errors out, an Eclipse error dialog popup IS SHOWN.

I assume that is because the integrated node version is deemed compatible without any preconditions which is incorrect because it can error out.

@germanicianus
Copy link
Author

germanicianus commented Feb 18, 2023

Next finding: NO Eclipse error dialog popup if the node path given via the system property does NOT exist.

@vrubezhny
Copy link
Contributor

@akurtakov, is there any official source for the node versions supported by each WWD plugin?

@germanicianus We test mostly using the versions of Node.js which we're going to embed - these are the LTS versions (16.x, 18.x,). The latest available and tested version is 18.13.0. So if you'll be trying - this is the latest tested and supported version. I never met a problem like yours, but at least our tests work well with these versions.

Note that Node.js versions 18.14.0/18.14.1 aren't compatible with the latest WWD snapshot available as the embedded ones, but highly likely should work as user defined custom Node.js installation ( set via -Dorg.eclipse.wildwebdeveloper.nodeJSLocation=... option)

Non-LTS versions (17.x, 19.x) as well as custom Node.js builds, like nodejs/unofficial-builds#69 aren't tested, but still may be used on your on as user defied custom Node.js installation ( set via -Dorg.eclipse.wildwebdeveloper.nodeJSLocation=... option), if your projects required it .

@mickaelistria
Copy link
Contributor

When the integrated node version is used by default and errors out, NO Eclipse error dialog popup is shown.
[...]
NO Eclipse error dialog popup if the node path given via the system property does NOT exist.

That would be worth a dedicated bug report and a dedicated PR. Can you please create those?

To be clear, it doesn't seem to be profitable for the project to maintain a matrix of compatibility; it's much simpler and much more efficient to just pick one version of node.js, verify it, and include it as done now. It can be assumed that node always work, and it's verified to work on the CI environments described in Jenkinsfile and GitHub actions. If you wish to ensure more checks for Ubuntu compatibility, you may try to just update those CI files to add Ubuntu as 1 target.

@akurtakov
Copy link
Contributor

Is this issue still worth staying open?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants