williamboman / mason-lspconfig.nvim

Extension to mason.nvim that makes it easier to use lspconfig with mason.nvim.
Apache License 2.0
2.88k stars 174 forks source link

It doesn't install some servers "[mason-lspconfig.vim]: installing SERVER" #114

Closed sdsaati closed 1 year ago

sdsaati commented 1 year ago

Problem description

There are some servers that when I tell it to install them, they don't be installed. after restarting nvim, it again says: [mason-lspconfig.vim]: installing SERVER, I can't install any python servers: pyright, sourcery, jedi_language_server, pylsp, and some other servers. I'm using pop-os and my nvim has been installed/used by an app.image from the official neovim website.

Why do you think this is an issue with mason-lspconfig.nvim?

Yes, because inside of its information message [mason-lspconfig.vim]: installing SERVER, it's talking about mason-lspconfig.vim

Neovim version (>= 0.7)

NVIM v0.8.1 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3

Operating system/version

Linux pop-os 5.19.0-76051900-generic #202207312230~1663791054~22.04~28340d4 SMP PREEMPT_DYNAMIC Wed S x86_64 x86_64 x86_64 GNU/Linux

I've manually reviewed the Nvim LPS client log (:LspLog) to find potential errors

I've recently downloaded the latest plugin version of mason.nvim, mason-lspconfig.nvim, and nvim-lspconfig

Affected language servers

pyright, sourcery, jedi_language_server, pylsp, and some others

Steps to reproduce

  1. Download nvim from official website (the app.image file)
  2. Put init.lua (from here: https://github.com/nvim-lua/kickstart.nvim to ~/.config/nvim)
  3. Now after you run nivm for the first time, it downloads plugins and after you run it for the second time, it starts to download lsp servers
  4. It can install some servers but not all them, from now whenever I run nvim, it says: [mason-lspconfig.vim]: installing SERVER for each lsp server it can't install

Actual behavior

whenever I run nvim, it says: [mason-lspconfig.vim]: installing SERVER for each lsp server it can't install

Expected behavior

nvim is being running without any warning or information

LspInfo

Language client log: /home/mini/.local/state/nvim/lsp.log
 Detected filetype:   

 0 client(s) attached to this buffer: 

 Configured servers list: jedi_language_server, sumneko_lua, quick_lint_js, clangd, rust_analyzer

LspLog

I just have a lot of this:
[WARN][2022-12-22 11:30:39] .../lua/vim/lsp.lua:1065    "server_request: no handler found for"  "workspace/diagnostic/refresh"

Healthcheck

mason: require("mason.health").check()
========================================================================
## mason.nvim report
  - OK: neovim version >= 0.7.0
  - WARNING: **Go**: not available
  - WARNING: **cargo**: not available
  - WARNING: **luarocks**: not available
  - OK: **Ruby**: `ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]`
  - OK: **RubyGem**: `3.3.5`
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - ERROR: **npm**: not available
  - ERROR: **node**: not available
  - OK: **python3**: `Python 3.10.6`
  - OK: **pip3**: `pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)`
  - OK: **javac**: `javac 17.0.5`
  - OK: **java**: `openjdk version "17.0.5" 2022-10-18`
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.21.2 built on linux-gnu.`
  - OK: **curl**: `curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.13`
  - OK: **gzip**: `gzip 1.10`
  - OK: **tar**: `tar (GNU tar) 1.34`
  - WARNING: **pwsh**: not available
  - OK: **bash**: `GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)`
  - OK: **sh**: `Ok`
  - WARNING: **JAVA_HOME**: not available
  - OK: GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Thu 22 Dec 2022 08:09:00 PM +0330.

Screenshots or recordings

No response

sdsaati commented 1 year ago

I removed pylsp server and instead used this require('lspconfig').pylsp.setup{} manually to solve the problem, but have no idea why it can't be installed through mason-lspconfig itself.

williamboman commented 1 year ago

Hello! So if I had to guess it's because installation fails, so every time Neovim launches it'll try to install the package because it's not yet installed. Are you seeing any errors in the :Mason window and in the :MasonLog that could help you pinpoint the issue perhaps?

sdsaati commented 1 year ago

Thanks for your response, The last 2 lines of :MasonLog is :

[INFO  Thu 29 Dec 2022 02:15:00 AM +0330] ...acker/start/mason.nvim/lua/mason-core/installer/init.lua:119: Executing installer for Package(name=python-lsp-server)
[ERROR Thu 29 Dec 2022 02:15:00 AM +0330] ...acker/start/mason.nvim/lua/mason-core/installer/init.lua:155: Installation failed for Package(name=python-lsp-server) error="...acker/start/mason.nvim/lua/mason-core/installer/init.lua:122: ...r/start/mason.nvim/lua/mason-core/managers/pip3/init.lua:90: Unable to create python3 venv environment."

Now when I tried to install pyright through :Mason (by pressing i on it) it installed it correctly and now all the things are working so well! Thank you problem is solved by your suggestion