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

Not starting on OTP26 #886

Closed
5 tasks done
lukaszsamson opened this issue May 14, 2023 · 50 comments
Closed
5 tasks done

Not starting on OTP26 #886

lukaszsamson opened this issue May 14, 2023 · 50 comments

Comments

@lukaszsamson
Copy link
Collaborator

lukaszsamson commented May 14, 2023

There are several issues that make ElixirLS fail on OTP26. Some of them are already addressed on https://github.com/elixir-lsp/elixir-ls/tree/otp26 but some will need to wait for fixes upstream

@Hermanverschooten
Copy link

Hi, I just wanted to add that it does not work with the released version of Erlang 26.0.
I am running elixir-ls in LunarVim and get this in the LspLog

[START][2023-05-18 06:53:14] LSP logging initiated
[ERROR][2023-05-18 06:53:14] .../vim/lsp/rpc.lua:734	"rpc"	"elixir-ls"	"stderr"	"Runtime termina"
[ERROR][2023-05-18 06:53:14] .../vim/lsp/rpc.lua:734	"rpc"	"elixir-ls"	"stderr"	"ting 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,[]}]})\r\n\r\nCrash dump is being written to: erl_crash.dump.."
[ERROR][2023-05-18 06:53:14] .../vim/lsp/rpc.lua:734	"rpc"	"elixir-ls"	"stderr"	"."
[ERROR][2023-05-18 06:53:14] .../vim/lsp/rpc.lua:734	"rpc"	"elixir-ls"	"stderr"	"done\r\n"

@lukaszsamson lukaszsamson changed the title Not starting on OTP26-rc.3 Not starting on OTP26 May 18, 2023
arcanemachine added a commit to arcanemachine/phoenix-todo-list that referenced this issue May 20, 2023
New version caused breaking changes in 'elixir-ls'. Downgrading for now.

Ref elixir-lsp/elixir-ls#886
CuriousCurmudgeon added a commit to CuriousCurmudgeon/live_pet that referenced this issue May 29, 2023
This was referenced Jun 1, 2023
general-CbIC added a commit to general-CbIC/poolex that referenced this issue Jun 11, 2023
@idyll
Copy link

idyll commented Jun 18, 2023

Even with the OTP26 branch with master merged in things are working much, much better ;)

@lukaszsamson
Copy link
Collaborator Author

Even with the OTP26 branch with master merged in things are working much, much better ;)

It crashes on first utf character in client request

@idyll
Copy link

idyll commented Jun 20, 2023

Even with the OTP26 branch with master merged in things are working much, much better ;)

It crashes on first utf character in client request

I see one crash, and then it seems to work fine after that.. (where previously it would just crash repeatedly.)
I merged master into a local copy of this branch and recompiled. I'm using Elixir 1.15 and OTP 26.0.1

Not saying it's fixed. But it's actually usable right now for me...

@dvic
Copy link

dvic commented Jun 20, 2023

FYI, the last open bug in OTP 26 has just been closed 🎉

@lukaszsamson
Copy link
Collaborator Author

Now we need an OTP release OTP-26.0.2 with the fix and find a way how to pass -standard_io_encoding latin1 to launch scripts

@garazdawi
Copy link

It would be great if you could test the latest maint before we release 26.0.2 and see if there are any more issues so that we can fix them as well. The plan is to release 26.0.2 early next week.

@wkirschbaum
Copy link

wkirschbaum commented Jun 23, 2023

Elixir 1.15.0 (compiled with Erlang/OTP 26)
Linux version 6.3.8-arch1-1 (linux@archlinux) (gcc (GCC) 13.1.1 20230429, GNU ld (GNU Binutils) 2.40.0)

Just compiled and installed maint and getting the following error:

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Protocols are not consolidated","type":3}}Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[<<42,42,32,40,69,88,73,84,32,102,114,111,109,32,35,80,73,68,60,48,46,57,56,46,48,62,41,32,97,110,32,101,120,99,101,112,116,105,111,110,32,119,97,115,32,114,97,105,115,101,100,58,10,32,32,32,32,42,42,32,40,69,114,108,97,110,103,69,114,114,111,114,41,32,69,114,108,97,110,103,32,101,114,114,111,114,58,32,58,99,97,108,108,105,110,103,95,115,101,108,102,58,32,117,110,107,110,111,119,110,32,101,114,114,111,114,58,32,99,97,108,108,105,110,103,95,115,101,108,102,10,32,32,32,32,32,32,32,32,40,115,116,100,108,105,98,32,53,46,48,46,49,41,32,105,111,46,101,114,108,58,57,57,58,32,58,105,111,46,112,117,116,95,99,104,97,114,115,40,58,115,116,97,110,100,97,114,100,95,101,114,114,111,114,44,32,91,34,42,42,32,40,82,117,110,116,105,109,101,69,114,114,111,114,41,32,85,110,97,98,108,101,32,116,111,32,114,101,97,100,32,102,114,111,109,32,100,101,118,105,99,101,58,32,58,116,101,114,109,105,110,97,116,101,100,34,44,32,49,48,44,32,34,32,32,32,32,40,101,108,105,

Crash dump is being written to: erl_crash.dump...done

This is with what sounds to a the fix: erlang/otp@bf1916d

with the flag set as --erl "-kernel standard_io_encoding latin1" ... ( not sure if this is right ).

I also tested the credo-language-server over stdio which is working as expected.

pineman added a commit to pineman/abra_elixir that referenced this issue Jun 24, 2023
@dmilith
Copy link

dmilith commented Jun 25, 2023

On macOS 12.6/arm64 I get:

Running /usr/local/elixir-language-server/launch.sh
Looking for ASDF install in /Users/dmilith/.asdf/asdf.sh
Installing ElixirLS release v0.15.0
Running in /Volumes/Projects/Sofin
Install complete
Content-Length: 103

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Started ElixirLS v0.15.0","type":3}}Content-Length: 113

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Running in /Volumes/Projects/Sofin","type":3}}Content-Length: 130

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"ElixirLS built with elixir \"1.15.0\" on OTP \"26\"","type":3}}Content-Length: 151

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Running on elixir \"1.15.0 (compiled with Erlang/OTP 26)\" on OTP \"26\"","type":3}}Content-Length: 109

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Protocols are not consolidated","type":3}}Content-Length: 194

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.","type":3}}Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{elixir,start_cli,0,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done

Wonder how or where you can set the path for the Elixir source… but I think it's our last problem here ;)

@lukaszsamson
Copy link
Collaborator Author

Instead of posting the same crash log again and again what would actually help here would be testing the new flag added on OTP master.

@dmilith
Copy link

dmilith commented Jun 25, 2023

Nope. With the Otp master from today (2023-06-25 18:45 CEST):

Generated erl2ex app
Install complete
Content-Length: 103

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Started ElixirLS v0.15.0","type":3}}Content-Length: 113

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Running in /Volumes/Projects/Small","type":3}}Content-Length: 130

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"ElixirLS built with elixir \"1.15.0\" on OTP \"26\"","type":3}}Content-Length: 151

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Running on elixir \"1.15.0 (compiled with Erlang/OTP 26)\" on OTP \"27\"","type":3}}Content-Length: 109

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Protocols are not consolidated","type":3}}Content-Length: 194

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.","type":3}}Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[<<42,42,32,40,69,88,73,84,32,102,114,111,109,32,35,80,73,68,60,48,46,57,56,46,48,62,41,32,97,110,32,101,120,99,101,112,116,105,111,110,32,119,97,115,32,114,97,105,115,101,100,58,10,32,32,32,32,42,42,32,40,69,114,108,97,110,103,69,114,114,111,114,41,32,69,114,108,97,110,103,32,101,114,114,111,114,58,32,58,99,97,108,108,105,110,103,95,115,101,108,102,58,32,117,110,107,110,111,119,110,32,101,114,114,111,114,58,32,99,97,108,108,105,110,103,95,115,101,108,102,10,32,32,32,32,32,32,32,32,40,115,116,100,108,105,98,32,53,46,48,46,49,41,32,105,111,46,101,114,108,58,57,57,58,32,58,105,111,46,112,117,116,95,99,104,97,114,115,40,58,115,116,97,110,100,97,114,100,95,101,114,114,111,114,44,32,91,34,42,42,32,40,82,117,110,116,105,109,101,69,114,114,111,114,41,32,85,110,97,98,108,101,32,116,111,32,114,101,97,100,32,102,114,111,109,32,100,101,118,105,99,101,58,32,58,116,101,114,109,105,110,97,116,101,100,34,44,32,49,48,44,32,34,32,32,32,32,40,101,108,105,

Crash dump is being written to: erl_crash.dump...done

Unfortunately, the process crashes very similar fashion as before.

@lukaszsamson
Copy link
Collaborator Author

Are you running with --erl "-kernel standard_io_encoding latin1"? Also OTP26 branch has other changes that may be needed

@lukaszsamson
Copy link
Collaborator Author

I added -kernel standard_io_encoding latin1 to launch scripts and it seems to be working OK with maint OTP branch. ElixirLS changes in https://github.com/elixir-lsp/elixir-ls/tree/otp26 branch. I'm going to run some more tests and cleanup the patch before it's ready for merging

@lukaszsamson
Copy link
Collaborator Author

Fixed in #923

@adonig
Copy link

adonig commented Jul 6, 2023

@lukaszsamson I uninstalled ElixirLS in VSCodium but it didn't remove the folder elixir-lsp.elixir-ls-0.15.1-universal in ~/.vscode-oss/extensions/. So I deleted the folder. Then I installed ElixirLS in VSCodium again and I immediately get the error again. When I check the VERSION file it contains the old version again:

[asd@fwk ~]$ cat $HOME/.vscode-oss/extensions/elixir-lsp.elixir-ls-0.15.1-universal/elixir-ls-release/VERSION 
0.15.0

I don't know whether this is because I'm using VSCodium and they get their release assets from another place or whether there is some kind of extension release asset cache in VSCode that prevents it from downloading the new release asset.

@lukaszsamson
Copy link
Collaborator Author

You are installing the wrong version once again. VSCode plugin versioning is independent from elixirLS versioning. You need 0.15.2 https://github.com/elixir-lsp/vscode-elixir-ls/blob/master/CHANGELOG.md#v0152-29-june-2023

@adonig
Copy link

adonig commented Jul 6, 2023

It looks like the newest version available is 0.15.1:

asd@fwk ~]$ codium --install-extension elixir-lsp.elixir-ls
Installing extensions...
Installing extension 'elixir-lsp.elixir-ls'...
(node:2209612) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `codium --trace-deprecation ...` to show where the warning was created)
Extension 'elixir-lsp.elixir-ls' v0.15.1 was successfully installed.
[asd@fwk ~]$ codium --list-extensions --show-versions | grep elixir
[email protected]
[asd@fwk ~]$ codium --uninstall-extension elixir-lsp.elixir-ls
Uninstalling elixir-lsp.elixir-ls...
Extension 'elixir-lsp.elixir-ls' was successfully uninstalled!
[asd@fwk ~]$ codium --install-extension [email protected]
Installing extensions...
Extension '[email protected]' not found.
Make sure you use the full extension ID, including the publisher, e.g.: ms-dotnettools.csharp
Failed Installing Extensions: elixir-lsp.elixir-ls

So I probably have to install it like described in the installation section of the README because it didn't get released yet?

Sorry for the turmoil but because of the vscode extension version 0.15.1 I thought that I'm installing ElixirLS 0.15.1 all the time.

@jesse-c
Copy link

jesse-c commented Jul 6, 2023

Thank you @lukaszsamson for your patience. Since these issues are not related to ElixirLS itself, they could be moved to the vscode-elixir-ls repository, if there is indeed an issue?

@garazdawi
Copy link

I've done a fix for the Windows issue in erlang/otp#7473. Would be great if you could test that both Unix and Windows still work as they should for ElixirLS.

@garazdawi
Copy link

Fix merged, but I'll hold of making a patch until I get confirmation here (or in erlang/otp#7473) that the fix solves the issue and that no new ones have popped up.

@dr1ver1
Copy link

dr1ver1 commented Aug 2, 2023

Maybe this should be pinned to the top of Open Issues, and maybe the title should be renamed to "elixlir-ls on OTP26 does not work in VSCode" or "Don't upgrade to OTP26 with VSCode". I'm new to Elixir (so I haven't upgraded from a previous version), and it took me some time to:

  • even discover that elixir-ls wasn't running
  • find out that the cause was OTP

i.e. for someone new to Elixir, being a bit more explicit about the problem would be helpful

@lukaszsamson
Copy link
Collaborator Author

@dr1ver1 It is already pinned since OTP 26 rc.3 release and mentioned both in release notes and README. There were at least ten threads on the forum and messages on slack. It does not stop people from running on incompatible versions and raising issues...

@dr1ver1
Copy link

dr1ver1 commented Aug 2, 2023

ok. I was looking through issues at https://github.com/elixir-lsp/vscode-elixir-ls/issues
I guess I was looking in the wrong place

@axelson
Copy link
Member

axelson commented Aug 5, 2023

@dr1ver1 I've added a pinned issue to that repo for additional visibility: elixir-lsp/vscode-elixir-ls#365

@jschaeff
Copy link

jschaeff commented Sep 18, 2023

Hello,
I'm not sure to help here, but I wanted to report that elixir-ls 0.16 still fails on Archlinux with OTP26.
By following this issue, I expected that the remaining problem was only for windows and the others were already fixed in 1.16 release.
Is there a branch of elixir-ls that works on linux with OTP 26 ?

This is my error message when running in emacs with lsp-mode:

Process elixir-ls stderr finished
Runtime terminating during boot ({badarg,[{io,put_chars,[standard_error,[_]],[{_},{_},{_}]},{Elixir.Kernel.CLI,exec_fun,2,[{_},{_}]},{Elixir.Kernel.CLI,run,1,[{_},{_}]},{elixir,start_cli,0,[{_},{_}]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

@lukaszsamson
Copy link
Collaborator Author

@jschaeff Please make sure you run OTP >= 26.0.2

@jschaeff
Copy link

Yes it's OTP 26.0.2

@lukaszsamson
Copy link
Collaborator Author

Please post more logs. Can you create a dockerfile that reproduces it?

@lobo-tuerto
Copy link

Latest version of elixir-ls (v0.16.0) runs without problems on Linux with the following versions:

  • elixir: 1.15.5-otp-26
  • erlang: 26.0.2

@lukaszsamson
Copy link
Collaborator Author

OTP 26.1 is out with the fix for erlang/otp#7459, I'll test it out later

@jschaeff
Copy link

jschaeff commented Sep 20, 2023

Please post more logs. Can you create a dockerfile that reproduces it?

It's hard to make a docker container that mimic's the dialog between emacs lsp-mode and elixir-ls, but it lead me to another path:
by switching from lsp-mode to eglot, I got it working. This is a bit weird ... but then maybe it's an lsp-mode bug ?

Sidenote: It's also a bit weird that archlinux is so much behind in the elixir package (1.15.0)

@Hermanverschooten
Copy link

Hermanverschooten commented Sep 20, 2023

I have just tested erlang 26.1/elixir 1.15.4 with 0.16 in one of my projects, it works but some vim restarts were necessary.
I removed both my _build and .elixir_ls upfront, but that's something I always do when switching versions.
Oh and I am using rtx not asdf, on Mac OS Ventura 13.5.2 M2.

@garazdawi
Copy link

OTP 26.1 is out with the fix for erlang/otp#7459, I'll test it out later

I'm curious, why wait for the release to test it? If you had tested my PR and confirmed that it fixed the problem I would have released a patch with this fix 2 months ago.

@lukaszsamson
Copy link
Collaborator Author

I can confirm that elixir-ls 0.16 with OTP 26.1 is working on windows

I'm curious, why wait for the release to test it? If you had tested my PR and confirmed that it fixed the problem I would have released a patch with this fix 2 months ago.

Let's put it like this: building OTP on windows isn't the easiest of tasks

@garazdawi
Copy link

Let's put it like this: building OTP on windows isn't the easiest of tasks

Each PR opened towards our repository creates an .exe installer that can be used for testing. There is link to it in the auto-generated comment: erlang/otp#7473 (comment)

@lukaszsamson
Copy link
Collaborator Author

I'm closing the issue as now all main OSes are working with OTP 26

@lukaszsamson
Copy link
Collaborator Author

Another OTP related issue #1023

@axelson axelson unpinned this issue Nov 8, 2023
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