Suddenly getting checkhealth issues

I was trying to install (or rather make mason install) a few extra LSP’s that I’ll need, however I had an issue installing asm_lsp by now I’ve figured out what the issue was with that by looking through mason logs, but I thought it may be easier to just do :checkhealth, when I did however I got this weird error.

E5009: Invalid $VIMRUNTIME: /usr/share/nvim/runtime
Error executing lua: [string "<nvim>"]:1: attempt to call field '_check' (a nil value)
stack traceback:
        [string "<nvim>"]:1: in main chunk

I looked into /usr/share/nvim/runtime, doing ripgrep I indeed didn’t fine any mention of ‘_check’ on its own. Then I did some digging into E5009 for which the documentation says:

                                        *E5009*
                Nvim depends on |$VIMRUNTIME|, 'runtimepath' and 'packpath' to
                find the standard "runtime files" for syntax highlighting,
                filetype-specific behavior, and standard plugins (including
                :checkhealth).  If the runtime files cannot be found then
                those features will not work.

I find that weird, I know that my syntax highlighting and plugins are working fine so (I assume) that it can find the files. I also went to /usr/share/nvim/runtime and plenty of files seem to be there and I didn’t change any of these files. I tried reverting the changes to my config as if that would somehow magically fix things which didn’t work (for the record, uninstalling the installed LSP’s also didn’t work).

Anywho, I literally have any clue what could be wrong here, does anyone else have any clue?

2 Likes

I’m seeing this now and don’t know if it’s the cause of other problems I’ve been having. Did you manage to fix it?

[edit]
I did a binary search to narrow it down to the following section of my init.vim:

Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': './install.sh'
    \ }

Commenting this out allows :checkhealth to produce a small bit of output, but it then errors out with:

Error executing lua: function health#lsp#check, line 1: Vim(call):E117: Unknown function: health#report_start
stack traceback:                                                                                                                                                                             
        [C]: in function 'call'                                                                                                                                                              
        /usr/share/nvim/runtime/lua/vim/health.lua:366: in function '_check'                                                                                                                 
        [string "<nvim>"]:1: in main chunk                        

More bisection led me to this line, which when removed prevents the second error:

Plug 'prabirshrestha/vim-lsp'

Looking closer, it seems the old report_health API was deprecated and replaced with a more concise set of functions. I’ve opened a PR on vim-lsp which fixes it for me.
Not sure about LanguageClient-neovim; that project hasn’t had any commits for 2 years.