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 healthcheck for "vim.lsp" plugin. Exception #18602

Closed
nabezokodaikon opened this issue May 17, 2022 · 8 comments · Fixed by #18610
Closed

Failed to run healthcheck for "vim.lsp" plugin. Exception #18602

nabezokodaikon opened this issue May 17, 2022 · 8 comments · Fixed by #18610
Labels
bug issues reporting wrong behavior has:plan lsp

Comments

@nabezokodaikon
Copy link

Neovim version (nvim -v)

NVIM v0.8.0-dev+1684-g6613f58ce

Vim (not Nvim) behaves the same?

no, vim

Operating system/version

macOS 12.3.1

Terminal name/version

iTerm2

$TERM environment variable

screen-256color

Installation

home brew

How to reproduce the issue

Start neovim.
run checkhealth.

Expected behavior

checkhealth does not detect any errors.

Actual behavior

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - ERROR: Failed to run healthcheck for "vim.lsp" plugin. Exception:
    function health#check, line 20
    Vim(eval):E5108: Error executing lua ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: attempt to index a nil value
    stack traceback:
    ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: in function 'check'
    [string "luaeval()"]:1: in main chunk
@nabezokodaikon nabezokodaikon added the bug issues reporting wrong behavior label May 17, 2022
@clason clason added the lsp label May 17, 2022
@clason
Copy link
Member

clason commented May 17, 2022

This is the check for the size of the log file, which (now) is almost never written to unless you set the log level yourself. You need to replace the mentioned line 20 in lsp/health.lua by

local log_file = vim.loop.fs_stat(log_path)
local log_size = log_file and logfile.size or 0

@nabezokodaikon
Copy link
Author

Where should I place lsp/health.lua?

@clason
Copy link
Member

clason commented May 17, 2022

It's under runtime/lua. (To be clear, that is a bug in Neovim's runtime file that should be fixed. PR welcome!)

@nabezokodaikon
Copy link
Author

difficult...

@clason
Copy link
Member

clason commented May 17, 2022

Not really, but you don't have to do it. You'll just have to wait for someone else, then.

@nabezokodaikon
Copy link
Author

By the way, when I set health.lua, the number of errors increased.

lsp: require("lsp.health").check()
========================================================================
  - ERROR: Failed to run healthcheck for "lsp" plugin. Exception:
    function health#check, line 20
    Vim(eval):E5108: Error executing lua [string "luaeval()"]:1: attempt to index a boolean value
    stack traceback:
    [string "luaeval()"]:1: in main chunk

justinmk pushed a commit that referenced this issue May 17, 2022
Problem:
    vim.lsp: require("vim.lsp.health").check()
    ========================================================================
      - ERROR: Failed to run healthcheck for "vim.lsp" plugin. Exception:
        function health#check, line 20
        Vim(eval):E5108: Error executing lua ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: attempt to index a nil value
        stack traceback:
        ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: in function 'check'
        [string "luaeval()"]:1: in main chunk

Solution:
Check for nil.

fix #18602
dmitmel pushed a commit to dmitmel/neovim that referenced this issue May 18, 2022
Problem:
    vim.lsp: require("vim.lsp.health").check()
    ========================================================================
      - ERROR: Failed to run healthcheck for "vim.lsp" plugin. Exception:
        function health#check, line 20
        Vim(eval):E5108: Error executing lua ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: attempt to index a nil value
        stack traceback:
        ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: in function 'check'
        [string "luaeval()"]:1: in main chunk

Solution:
Check for nil.

fix neovim#18602
@nabezokodaikon
Copy link
Author

confirmed. Thank you!

kraftwerk28 pushed a commit to kraftwerk28/neovim that referenced this issue Jun 1, 2022
Problem:
    vim.lsp: require("vim.lsp.health").check()
    ========================================================================
      - ERROR: Failed to run healthcheck for "vim.lsp" plugin. Exception:
        function health#check, line 20
        Vim(eval):E5108: Error executing lua ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: attempt to index a nil value
        stack traceback:
        ...m/HEAD-6613f58/share/nvim/runtime/lua/vim/lsp/health.lua:20: in function 'check'
        [string "luaeval()"]:1: in main chunk

Solution:
Check for nil.

fix neovim#18602
@ghost

This comment was marked as off-topic.

@neovim neovim locked as resolved and limited conversation to collaborators Feb 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug issues reporting wrong behavior has:plan lsp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants