Skip to content
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

[BUG] Client ElixirLS - elx: connection to server is erroring. #1093

Closed
ibehnam opened this issue May 27, 2024 · 4 comments
Closed

[BUG] Client ElixirLS - elx: connection to server is erroring. #1093

ibehnam opened this issue May 27, 2024 · 4 comments

Comments

@ibehnam
Copy link

ibehnam commented May 27, 2024

image

I have tried installing Elixir+Erlang through Homebrew (as instructed by the official Elixir website): https://elixir-lang.org/install.html#macos

I also tried uninstalling them and installing through ASDF and I made sure that they both had the same version (27) as mentioned in this article: https://elixir-ko.github.io/install.html

This Issue mentions that Elixir may be incompatible with the most recent OpenSSL versions, but I don't want to downgrade OpenSSL: erlang/otp#4577 (comment). Also: https://elixirforum.com/t/elixirls-cannot-connect-to-server-in-vscode/55345/8

I also did every tip mentioned on the Github page of the Elixir LSP: https://github.com/elixir-lsp/elixir-ls?tab=readme-ov-file#troubleshooting

Several hours later, I still can't use the Elixir LSP in VSCode. This is the error I keep getting:

Client ElixirLS - elx: connection to server is erroring. Header must provide a Content-Length property. {"{\"jsonrpc\"":"\"2.0\",\"method\":\"window/logMessage\",\"params\":{\"message\":\"Running in /Users/<me>/Downloads/LLM/elx\",\"type\":3}}Content-Length: 130"} Shutting down server.

And

Client ElixirLS - elx: connection to server is erroring. Header must provide a Content-Length property. {"{\"jsonrpc\"":"\"2.0\",\"method\":\"window/logMessage\",\"params\":{\"message\":\"Started ElixirLS v0.21.3\",\"type\":3}}Content-Length: 121"} Shutting down server.

And

Client ElixirLS - elx: connection to server is erroring. Header must provide a Content-Length property. {"\u001b[6 qcontent-length":"103"} Shutting down server.

This isn't supposed to be like this, and a search on Google shows many people have this problem. I like Elixir and BEAM, but the tooling is not comparable to Rust, Haskell, Go, etc.

Even with Python (which has one of the worst toolings), all I need to do before using the language is:

  1. Install Python through Homebrew or a binary.

  2. Install the plugin on VSCode.

  3. Profit.

@lukaszsamson
Copy link
Collaborator

Something is broken in your env. Installing stuff via homebrew usually leads to broken env. Especially in python land. I had too many problems with broken poetry or pyenv shims due to homebrew messing with python installs or my rc. Anyway, this thread contains some troubleshooting of similar problem elixir-lsp/vscode-elixir-ls#399. Please also verify that your problem is reproducible in devcontainer https://github.com/elixir-lsp/elixir-ls-devcontainer-example

@lukaszsamson
Copy link
Collaborator

Were you able to resolve your issue @ibehnam?

@lukaszsamson
Copy link
Collaborator

Closing for now

@lukaszsamson lukaszsamson closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
@yordis
Copy link

yordis commented Nov 2, 2024

@lukaszsamson I was consistently getting this issue, turns out that was due to some WARNING printing I had in my dotfiles setup https://github.com/yordis/.dotfiles/blob/6f24bd6ff76bedcc5e83e1bec62dda4a675d6ccd/roles/zsh/files/__dotfiles.zsh#L2

Running /Users/ubi/.cursor/extensions/jakebecker.elixir-ls-0.24.2/elixir-ls-release/launch.sh
Preferred shell is zsh, relaunching
Looking for ASDF install
ASDF install found in /Users/ubi/.asdf/asdf.sh, sourcing
Installing ElixirLS release v0.24.1
Running in /Users/ubi/Developer/github.com/straw-hat-team/beam-monorepo
Install complete
[Error - 6:17:22 PM] Client ElixirLS - beam-monorepo: connection to server is erroring.
Header must provide a Content-Length property.
{"\u001b[1;33m[dotfiles":"WARNING] /Users/ubi/.mix/escripts does not exist\u001b[0m\n\u001b[1;33m[DOTFILES:WARNING] /Users/ubi/Developer/Flutter/bin does not exist\u001b[0m\n\u001b[1;33m[DOTFILES:WARNING] /Users/ubi/.deno/bin does not exist\u001b[0m\n\u001b[1;33m[DOTFILES:WARNING] /Users/ubi/.asdf/plugins/golang/set-env.zsh does not exist\u001b[0m\nContent-Length: 103"}
Shutting down server.
[Error - 6:17:22 PM] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: starting
	at fb.shutdown (/Users/ubi/.cursor/extensions/jakebecker.elixir-ls-0.24.2/out/extension.js:41:8499)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants