ElixirLS not working - Runtime terminating during boot

Hi, I am trying to get ElixerLS setup in VSCode but getting an error.

This is what I get in the Output tab:

[Info  - 10:14:54 AM] Started ElixirLS v0.13.0
[Info  - 10:14:54 AM] ElixirLS built with elixir "1.12.3" on OTP "22"
[Info  - 10:14:54 AM] Running on elixir "1.14.4 (compiled with Erlang/OTP 26)" on OTP "26"
[Warn  - 10:14:54 AM] OTP compiled without EEP48 documentation chunks. Language features for erlang modules will run in limited mode. Please reinstall or rebuild OTP with approperiate flags.
[Info  - 10:14:54 AM] Elixir sources not found (checking in /home/build/elixir). Code navigation to Elixir modules disabled.
Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
[Error - 10:14:56 AM] The ElixirLS - live_view_studio server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 10:14:56 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:14:56 AM] ElixirLS - live_view_studio client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:14:56 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 

Environment

I am running code . from a WSL2 environment.

I used ASDF to install Elixir and Erlang, and I’m using the latest versions.

$ elixir --version
Erlang/OTP 26 [erts-14.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.14.4 (compiled with Erlang/OTP 26)

Basic troubleshooting steps

I have tried following the Troubleshooting steps in the readme…

  • Restart ElixirLS with a custom command restart

I ran Elixir: Restart Language Server and got an error messagebox:

Command 'Elixir: Restart language server' resulted in an error (Cannot read properties of undefined (reading 'capabilities'))
  • Run mix clean or mix clean --deps in ElixirLS with custom command mixClean

I ran Elixir: Trigger mix clean --deps in language server and got an error messagebox:

Command 'Elixir: Trigger mix clean --deps in language server' resulted in an error (Cannot read properties of undefined (reading 'capabilities'))
  • Restart your editor (which will restart ElixirLS)

This had no effect.

  • After stopping your editor, remove the entire .elixir_ls directory, then restart your editor

I have no .elixir_ls directory

2 Likes

I am running into the same problem.

I’m on a Mac M1 MBP.

elixir --version reports:

Erlang/OTP 26 [erts-14.0] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.14.5 (compiled with Erlang/OTP 26)

VS Code reports:

Version: 1.78.2 (Universal)
Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
Date: 2023-05-10T14:44:45.204Z (1 wk ago)
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: No

I also run into the same problem in my new MBP M2. It might has to do with Erlang/OTP 26 or asdf itself.

The workaround was to install Erlang and Elixir via Homebrew where I noticed that it installed the latest version of Erlang/OTP 25 (not 26).

Rolling back to OTP 25 worked for me as well.

The same problem. OTP 25.3.2 with elixir 1.14.4 is working excellent, OTP 26.0 with elixir 1.14.5 generate errors: “ElixirLS - sgf-parsing client: couldn’t create connection to server.”

Starting ElixirLS release v0.14.6
Running in /home/leszek/exercism/elixir/sgf-parsing
[Info  - 12:45:25 PM] Started ElixirLS v0.14.6
[Info  - 12:45:25 PM] Running in /home/leszek/exercism/elixir/sgf-parsing
[Info  - 12:45:25 PM] ElixirLS built with elixir "1.14.5" on OTP "26"
[Info  - 12:45:25 PM] Running on elixir "1.14.5 (compiled with Erlang/OTP 26)" on OTP "26"
[Info  - 12:45:25 PM] Protocols are not consolidated
Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
[Error - 12:45:27 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 12:45:27 PM] Connection to server got closed. Server will restart.
true
[Error - 12:45:27 PM] ElixirLS - sgf-parsing client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
1 Like

OTP 26 is currently not supported, see: Not starting on OTP26 · Issue #886 · elixir-lsp/elixir-ls · GitHub

5 Likes

I know. I’ve presented errors to help create a solution.

1 Like

Thanks.
Getting OTP 25.3.2 with elixir 1.14.4 in asdf worked.

ElixirLS 0.15.1 released with support for OTP 26.0.2+

3 Likes