vscode-elixir-ls
vscode-elixir-ls copied to clipboard
VSCode remote ssh - Failed to run elixir command
ElixirLS 0.4.0 VS Code 1.45.1 Target lxc container Ubuntu 20.04
Elixir and erlang installed with asdf Not sure what's wrong here. I tried rebooting and restarting everything multiple times, won't work.
Developer console log:
Extension Host] Failed to run 'elixir' command. Current process's PATH: /root/.vscode-server/bin/5763d909d5f12fe19f215cbfdd29a91c0fa9208a/bin:/root/.asdf/shims:/root/.asdf/bin:/root/.vscode-server/bin/5763d909d5f12fe19f215cbfdd29a91c0fa9208a/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
Extension log:
Crash dump is being written to: erl_crash.dump...done
[Info - 6:11:45 AM] Connection to server got closed. Server will restart.
erl_child_setup closed
root@frank-bullfrog:~# which elixir
/root/.asdf/shims/elixir
root@frank-bullfrog:~# iex
Erlang/OTP 23 [erts-11.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Interactive Elixir (1.10.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
(l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
root@frank-bullfrog:~# elixir
Usage: elixir [options] [.exs file] [data]
## General options
-e "COMMAND" Evaluates the given command (*)
-h, --help Prints this message and exits
-r "FILE" Requires the given files/patterns (*)
-S SCRIPT Finds and executes the given script in $PATH
...
...
...
I have a similar setup on local machine, everything works OK, but somehow not over ssh.
It’s odd that a crash dump is available when Elixir cannot be found. Can you try setting a global version inside the container?
rm .tool-versions
asdf global elixir [your-version]
I can confirm Remote SSH to an actual remote machine works fine with ~/.tool-versions set using asdf global.
Started ElixirLS v0.4.0
Elixir version: "1.10.3 (compiled with Erlang/OTP 23)"
Erlang version: "23"
Compiling with Mix env dev
[Info - 3:40:26 PM] Compile took 646 milliseconds
I don’t have a Linux machine to test local LXC containers.
I have a related situation where using remote SSH together with ElixirLS (0.7.0) and Nix Environment Selector (1.0.7) pops up the "Failed to run elixir command" error, but if I look in the log output it seems like elixir runs just fine.
Is ElixirLS trying to run "too soon" before elixir is available in $PATH, since Nix Environment Selector modifies $PATH? Presumably ElixirLS then retries and succeeds.