vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

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

Open mikedoy opened this issue 9 months ago • 1 comments

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
  • Operating System: Windows 11 and wsl2 : wsl --version WSL version: 2.1.5.0 Kernel version: 5.15.146.1-2 WSLg version: 1.0.60 MSRDC version: 1.2.5105 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.3447

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

  • JDK version: java --version openjdk 17.0.10 2024-01-16 LTS OpenJDK Runtime Environment Corretto-17.0.10.8.1 (build 17.0.10+8-LTS) OpenJDK 64-Bit Server VM Corretto-17.0.10.8.1 (build 17.0.10+8-LTS, mixed mode, sharing)
  • Visual Studio Code version: Version: 1.89.1 Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:13:33.891Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.22631
  • Java extension version: v1.30.0
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.

mikedoy avatar May 15 '24 20:05 mikedoy