karang

karang

ElixirLS cannot connect to server in VScode

I am not sure what has changed but now ElixirLS does not work for me anymore. I am using the latest vscode (1.77.3) and the latest elixir ls extension (0.14.3). I have elixir 14.2 and OTP 25 installed through asdf. I get the following messages when starting with the command code . :

ElixirLS - asc_enfusion client: couldn't create connection to server.
The ElixirLS - asc_enfusion server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Here is the output:

Starting ElixirLS release v0.14.3
Running in /home/me/my_project
** (Mix.Error) Command "git --git-dir=.git fetch --force --quiet --progress --tags" failed
    (mix 1.14.2) lib/mix.ex:513: Mix.raise/2
    (mix 1.14.2) lib/mix/scm/git.ex:132: Mix.SCM.Git.checkout/2
    (elixir 1.14.2) lib/file.ex:1607: File.cd!/2
    (mix 1.14.2) lib/mix/dep/fetcher.ex:61: Mix.Dep.Fetcher.do_fetch/3
    (mix 1.14.2) lib/mix/dep/converger.ex:213: Mix.Dep.Converger.all/9
    (mix 1.14.2) lib/mix/dep/converger.ex:146: Mix.Dep.Converger.all/7
    (mix 1.14.2) lib/mix/dep/converger.ex:95: Mix.Dep.Converger.all/4
    (mix 1.14.2) lib/mix/dep/converger.ex:74: Mix.Dep.Converger.converge/4

I do have some settings in my .gitconfig as well. Any clues on what is going on? Thanks

Most Liked

neiby

neiby

I was able to solve this accidentally with the help of others while working on a different problem. I’m running on a Mac, which uses LibreSSL 3.3.6 instead of the regular openssl. This was causing the crypto module to be ignored when I installed erlang via asdf. The solution was to use Homebrew to install openssl, then tell KERL (which asdf uses) to use this version of openssl:

export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl@3"

Then I reinstalled erlang via asdf and all is well now. The crypto module is no longer ignored during erlang installation and I can use the latest version of ElixirLS with no problem.

kushalj

kushalj

I just fixed this on my Windows WSL Ubuntu setup.

TL;DR
What I did:
sudo apt remove elixir
sudo apt-get install libssl-dev
asdf plugin-add erlang
asdf plugin-add elixir
asdf install erlang 26.1.1
asdf install elixir 1.15.6-otp-26
asdf global erlang 26.1.1
asdf global elixir 1.15.6-otp-26


Basically, the sudo apt approach is broken. The way to test it is to git clone the ElixirLS repo and try to compile it.

mix deps.get and then mix compile

If this works, there’s good bet that VSCode doing the same thing (compiling ElixirLS) will work and connect.

I removed the elixir install and reinstalled using the embedded elixir approach. - however there is a dependency (documented here: [WSL - mix deps.get] The application "crypto" could not be found - #9 by thelucassampaio) - which is that you need to install libssl first and then use asdf to install-compile erlang and then elixir.

If this worked then the ElixirLS you cloned into a folder should compile. If not, see what error you are getting and go search - this is how I worked my way through this.

Only took 4 hours :man_facepalming:

It may not be the “correct” approach but at least it’s working for me now.

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New

We're in Beta

About us Mission Statement