elixir-lsp / vscode-elixir-ls

Elixir language support and debugger for VS Code, powered by ElixirLS.
https://marketplace.visualstudio.com/items?itemName=JakeBecker.elixir-ls
MIT License
545 stars 105 forks source link

[Windows] Extension does not start in VSCode 1.92.0 due to breaking change in child_process API #429

Closed Aulk98 closed 3 months ago

Aulk98 commented 4 months ago

Environment

Elixir & Erlang versions (elixir --version): Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] Elixir 1.17.2 (compiled with Erlang/OTP 27) VSCode ElixirLS version: 0.22.1 Operating System Version: win32 10.0.19045 VS Code info : Version: 1.92.0 (system setup) Date: 2024-07-31T23:26:45.634Z Electron: 30.1.2 ElectronBuildId: 9870757 Chromium: 124.0.6367.243 Node.js: 20.14.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.19045

Crash report

After VScode update to 1.92.0 ElixirLS couldn't create connection to server. this is the error Error: spawn EINVAL at ChildProcess.spawn (node:internal/child_process:421:11) at Object.spawn (node:child_process:799:9) at c:\Users\Alim ul kader.vscode\extensions\jakebecker.elixir-ls-0.22.1\out\extension.js:63:44432 at async fb.createConnection (c:\Users\Alim ul kader.vscode\extensions\jakebecker.elixir-ls-0.22.1\out\extension.js:60:12540) at async fb.start (c:\Users\Alim ul kader.vscode\extensions\jakebecker.elixir-ls-0.22.1\out\extension.js:60:2736)

wheredoipressnow commented 4 months ago

It appears to be related to the following node security release Windows CVE 2024-27980

Chrisbadill commented 4 months ago

@Aulk98 @wheredoipressnow I have the same problem too , I'm using nodejs version 22.4.1:

image

image image

Aulk98 commented 4 months ago

@Chrisbadill I think it is not related to system node.js it happens because VS-code node.js image I don't know how to fix this so, right now I just revert back to VS-code previous version v 1.91.1 which is working perfectly fine

lukaszsamson commented 4 months ago

It appears to be related to the following node security release Windows CVE 2024-27980

Nice find. It seems adding { shell: true } should resolve the issue

wheredoipressnow commented 4 months ago

Yes that works. Added options: { shell: true }, in languageClientManager.ts at line 52.

lukaszsamson commented 4 months ago

Yes that works. Added options: { shell: true }, in languageClientManager.ts at line 52.

Thanks for checking. I'll publish a version with the fix soon

wheredoipressnow commented 4 months ago

Sorry for the trouble, I was too slow, PR is created.

lukaszsamson commented 4 months ago

Does debugger and test runner work or is similar change needed there as well?

wheredoipressnow commented 4 months ago

Yes, that is possible.

Edit: Test runner works. I have no setup for debugger. debugAdapter.ts does not set the executable option yet.

lukaszsamson commented 3 months ago

I confirmed that debug adapter was not affected and @wheredoipressnow PR fixes the issue in language server. I published v0.23.0 with a fix.

Aulk98 commented 3 months ago

@lukaszsamson @wheredoipressnow Hi there is still some issue in LS even after update but it is coming from both vs_code versions 1.91.1 & 1.92.0 here is Error ElixirLS output:

D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
true
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.
'D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
true
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.
'D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
true
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.
'D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
true
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.
'D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] The ElixirLS - Elixir_Project server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.

so, can you please fix this issue or way to fix this issue

Edit: I don't know if I am correct or wrong, I think the extension not accessing the batch file

Aulk98 commented 3 months ago

@lukaszsamson @wheredoipressnow Hi there is still some issue in LS even after update but it is coming from both vs_code versions 1.91.1 & 1.92.0 here is Error ElixirLS output:

D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
true
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.
'D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
true
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.
'D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
true
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.
'D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 10:53:03 AM] Connection to server got closed. Server will restart.
true
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.
'D:\Elixir' is not recognized as an internal or external command,
operable program or batch file.
[Error - 10:53:03 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] The ElixirLS - Elixir_Project server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 10:53:03 AM] ElixirLS - Elixir_Project client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:53:03 AM] Server process exited with code 1.

so, can you please fix this issue or way to fix this issue

Edit: I don't know if I am correct or wrong, I think the extension not accessing the batch file

I don't know what/how happened but after I did npm update in local repository and run the "Launch Extension local" it is fixed