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

Neogit consistently throwing errors in specific repo (unable to pin point difference between working repo and this repo) #1486

Open
LarssonMartin1998 opened this issue Sep 24, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@LarssonMartin1998
Copy link

Description

Hey,

I only get this issue in our specific repository at work where I am completely unable to use Neogit, it flat out doesnt' work. When I run the :Neogit command to open and interact with git, it doesn't load for a few seconds and says v Head: 000000 (no commits). After a few seconds it throws an error log.

Given the log, at first I thought it was some issue with the serialized session, however, clearing the session and disabling the auto_session plugin made no difference.

Unfortunately, I haven't been able to pin point what the difference is in this repo versus all other repos where this plugin works wonders.

Neovim version

NVIM v0.11.0-dev-604+g3b87fa406
Build type: Release
LuaJIT 2.1.1724512491

Operating system and version

macOS 14.6.1

Steps to reproduce

Difficult to reproduce unless you're in a git repo with this same issue which I am unable to pin point. Otherwise, start neovim, enter :Neogit, and observe the issue.

Expected behavior

No response

Actual behavior

NeogitIssue.mp4

Here is the log:

Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 8 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:602: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 8 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:602: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 8 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:602: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 8 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:602: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 8 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:602: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 8 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:602: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../.local/share/nvim/lazy/neogit/lua/neogit/lib/buffer.lua:369: Invalid buffer id: 8
stack traceback:
	[C]: in function 'error'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'step'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:48: in function 'execute'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:118: in function 'callback'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'saved_callback'
	...are/nvim/lazy/plenary.nvim/lua/plenary/async/control.lua:126: in function 'tx'
	.../share/nvim/lazy/plenary.nvim/lua/plenary/async/util.lua:71: in function 'callback'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
	...son/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:299: in function <...son/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:264>

Minimal config

-- NOTE: See the end of this file if you are reporting an issue, etc. Ignore all the "scary" functions up top, those are
-- used for setup and other operations.
local M = {}

local base_root_path = vim.fn.fnamemodify(debug.getinfo(1, "S").source:sub(2), ":p:h") .. "/.min"
function M.root(path)
  return base_root_path .. "/" .. (path or "")
end

function M.load_plugin(plugin_name, plugin_url)
  local package_root = M.root("plugins/")
  local install_destination = package_root .. plugin_name
  vim.opt.runtimepath:append(install_destination)

  if not vim.loop.fs_stat(package_root) then
    vim.fn.mkdir(package_root, "p")
  end

  if not vim.loop.fs_stat(install_destination) then
    print(string.format("> Downloading plugin '%s' to '%s'", plugin_name, install_destination))
    vim.fn.system({
      "git",
      "clone",
      "--depth=1",
      plugin_url,
      install_destination,
    })
    if vim.v.shell_error > 0 then
      error(string.format("> Failed to clone plugin: '%s' in '%s'!", plugin_name, install_destination),
        vim.log.levels.ERROR)
    end
  end
end

---@alias PluginName string The plugin name, will be used as part of the git clone destination
---@alias PluginUrl string The git url at which a plugin is located, can be a path. See https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols for details
---@alias MinPlugins table<PluginName, PluginUrl>

---Do the initial setup. Downloads plugins, ensures the minimal init does not pollute the filesystem by keeping
---everything self contained to the CWD of the minimal init file. Run prior to running tests, reproducing issues, etc.
---@param plugins? table<PluginName, PluginUrl>
function M.setup(plugins)
  vim.opt.packpath = {}                      -- Empty the package path so we use only the plugins specified
  vim.opt.runtimepath:append(M.root(".min")) -- Ensure the runtime detects the root min dir

  -- Install required plugins
  if plugins ~= nil then
    for plugin_name, plugin_url in pairs(plugins) do
      M.load_plugin(plugin_name, plugin_url)
    end
  end

  vim.env.XDG_CONFIG_HOME = M.root("xdg/config")
  vim.env.XDG_DATA_HOME = M.root("xdg/data")
  vim.env.XDG_STATE_HOME = M.root("xdg/state")
  vim.env.XDG_CACHE_HOME = M.root("xdg/cache")

  -- NOTE: Cleanup the xdg cache on exit so new runs of the minimal init doesn't share any previous state, e.g. shada
  vim.api.nvim_create_autocmd("VimLeave", {
    callback = function()
      vim.fn.system({
        "rm",
        "-r",
        "-f",
        M.root("xdg")
      })
    end
  })
end

-- NOTE: If you have additional plugins you need to install to reproduce your issue, include them in the plugins
-- table within the setup call below.
M.setup({
  plenary = "https://github.com/nvim-lua/plenary.nvim.git",
  telescope = "https://github.com/nvim-telescope/telescope.nvim",
  diffview = "https://github.com/sindrets/diffview.nvim",
  neogit = "https://github.com/NeogitOrg/neogit"
})
-- WARN: Do all plugin setup, test runs, reproductions, etc. AFTER calling setup with a list of plugins!
-- Basically, do all that stuff AFTER this line.
require("neogit").setup({}) -- For instance, setup Neogit
@LarssonMartin1998 LarssonMartin1998 added the bug Something isn't working label Sep 24, 2024
@paolomissagia
Copy link

paolomissagia commented Oct 2, 2024

I think I am having a similar issue here - that only happens on one of my repo as well.

I had a look on the code based on my error and I think the issue is coming from the name of the repository open. Mine had a "%" symbol on it and after renaming the folder I was able to open Neogit without an issue.

Can you maybe try renaming it @LarssonMartin1998 ?

@CKolkey
Copy link
Member

CKolkey commented Oct 2, 2024

I'd be very curious if that's the issue, or if there's something else going on here.

@LarssonMartin1998
Copy link
Author

I think I am having the same issue here - that only happens on one of my repo as well.

I had a look on the code and I think the issue is coming from the name of the repository/folder open. Mine had a "%" symbol on it and after renaming the folder I was able to open Neogit without an issue.

Can you maybe try renaming it @LarssonMartin1998 ?

I just tried renaming it and it didn't have an effect.

This was the original path to the root: /Users/martin.larsson/Projs/Repos/NameOfProject
I also tried: /Users/martin.larsson/Projs/Repos/nop with the same issue.

This is an enterprise repo so I changed the name of the repo in this comment but it has the exact same spacing and capitalization.

Since this is an enterprise repo, it is on my work computer which has crowdstrike on it and the path is setup in CS to ignore some checks as to not impede our development (otherwise it drastically slows git and other things down). At first I thought that had something to do with it, but I moved the entire thing to ~/dev/git/nop and I still got the same issue

@CKolkey
Copy link
Member

CKolkey commented Oct 4, 2024

Alright, could you grab some logs for me?

NEOGIT_LOG_LEVEL="debug" NEOGIT_LOG_FILE="true" NEOGIT_DEBUG=true nvim

the logfile probably lives at ~/.cache/nvim/neogit.log

@LarssonMartin1998
Copy link
Author

Alright, could you grab some logs for me?

NEOGIT_LOG_LEVEL="debug" NEOGIT_LOG_FILE="true" NEOGIT_DEBUG=true nvim

the logfile probably lives at ~/.cache/nvim/neogit.log

Absolutely, here is the log:

[D 9.50.131] lib/state.lua:10               [STATE]: Reading file: '/Users/martin.larsson/.local/state/nvim/neogit/%Users%martin.larsson%Dev%git%nop'
[D 9.50.131] lib/state.lua:10               [STATE]: Loaded: '/Users/martin.larsson/.local/state/nvim/neogit/%Users%martin.larsson%Dev%git%nop'
[D 9.54.988] lib/git/repository.lua:188     [REPO]: Registered Repository for: /Users/martin.larsson/Dev/git/nop
[D 9.54.988] lib/git/repository.lua:200     [REPO]: Initializing Repository
[D 9.55.015] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "status", "--porcelain=2", "-b" }
[D 9.55.016] lib/git/repository.lua:235     [REPO]: Refreshed update_rebase_status in 0 ms
[D 9.55.017] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "log", "--format=ref_name%x1D%D%x1Fparent%x1D%P%x1Frel_date%x1D%cr%x1Fcommitter_date%x1D%cD%x1Fsanitized_subject_line%x1D%f%x1Fcommitter_name%x1D%cN%x1Ftree%x1D%T%x1Fcommit_notes%x1D%N%x1Fauthor_email%x1D%aE%x1Fabbreviated_parent%x1D%p%x1Fabbreviated_tree%x1D%t%x1Fsubject%x1D%s%x1Fabbreviated_commit%x1D%h%x1Fbody%x1D%b%x1Foid%x1D%H%x1Fcommitter_email%x1D%cE%x1Fauthor_date%x1D%aD%x1Fauthor_name%x1D%aN%x1Fencoding%x1D%e%x1E", "--no-patch", "--max-count=10" }
[D 9.55.018] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "rev-parse", "HEAD" }
[D 9.55.019] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "describe", "--long", "--tags", "HEAD" }
[D 9.55.019] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "status", "--porcelain=2", "-b" }
[D 9.55.020] lib/git/repository.lua:235     [REPO]: Refreshed update_bisect_information in 0 ms
[D 9.55.020] lib/git/repository.lua:235     [REPO]: Refreshed update_merge_status in 0 ms
[D 9.55.020] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "stash", "list" }
[D 9.55.020] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "status", "--porcelain=2", "-b" }
[D 9.55.021] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "status", "-z", "--porcelain=2" }
[D 9.55.021] buffers/status/init.lua:30     [STATUS] Registering instance for: /Users/martin.larsson/Dev/git/nop
[D 9.55.025] lib/buffer.lua:584             [BUFFER:8] Showing buffer in window 1006
[D 9.55.025] lib/buffer.lua:587             [BUFFER:8] Setting buffer options
[D 9.55.025] lib/buffer.lua:599             [BUFFER:8] Setting filetype: NeogitStatus
[D 9.55.029] lib/buffer.lua:604             [BUFFER:8] Building user key-mappings
[D 9.55.030] lib/buffer.lua:613             [BUFFER:8] Setting key-mappings
[D 9.55.030] lib/buffer.lua:634             [BUFFER:8] Initializing buffer
[D 9.55.031] lib/buffer.lua:639             [BUFFER:8] Setting window options
[D 9.55.031] lib/buffer.lua:663             [BUFFER:8] Rendering buffer
[D 9.55.032] lib/buffer.lua:668             [BUFFER:8] Setting autocmd for: FocusGained
[D 9.55.032] lib/buffer.lua:677             [BUFFER:8] Setting user autocmd for: NeogitRebase
[D 9.55.032] lib/buffer.lua:677             [BUFFER:8] Setting user autocmd for: NeogitFetchComplete
[D 9.55.033] lib/buffer.lua:677             [BUFFER:8] Setting user autocmd for: NeogitPullComplete
[D 9.55.033] lib/buffer.lua:677             [BUFFER:8] Setting user autocmd for: NeogitPushComplete
[D 9.55.033] lib/buffer.lua:677             [BUFFER:8] Setting user autocmd for: NeogitStash
[D 9.55.033] lib/buffer.lua:677             [BUFFER:8] Setting user autocmd for: NeogitReset
[D 9.55.033] lib/buffer.lua:677             [BUFFER:8] Setting user autocmd for: NeogitMerge
[D 9.55.033] lib/buffer.lua:695             [BUFFER:8] Running config.after callback
[D 9.55.033] watcher.lua:72                 [WATCHER] Watching git dir: /Users/martin.larsson/Dev/git/nop/.git
[D 9.55.033] lib/buffer.lua:702             [BUFFER:8] Setting up on_detach callback
[D 9.55.033] lib/buffer.lua:712             [BUFFER:8] Setting up context highlighting
[D 9.55.033] lib/buffer.lua:753             [BUFFER:8] Setting up foldmarkers
[D 9.55.033] lib/buffer.lua:794             [BUFFER:8] Setting CWD to: /Users/martin.larsson/Dev/git/nop
[D 9.55.033] buffers/status/init.lua:261    [STATUS] Beginning refresh from UNKNOWN
[D 9.55.034] lib/git/repository.lua:243     [REPO] Callback registered
[D 9.55.034] lib/git/repository.lua:266     [REPO] Already running - abort
[D 9.55.075] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "log", "--format=ref_name%x1D%D%x1Fparent%x1D%P%x1Frel_date%x1D%cr%x1Fcommitter_date%x1D%cD%x1Fsanitized_subject_line%x1D%f%x1Fcommitter_name%x1D%cN%x1Ftree%x1D%T%x1Fcommit_notes%x1D%N%x1Fauthor_email%x1D%aE%x1Fabbreviated_parent%x1D%p%x1Fabbreviated_tree%x1D%t%x1Fsubject%x1D%s%x1Fabbreviated_commit%x1D%h%x1Fbody%x1D%b%x1Foid%x1D%H%x1Fcommitter_email%x1D%cE%x1Fauthor_date%x1D%aD%x1Fauthor_name%x1D%aN%x1Fencoding%x1D%e%x1E", "--no-patch", "HEAD", "--max-count=1", "--topo-order" }
[D 9.55.099] lib/git/repository.lua:235     [REPO]: Refreshed update_stashes in 79 ms
[D 9.55.371] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "remote" }
[D 9.55.390] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "rev-parse", "release/6.48.2" }
[D 9.55.393] lib/git/repository.lua:235     [REPO]: Refreshed update_recent in 376 ms
[D 9.55.406] lib/git/repository.lua:235     [REPO]: Refreshed update_tags in 388 ms
[D 9.55.880] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "log", "--format=%x1E%H%x00", "--graph", "--color", "HEAD", "--max-count=1", "--topo-order" }
[D 9.56.418] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "log", "--max-count=1", "--format=%s", "5d0c0ebacf5cd237e598f50261b45212ea5171ee" }
[D 9.56.433] lib/git/repository.lua:235     [REPO]: Refreshed update_sequencer_status in 1415 ms
[D 9.57.016] lib/buffer.lua:587             [BUFFER:9] Setting buffer options
[D 9.57.016] lib/buffer.lua:599             [BUFFER:9] Setting filetype: NeogitConsole
[D 9.57.020] lib/buffer.lua:613             [BUFFER:9] Setting key-mappings
[D 9.57.020] lib/buffer.lua:668             [BUFFER:9] Setting autocmd for: WinLeave
[D 9.57.020] lib/buffer.lua:702             [BUFFER:9] Setting up on_detach callback
[D 9.57.024] lib/buffer.lua:587             [BUFFER:9] Setting buffer options
[D 9.57.025] lib/buffer.lua:599             [BUFFER:9] Setting filetype: NeogitConsole
[D 9.57.028] lib/buffer.lua:613             [BUFFER:9] Setting key-mappings
[D 9.57.028] lib/buffer.lua:668             [BUFFER:9] Setting autocmd for: WinLeave
[D 9.57.028] lib/buffer.lua:702             [BUFFER:9] Setting up on_detach callback
[D 9.57.028] lib/buffer.lua:587             [BUFFER:9] Setting buffer options
[D 9.57.028] lib/buffer.lua:599             [BUFFER:9] Setting filetype: NeogitConsole
[D 9.57.031] lib/buffer.lua:613             [BUFFER:9] Setting key-mappings
[D 9.57.031] lib/buffer.lua:668             [BUFFER:9] Setting autocmd for: WinLeave
[D 9.57.031] lib/buffer.lua:702             [BUFFER:9] Setting up on_detach callback
[D 9.57.032] lib/buffer.lua:587             [BUFFER:9] Setting buffer options
[D 9.57.032] lib/buffer.lua:599             [BUFFER:9] Setting filetype: NeogitConsole
[D 9.57.034] lib/buffer.lua:613             [BUFFER:9] Setting key-mappings
[D 9.57.034] lib/buffer.lua:668             [BUFFER:9] Setting autocmd for: WinLeave
[D 9.57.034] lib/buffer.lua:702             [BUFFER:9] Setting up on_detach callback
[D 9.57.904] lib/buffer.lua:688             [BUFFER:8] Clearing autocmd group
[D 9.57.904] lib/buffer.lua:705             [BUFFER:8] Running on_detach
[D 9.57.904] watcher.lua:84                 [WATCHER] Stopped watching git dir: /Users/martin.larsson/Dev/git/nop/.git
[D 9.79.708] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "branch", "--show-current" }
[D 9.79.710] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "rev-parse", "--short", "5d0c0ebacf5cd237e598f50261b45212ea5171ee" }
[D 9.79.712] lib/git/repository.lua:235     [REPO]: Refreshed update_status in 24690 ms
[D 9.79.712] lib/git/config.lua:102         [Config] Rebuilding git config_cache
[D 9.79.713] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "config", "--list", "--null", "--local" }
[D 9.79.722] lib/git/cli.lua:1056           Running command async failed - awaiting instead
[D 9.79.733] lib/git/repository.lua:235     [REPO]: Refreshed update_unpulled in 24714 ms
[D 9.79.734] lib/git/repository.lua:235     [REPO]: Refreshed update_unmerged in 24713 ms
[D 9.79.734] lib/git/cli.lua:1053           Running command async: { "git", "--no-pager", "--literal-pathspecs", "--no-optional-locks", "-c", "core.preloadindex=true", "-c", "color.ui=always", "log", "--max-count=1", "--format=%s", "5d0c0ebacf5cd237e598f50261b45212ea5171ee" }
[D 9.79.746] lib/git/repository.lua:235     [REPO]: Refreshed update_branch_information in 24731 ms
[D 9.79.746] lib/git/repository.lua:287     [REPO]: Refreshes complete in 24731 ms
[D 9.79.746] lib/git/repository.lua:249     [REPO]: Running refresh callback (1)
[D 9.79.746] buffers/status/init.lua:288    [STATUS] Rendering UI

@CKolkey
Copy link
Member

CKolkey commented Oct 5, 2024

I pushed some changes - could you pull the latest master and see if the issue persists, and if so.... more logs :)

@LarssonMartin1998
Copy link
Author

I pushed some changes - could you pull the latest master and see if the issue persists, and if so.... more logs :)

Hey, updated to latest and unfortunately the issue still persists, error log:

Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 12 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:606: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 12 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:606: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 12 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:606: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 12 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:606: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 12 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:606: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: vim/_editor.lua:0: nvim_exec2(): Vim(buffer):E86: Buffer 12 does not exist
stack traceback:
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...on/.local/share/nvim/lazy/neogit/lua/neogit/lib/util.lua:606: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../.local/share/nvim/lazy/neogit/lua/neogit/lib/buffer.lua:372: Invalid buffer id: 12
stack traceback:
	[C]: in function 'error'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'step'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:48: in function 'execute'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:118: in function 'callback'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'saved_callback'
	...are/nvim/lazy/plenary.nvim/lua/plenary/async/control.lua:126: in function 'tx'
	.../share/nvim/lazy/plenary.nvim/lua/plenary/async/util.lua:71: in function 'callback'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next'
	...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb'
	...son/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:303: in function <...son/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:268>

Neogit log:

[D 8.91.618] lib/state.lua:10               [STATE]: Reading file: '/Users/martin.larsson/.local/state/nvim/neogit/%Users%martin.larsson%dev%git%nop'
[D 8.91.619] lib/state.lua:10               [STATE]: Loaded: '/Users/martin.larsson/.local/state/nvim/neogit/%Users%martin.larsson%dev%git%nop'
[D 8.96.535] lib/git/repository.lua:191     [REPO]: Registered Repository for: /Users/martin.larsson/dev/git/nop
[D 8.96.535] lib/git/repository.lua:203     [REPO]: Initializing Repository
[D 8.96.564] lib/git/repository.lua:240     [REPO]: Refreshed update_bisect_information in 0 ms
[D 8.96.569] lib/git/repository.lua:240     [REPO]: Refreshed update_rebase_status in 0 ms
[D 8.96.570] lib/git/repository.lua:240     [REPO]: Refreshed update_merge_status in 0 ms
[D 8.96.571] buffers/status/init.lua:30     [STATUS] Registering instance for: /Users/martin.larsson/dev/git/nop
[D 8.96.590] lib/buffer.lua:593             [BUFFER:12] Showing buffer in window 1009
[D 8.96.590] lib/buffer.lua:596             [BUFFER:12] Setting buffer options
[D 8.96.590] lib/buffer.lua:608             [BUFFER:12] Setting filetype: NeogitStatus
[D 8.96.600] lib/buffer.lua:613             [BUFFER:12] Building user key-mappings
[D 8.96.600] lib/buffer.lua:622             [BUFFER:12] Setting key-mappings
[D 8.96.601] lib/buffer.lua:643             [BUFFER:12] Initializing buffer
[D 8.96.601] lib/buffer.lua:648             [BUFFER:12] Setting window options
[D 8.96.602] lib/buffer.lua:672             [BUFFER:12] Rendering buffer
[D 8.96.626] lib/buffer.lua:677             [BUFFER:12] Setting autocmd for: FocusGained
[D 8.96.626] lib/buffer.lua:686             [BUFFER:12] Setting user autocmd for: NeogitPushComplete
[D 8.96.626] lib/buffer.lua:686             [BUFFER:12] Setting user autocmd for: NeogitStash
[D 8.96.626] lib/buffer.lua:686             [BUFFER:12] Setting user autocmd for: NeogitReset
[D 8.96.626] lib/buffer.lua:686             [BUFFER:12] Setting user autocmd for: NeogitMerge
[D 8.96.627] lib/buffer.lua:686             [BUFFER:12] Setting user autocmd for: NeogitRebase
[D 8.96.627] lib/buffer.lua:686             [BUFFER:12] Setting user autocmd for: NeogitFetchComplete
[D 8.96.627] lib/buffer.lua:686             [BUFFER:12] Setting user autocmd for: NeogitPullComplete
[D 8.96.627] lib/buffer.lua:704             [BUFFER:12] Running config.after callback
[D 8.96.627] watcher.lua:53                 [WATCHER] Registered buffer StatusBuffer
[D 8.96.627] watcher.lua:86                 [WATCHER] Watching git dir: /Users/martin.larsson/dev/git/nop/.git
[D 8.96.627] lib/buffer.lua:711             [BUFFER:12] Setting up on_detach callback
[D 8.96.658] lib/buffer.lua:721             [BUFFER:12] Setting up context highlighting
[D 8.96.658] lib/buffer.lua:762             [BUFFER:12] Setting up foldmarkers
[D 8.96.658] lib/buffer.lua:803             [BUFFER:12] Setting CWD to: /Users/martin.larsson/dev/git/nop
[D 8.96.658] buffers/status/init.lua:269    [STATUS] Beginning refresh from UNKNOWN
[D 8.96.664] lib/git/repository.lua:248     [REPO] Callback registered from status
[D 8.96.664] lib/git/repository.lua:303     [REPO] (279896664) Already running - setting interrupt for 279896560
[D 8.96.705] lib/git/repository.lua:240     [REPO]: Refreshed update_bisect_information in 0 ms
[D 8.96.724] lib/git/repository.lua:240     [REPO]: Refreshed update_rebase_status in 0 ms
[D 8.96.729] lib/git/repository.lua:240     [REPO]: Refreshed update_merge_status in 0 ms
[D 8.97.094] lib/git/repository.lua:240     [REPO]: Refreshed update_stashes in 524 ms
[D 8.97.099] lib/git/repository.lua:240     [REPO]: Refreshed update_stashes in 375 ms
[D 8.97.205] lib/git/repository.lua:240     [REPO]: Refreshed update_recent in 643 ms
[D 8.97.213] lib/git/repository.lua:240     [REPO]: Refreshed update_recent in 545 ms
[D 8.97.233] lib/git/repository.lua:240     [REPO]: Refreshed update_tags in 508 ms
[D 8.97.251] lib/git/repository.lua:240     [REPO]: Refreshed update_tags in 682 ms
[D 8.98.562] lib/buffer.lua:596             [BUFFER:13] Setting buffer options
[D 8.98.562] lib/buffer.lua:608             [BUFFER:13] Setting filetype: NeogitConsole
[D 8.98.572] lib/buffer.lua:622             [BUFFER:13] Setting key-mappings
[D 8.98.572] lib/buffer.lua:677             [BUFFER:13] Setting autocmd for: WinLeave
[D 8.98.572] lib/buffer.lua:711             [BUFFER:13] Setting up on_detach callback
[D 8.98.583] lib/buffer.lua:596             [BUFFER:13] Setting buffer options
[D 8.98.583] lib/buffer.lua:608             [BUFFER:13] Setting filetype: NeogitConsole
[D 8.98.590] lib/buffer.lua:622             [BUFFER:13] Setting key-mappings
[D 8.98.590] lib/buffer.lua:677             [BUFFER:13] Setting autocmd for: WinLeave
[D 8.98.590] lib/buffer.lua:711             [BUFFER:13] Setting up on_detach callback
[D 8.98.590] lib/buffer.lua:596             [BUFFER:13] Setting buffer options
[D 8.98.591] lib/buffer.lua:608             [BUFFER:13] Setting filetype: NeogitConsole
[D 8.98.598] lib/buffer.lua:622             [BUFFER:13] Setting key-mappings
[D 8.98.599] lib/buffer.lua:677             [BUFFER:13] Setting autocmd for: WinLeave
[D 8.98.599] lib/buffer.lua:711             [BUFFER:13] Setting up on_detach callback
[D 8.98.600] lib/buffer.lua:596             [BUFFER:13] Setting buffer options
[D 8.98.600] lib/buffer.lua:608             [BUFFER:13] Setting filetype: NeogitConsole
[D 8.98.616] lib/buffer.lua:622             [BUFFER:13] Setting key-mappings
[D 8.98.616] lib/buffer.lua:677             [BUFFER:13] Setting autocmd for: WinLeave
[D 8.98.616] lib/buffer.lua:711             [BUFFER:13] Setting up on_detach callback
[D 8.98.668] lib/buffer.lua:596             [BUFFER:13] Setting buffer options
[D 8.98.669] lib/buffer.lua:608             [BUFFER:13] Setting filetype: NeogitConsole
[D 8.98.675] lib/buffer.lua:622             [BUFFER:13] Setting key-mappings
[D 8.98.675] lib/buffer.lua:677             [BUFFER:13] Setting autocmd for: WinLeave
[D 8.98.675] lib/buffer.lua:711             [BUFFER:13] Setting up on_detach callback
[D 8.98.780] lib/buffer.lua:596             [BUFFER:13] Setting buffer options
[D 8.98.781] lib/buffer.lua:608             [BUFFER:13] Setting filetype: NeogitConsole
[D 8.98.786] lib/buffer.lua:622             [BUFFER:13] Setting key-mappings
[D 8.98.786] lib/buffer.lua:677             [BUFFER:13] Setting autocmd for: WinLeave
[D 8.98.786] lib/buffer.lua:711             [BUFFER:13] Setting up on_detach callback
[D 8.98.786] lib/buffer.lua:596             [BUFFER:13] Setting buffer options
[D 8.98.787] lib/buffer.lua:608             [BUFFER:13] Setting filetype: NeogitConsole
[D 8.98.792] lib/buffer.lua:622             [BUFFER:13] Setting key-mappings
[D 8.98.792] lib/buffer.lua:677             [BUFFER:13] Setting autocmd for: WinLeave
[D 8.98.792] lib/buffer.lua:711             [BUFFER:13] Setting up on_detach callback
[D 8.98.792] lib/buffer.lua:596             [BUFFER:13] Setting buffer options
[D 8.98.792] lib/buffer.lua:608             [BUFFER:13] Setting filetype: NeogitConsole
[D 8.98.797] lib/buffer.lua:622             [BUFFER:13] Setting key-mappings
[D 8.98.797] lib/buffer.lua:677             [BUFFER:13] Setting autocmd for: WinLeave
[D 8.98.797] lib/buffer.lua:711             [BUFFER:13] Setting up on_detach callback
[D 8.98.991] lib/git/repository.lua:240     [REPO]: Refreshed update_sequencer_status in 2424 ms
[D 8.98.994] lib/git/repository.lua:240     [REPO]: Refreshed update_sequencer_status in 2279 ms
[D 8.99.770] lib/git/repository.lua:240     [REPO]: Refreshed update_status in 3064 ms
[D 8.99.773] lib/git/repository.lua:240     [REPO]: Refreshed update_status in 3209 ms
[D 8.99.778] lib/buffer.lua:697             [BUFFER:12] Clearing autocmd group
[D 8.99.778] lib/buffer.lua:714             [BUFFER:12] Running on_detach
[D 8.99.779] watcher.lua:66                 [WATCHER] Unregistered buffer StatusBuffer
[D 8.99.779] watcher.lua:69                 [WATCHER] No registered buffers - stopping
[D 8.99.779] watcher.lua:102                [WATCHER] Stopped watching git dir: /Users/martin.larsson/dev/git/nop/.git
[D 8.99.936] lib/git/config.lua:102         [Config] Rebuilding git config_cache
[D 8.99.951] lib/git/repository.lua:240     [REPO]: Refreshed update_unpulled in 3287 ms
[D 8.99.965] lib/git/repository.lua:240     [REPO]: Refreshed update_unmerged in 3395 ms
[D 8.99.981] lib/git/repository.lua:240     [REPO]: Refreshed update_unmerged in 3251 ms
[D 8.99.996] lib/git/repository.lua:240     [REPO]: Refreshed update_unpulled in 3436 ms
[D 9.00.027] lib/git/repository.lua:240     [REPO]: Refreshed update_branch_information in 3321 ms
[D 9.00.027] lib/git/repository.lua:325     [REPO]: (279896664) Refreshes complete in 3363 ms
[D 9.00.027] lib/git/repository.lua:254     [REPO]: (279896664) Running callback for status
[D 9.00.027] buffers/status/init.lua:298    [STATUS] Rendering UI
[D 9.00.051] lib/git/repository.lua:240     [REPO]: Refreshed update_branch_information in 3487 ms
[D 9.00.051] lib/git/repository.lua:321     [REPO]: (279896560) Interrupting on_complete callback

@CKolkey
Copy link
Member

CKolkey commented Oct 5, 2024

So this is more of a hack than a fix, but I think if you set auto_show_console = false in your neogit setup, it might resolve it. I'd still like to try to figure out why this is happening, but it might fix things for you

@LarssonMartin1998
Copy link
Author

That works! I have some more findings from disabling that though. When I open Neogit, I get notifications in nvim-notify saying:

Neogit: Command "git status --porcelain=2 -b" running for more than: 2.0

Open the command history for details

I should've mentioned in my issue post initally that my git is very slow due to crowdstrike. A regular git status takes ~2.5seconds. That might have something to do with it, and the reason it might fail in this project but not others is maybe because of the size of the repo.

Thanks for your help on this. I really appreciate it. Do you want me to close the issue with this workaround, or should I keep it open?

@Miyelsh
Copy link

Miyelsh commented Oct 7, 2024

So this is more of a hack than a fix, but I think if you set auto_show_console = false in your neogit setup, it might resolve it. I'd still like to try to figure out why this is happening, but it might fix things for you

CKolkey, thanks for finding the setting to fix this. I have been having this issue for months, whenever the console opens it throws an error. I thought the console was opening because of the error, not the error being caused by the console.

@CKolkey
Copy link
Member

CKolkey commented Oct 7, 2024

Ah, thats super annoying, sorry. It's been on my radar to fix, but my wife is about 8 months pregnant right now, so I haven't had tons of free time. But I kinda know whats up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants