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

Failed to run 'elixir' command. ElixirLS will probably fail to launch. #208

Closed
krainboltgreene opened this issue Sep 6, 2021 · 10 comments
Closed

Comments

@krainboltgreene
Copy link

Environment

  • Elixir & Erlang versions (elixir --version): Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit] Elixir 1.12.1 (compiled with Erlang/OTP 24)
  • Operating system: Linux 033d18dbe177 5.4.0-1055-azure elixir-lsp/elixir-ls#57~18.04.1-Ubuntu SMP Fri Jul 16 19:40:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  • Editor or IDE name (e.g. Emacs/VSCode): VSCode (Codespaces)

Output logs:

[Trace - 9:57:33 AM] Sending request 'initialize - (0)'.
erl_child_setup closed

Crash dump is being written to: erl_crash.dump...done
[Info  - 9:57:35 AM] Connection to server got closed. Server will restart.

Developer Tool logs:

Failed to run 'elixir' command. ElixirLS will probably fail to launch. Logged PATH to Development Console.
[Extension Host] Failed to run 'elixir' command. Current process's PATH: /home/codespace/.vscode-remote/bin/e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
The ElixirLS - blank-application server crashed 5 times in the last 3 minutes. The server will not be restarted.

I manually ran /home/codespace/.vscode-remote/extensions/jakebeck…xir-ls-0.8.1/elixir-ls-release/language_server.sh in my terminal and it booted up just fine.

@krainboltgreene
Copy link
Author

I've done my very best to debug this myself, plus looking various issues and bug reports.

I have two guesses:

  1. Something is fundamentally wrong with my environment (see output logs)
  2. Somehow it's not picking up on my asdf install.

@lukaszsamson
Copy link
Collaborator

Please ensure that elixir is in PATH env of vscode process. I guess it's not correctly lading your bash_rc/bash_profile. Use search - there were already similar reports before.

I manually ran /home/codespace/.vscode-remote/extensions/jakebeck…xir-ls-0.8.1/elixir-ls-release/language_server.sh in my terminal and it booted up just fine.

Closing as this confirms that it's not a problem with elixir-ls itself. If you find it's a problem with the vscode extension please open an issue in https://github.com/elixir-lsp/vscode-elixir-ls

@krainboltgreene
Copy link
Author

@lukaszsamson

It's definitely in my .bash_rc and .bash_profile. I suspect this has to do with codespaces itself.

@krainboltgreene
Copy link
Author

@lukaszsamson Can you just move this issue over to that repo please? I don't want to have to copy and paste all this.

@lukaszsamson
Copy link
Collaborator

It's definitely in my .bash_rc and .bash_profile. I suspect this has to do with codespaces itself.

What really matters is wether vscode process has proper PATH environment set.

cat /proc/{vscode pid}/environ | tr '\0' '\n' | grep PATH

Verify that the session that loads vscode loads bash_rc/pash_profile correctly.

@lukaszsamson
Copy link
Collaborator

Can you just move this issue over to that repo please?

I dont't have access in that repo. @axelson?

@axelson axelson transferred this issue from elixir-lsp/elixir-ls Sep 6, 2021
@axelson
Copy link
Member

axelson commented Sep 6, 2021

I dont't have access in that repo. @axelson?

Transferred! And I just gave you permissions to handle it next time.

@krainboltgreene I've never used codespaces before (and we don't explicitly support it), but is asdf loaded in your codespace?

@krainboltgreene
Copy link
Author

@axelson Yep! You can see it at krainboltgreene/blank-application.

@krainboltgreene
Copy link
Author

Okay so this is the path it outputs:

Failed to run 'elixir' command. Current process's PATH: /home/codespace/.vscode-remote/bin/83bd43bc519d15e50c4272c6cf5c1479df196a4d/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/codespace/.local/bin

I've also confirmed this with the default elixir codespace container.

@krainboltgreene
Copy link
Author

krainboltgreene commented Oct 3, 2021

When I run the startup script myself, in my own terminal, it boots just fine:

Screen Shot 2021-10-03 at 6 35 23 AM

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