lewis6991 / gitsigns.nvim

Git integration for buffers
MIT License
5.21k stars 191 forks source link

table index is nil #1134

Open emmanueltouzery opened 1 month ago

emmanueltouzery commented 1 month ago

Description

unfortunately i have no reproduction for the issue, nor am i sure what's going on. i have a script that's opening multiple files, which may be opening them fast. Maybe that's related to that. I am using the latest commit of gitsigns, 863903631e676b33e8be2acb17512fdc1b80b4fb.

Unfortunately I don't have much more info than the stack. If that's not enough, i guess just close the issue.. I've been using this version for a while and I don't recall seeing this, so i think it must be a rare issue.

If you close the issue and I manage to get more information, I'll reopen it with the extra info...

Neovim version

NVIM v0.10.1 Build type: Release LuaJIT 2.1.1713484068

Operating system and version

linux fedora 40

Expected behavior

No response

Actual behavior

Error executing luv callback: ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:95: The async coroutine failed: ...ack/packer/start/gitsigns.nvim/lua/gitsigns/git/repo.lua:145: table index is nil stack traceback: ...ack/packer/start/gitsigns.nvim/lua/gitsigns/git/repo.lua: in function 'get' ...ite/pack/packer/start/gitsigns.nvim/lua/gitsigns/git.lua:407: in function 'new' .../pack/packer/start/gitsigns.nvim/lua/gitsigns/attach.lua:280: in function 'fn' ...ack/packer/start/gitsigns.nvim/lua/gitsigns/debounce.lua:68: in function 'attach_throttled' .../pack/packer/start/gitsigns.nvim/lua/gitsigns/attach.lua:431: in function <.../pack/packer/start/gitsigns.nvim/lua/gitsigns/attach.lua:430> stack traceback: [C]: in function 'error' ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:95: in function 'cb' ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:145: in function 'on_exit' ...loads/nvim-0.10.1/share/nvim/runtime/lua/vim/_system.lua:300: in function <...loads/nvim-0.10.1/share/nvim/runtime/lua/vim/_system.lua:270> [C]: in function 'nvim_cmd' ...el/Downloads/nvim-0.10.1/share/nvim/runtime/filetype.lua:36: in function <...el/Downloads/nvim-0.10.1/share/nvim/runtime/filetype.lua:35> [C]: in function 'nvim_buf_call' ...el/Downloads/nvim-0.10.1/share/nvim/runtime/filetype.lua:35: in function <...el/Downloads/nvim-0.10.1/share/nvim/runtime/filetype.lua:10> [C]: in function 'bufload' ...er/start/nvim_config_private/lua/nvim_config_private.lua:181: in function 'find_import_types_calls_buf' ...er/start/nvim_config_private/lua/nvim_config_private.lua:185: in function 'find_import_types_calls_buf' ...er/start/nvim_config_private/lua/nvim_config_private.lua:95: in function 'elixir_absinthe_find_def' [string ":lua"]:1: in main chunk

Minimal config

for name, url in pairs{
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} do
local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
end
vim.opt.runtimepath:append(install_path)
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
  -- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. mkdir gitsigns_issue
  2. cd gitsigns_issue
  3. git init
  4. touch file
  5. git add file
  6. git commit -m 'initial commit'
  7. nvim --clean -u minimal.lua file
  8. ...

Gitsigns debug messages

No response

Gitsigns cache

No response

blurgyy commented 1 month ago

I'm also seeing this, I think this is not the first time I've encountered this.

I don't seem to be able to reproduce it either. It does feels like more likely to happen if I'm quickly operating. Here is the traceback I copied from the last time it happened:

Error executing luv callback:
...eovimPackages/start/gitsigns.nvim/lua/gitsigns/async.lua:95: The async coroutine failed: ...imPackages/start/gitsigns.nvim/lua/gitsigns/git/repo.lua:145: table index is nil
stack traceback:
        ...imPackages/start/gitsigns.nvim/lua/gitsigns/git/repo.lua: in function 'get'
        ...yNeovimPackages/start/gitsigns.nvim/lua/gitsigns/git.lua:407: in function 'new'
        ...ovimPackages/start/gitsigns.nvim/lua/gitsigns/attach.lua:280: in function 'fn'
        ...imPackages/start/gitsigns.nvim/lua/gitsigns/debounce.lua:68: in function 'attach_throttled'
        ...ovimPackages/start/gitsigns.nvim/lua/gitsigns/attach.lua:431: in function <...ovimPackages/start/gitsigns.nvim/lua/gitsigns/attach.lua:430>
stack traceback:
        [C]: in function 'error'
        ...eovimPackages/start/gitsigns.nvim/lua/gitsigns/async.lua:95: in function 'cb'
        ...eovimPackages/start/gitsigns.nvim/lua/gitsigns/async.lua:145: in function 'on_exit'
        ...-unwrapped-0.10.2/share/nvim/runtime/lua/vim/_system.lua:300: in function <...-unwrapped-0.10.2/share/nvim/runtime/lua/vim/_system.lua:270>
Press ENTER or type command to continue
metalinspired commented 1 month ago

For me it happens often when I use Telescope Live Grep to open a file.

falloutghost commented 1 month ago

Happens to me consistently when doing :PackerUpdate:

Error executing luv callback:
...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:95: The async coroutine failed: ...ack/packer/start/gitsigns.nvim/lu
a/gitsigns/git/repo.lua:145: table index is nil
stack traceback:
        ...ack/packer/start/gitsigns.nvim/lua/gitsigns/git/repo.lua: in function 'get'
        ...ite/pack/packer/start/gitsigns.nvim/lua/gitsigns/git.lua:407: in function 'new'
        .../pack/packer/start/gitsigns.nvim/lua/gitsigns/attach.lua:280: in function 'fn'
        ...ack/packer/start/gitsigns.nvim/lua/gitsigns/debounce.lua:68: in function 'attach_throttled'
        .../pack/packer/start/gitsigns.nvim/lua/gitsigns/attach.lua:431: in function <.../pack/packer/start/gitsigns.nvim/lua/gi
tsigns/attach.lua:430>
stack traceback:
        [C]: in function 'error'
        ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:95: in function 'cb'
        ...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:145: in function 'on_exit'
        ...nt_nvimz3tln9/usr/share/nvim/runtime/lua/vim/_system.lua:300: in function <...nt_nvimz3tln9/usr/share/nvim/runtime/lu
a/vim/_system.lua:270>

Plugin seems to work fine though.

vdrn commented 2 weeks ago

I'm getting this error too, when opening many files at roughly the same time. I believe this is the bug with vim.system function, as described here: https://github.com/neovim/neovim/issues/30846#issue-2595092466