redhat-developer / redhat-developer/vscode-java

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

Open
#3,654 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with WSL2, Amazon Linux 2, a default user whose UID is not 1000, VS Code 1.89.1, and Java extension v1.30.0. Start from the socket creation failure reported in the extension's dist/extension.js and compare it with the referenced WSL issue. Done means the Java language server starts for the non-1000 UID.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.