-
Notifications
You must be signed in to change notification settings - Fork 440
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
Version 1.30.0 does not work on Ubuntu WSL2 #3634
Comments
Try setting |
However, according to microsoft/vscode-languageserver-node#1346 (comment), it worked on Windows 10 WSL (Ubuntu 20.04). @testforstephen, let us know if you can reproduce this. |
This work, thank you! |
Cannot reproduce it. Version 1.30.0 works for me in Windows 11 WSL (Ubuntu 20.04). |
Despite receiving the message "Unknown Configuration Setting," it still worked for me. I'm using WSL2. I'd like to understand why this setting works. Where can I find more information about it? It seems to be related to this change, but I'm not entirely sure 81d814b |
Regarding why we did this switch : We were testing Regarding this issue : Here's the generated code that fails on function generateRandomPipeName() {
if (process.platform === 'win32') {
return `\\\\.\\pipe\\lsp-${(0, crypto_1.randomBytes)(16).toString('hex')}-sock`;
}
let randomLength = 32;
const fixedLength = 'lsp-.sock'.length;
const tmpDir = fs.realpathSync(XDG_RUNTIME_DIR ?? os.tmpdir());
const limit = safeIpcPathLengths.get(process.platform);
if (limit !== undefined) {
randomLength = Math.min(limit - tmpDir.length - fixedLength, randomLength);
}
if (randomLength < 16) {
throw new Error(`Unable to generate a random pipe name with ${randomLength} characters.`);
}
const randomSuffix = (0, crypto_1.randomBytes)(Math.floor(randomLength / 2)).toString('hex');
return path.join(tmpDir, `lsp-${randomSuffix}.sock`);
} I'd assume |
Hey @rgrunber, No, it doesn't. Interestingly, in the system logs, I find messages like this:
FWIW
|
I had the same issue with other, java related parts, and the cause is pretty basic and easy to fix. Like @legolaz8451 already pointed out, you will get an Ubuntu 22.04 as the default distribution with installing wsl2. In the Ubuntu distribution the directory As VSC runs with the rights of the default owner with What helped for me was something like that: sudo mkdir /var/run/1000
sudo chown 1000:1000 /var/run/1000 And after restarting VSC everything worked again. Here is the output from that directory:
|
Good point @FSeidinger, for me it worked as well. Most of the WSL environments have only one user, hence the coincidence. I applied this changes:
In addition to changing the owner, I also retained read and write permissions for the owner as suggested here to minimize the risk of process contention. I also observed that @rgrunber's code suggests using the temporary directory as a fallback is possible, which could avoid the need for this workaround. |
I was getting these errors when launching vscode Java project under Kali Linux on WSL2. [Error - 4:11:56 PM] Language Support for Java client: couldn't create connection to server. [Error - 4:11:56 PM] Language Support for Java (Syntax Server) client: couldn't create connection to server. The fix suggested by @FSeidinger and @legolaz8451 above worked for me. ❯ sudo mkdir /run/user/1000 This error seemed to come out of nowhere. On Thursday (25/JUL AEST) and for months before this i was launching the Java project without any issues. Friday morning (26/JUL AEST) this issue was happening launching any vscode Java project from any of my WSL2 distros. A cumulative update for windows 11 (KB5040527) was applied to my system on the morning of 26/JUL. I thought maybe Microsoft had changed something in response to the CrowdStrike outage. But i had also run "sudo apt update && sudo apt full-upgrade" on my distros Friday morning 26/JUL. And i think the Language Support for Java(TM) by Red Hat extension also updated itself. Does anyone have any ideas why this issue appeared to just drop in on me? |
I've been doing some more investigating... I exported a distro back on 08/MAY. If i create a new distro based on the 08/MAY copy, the /run/user folders have the following ┌──(jamie㉿DESKTOP-JAMIE)-[~] and ┌──(jamie㉿DESKTOP-JAMIE)-[~] After running "sudo apt update && sudo apt full-upgrade" to bring the distro up to date, /run/user looks like this ┌──(jamie㉿DESKTOP-JAMIE)-[~] ┌──(jamie㉿DESKTOP-JAMIE)-[~] I then run "code ." in one of my project folders. VS Code Server updates itself to f1e16e1e6214d7c44d078b1f0607b2388f29d729 and i get the "couldn't create connection to server" errors. At this point /run/user looks like ┌──(jamie㉿DESKTOP-JAMIE)-[~/dev/projects/scratch] ┌──(jamie㉿DESKTOP-JAMIE)-[~/dev/projects/scratch] If i apply the chown and chmod fixes, "sudo chown 1000:1000 /run/user/1000 && sudo chmod 0700 /run/user/1000", restart my distro and relaunch vscode from my project folder, the errors go away. So, it appears that VS Code Server is causing the problem when it updates. I assume it's removing the /run/user/1000 folder on updating and recreating it with root as the owner. |
The extension fails to start as soon as a project is opened.
This issue is fixed when I downgrade to the previous version.
Environment
Steps To Reproduce
The text was updated successfully, but these errors were encountered: