redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.07k stars 433 forks source link

Java language sever only opens for user with id=1000 on wsl #3654

Open mikedoy opened 4 months ago

mikedoy commented 4 months ago

When developing on wsl the Java language server will not run anymore. This is the stacktrace: [Error - 3:08:10 PM] Language Support for Java (Syntax Server) client: couldn't create connection to server. Error: listen EACCES: permission denied /mnt/wslg/runtime-dir/lsp-0ad34880cf45cbb2a5599303d6a3b088.sock at Server.setupListenHandle [as _listen2] (node:net:1800:21) at listenInCluster (node:net:1865:12) at Server.listen (node:net:1964:5) at /home/lawson/.vscode-server/extensions/redhat.java-1.30.0-linux-x64/dist/extension.js:2:1136886 at new Promise () at t.createClientPipeTransport (/home/lawson/.vscode-server/extensions/redhat.java-1.30.0-linux-x64/dist/extension.js:2:1136777) at /home/lawson/.vscode-server/extensions/redhat.java-1.30.0-linux-x64/dist/extension.js:2:1333531 at async c.createConnection (/home/lawson/.vscode-server/extensions/redhat.java-1.30.0-linux-x64/dist/extension.js:2:1165774) at async c.start (/home/lawson/.vscode-server/extensions/redhat.java-1.30.0-linux-x64/dist/extension.js:2:1156291)

Switching to a user with uid=1000 resolves the issue. This is a regression, it used to work fine with uid=1620

Environment

cat /etc/system-release Amazon Linux release 2 (Karoo)

Steps To Reproduce
  1. set default user in wsl to user with id other than 1000
  2. start vscode with java code

[Please attach a sample project reproducing the error] I don't have a project, just starting vscode as described will cause the error.

Current Result

Java language server does not start

Expected Result

Java language server starts

Additional Informations

This seems to be related to this older yet still unresolved vscode bug : https://github.com/microsoft/WSL/issues/9025

However, this just started happening within the last week or so.

rgrunber commented 4 months ago

We switched the default transport from stdio to pipe. You should be able to set "java.transport" : "stdio" in your settings to work around the issue.

I think some permission related issues were discussed at https://github.com/redhat-developer/vscode-java/issues/3634 but that was more about configuring the folder under which the socket is created. We don't really have control over how the socket itself is created though.

CC'ing @testforstephen for awareness.