EACCESS: permission denied when trying to spawn a language server in neovim

When I try to spawn elixirls language server using the following config:

require('lazy').setup({ 
  local servers={
      elixirls = {cmd = {"/home/user1/elixir-ls/elixir-ls"}},
    } 
})

I get this error:

/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:800: Spawning language server with cmd: `{ "/home/user1/elixir-ls/elixir-ls/" }` failed with error message: /usr/share/nvim/
runtime/lua/vim/_system.lua:244: EACCES: permission denied

Edit:

I changed the path to ~/home/user1/elixir-ls/elixir-ls/release/language_server.sh
and it worked.
Now I am facing another problem. A process called beam.smp is consuming 500% of my CPU, I am pretty sure it’s related to elixir-ls

This is the path to my elixir-ls executable: ~/.local/lib/elixir-ls/language_server.sh

Maybe that will help. I’m guessing that maybe the path you pasted is just the path to the directory?

1 Like

Shouldn’t you also supply the filename, not only the path?

1 Like

Yeah, I changed the path to ~/home/user1/elixir-ls/elixir-ls/release/language_server.sh and it worked.
Now I am facing another problem. A process called beam.smp is consuming 500% of my CPU, I am pretty sure it’s related to elixir-ls

This is not much to go on, especially since 500% is not even a valid CPU usage percentage. What OS and hardware are you using?

Not valid how? Just now I opened an elixir file in neovim and the used CPU% was 572 according to top.
I am using Manjaro on an i5 9300h laptop.

Well, by the specs your CPU should have 4 physical cores, 8 virtual ones. top seems to display the usage per thread (virtual cores), so think about it 572 out of 800, idiotic measure but it is what it is.

I don’t understand what are you concerns, yes the LS uses in the range of 70% of your computing power, this is normal as elixir-ls is pretty resource demanding in itself, as it uses dialyzer under the hood.

It’s very likely doing initial Dialyzer indexing of your project (i.e. the typespecs). Don’t get alarmed. I’ve seen it take an hour in bigger projects. Just let it finish. It only happens once per project and per unique Erlang version.

5 Likes

Some top-likes consider 100% for a thread, so a 32 thread machine could top at 3200% usage.