kndndrj / nvim-dbee

Interactive database client for neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dbee ui toggle throws error

walkabout21 opened this issue · comments

A recently introduced change has broken my ability to open the ui tray. An attempts result in the following error

E5108: Error executing lua function DbeeGetCurrentConnection[1]..remote#define#request, line 2: Vim(let):Error invoking '0:fun
ction:DbeeGetCurrentConnection' on channel 3:                                                                                
Invalid channel: 3
stack traceback:
        [C]: in function 'DbeeGetCurrentConnection'
        ...ocal/share/nvim/lazy/nvim-dbee/lua/dbee/handler/init.lua:156: in function 'get_current_connection'
        ...al/share/nvim/lazy/nvim-dbee/lua/dbee/ui/drawer/init.lua:62: in function 'new'
        ....local/share/nvim/lazy/nvim-dbee/lua/dbee/entry/init.lua:88: in function 'setup_ui'
        ....local/share/nvim/lazy/nvim-dbee/lua/dbee/entry/init.lua:130: in function 'open_ui'
        ....local/share/nvim/lazy/nvim-dbee/lua/dbee/entry/init.lua:125: in function 'toggle_ui'
        ...e/tuc55745/.local/share/nvim/lazy/nvim-dbee/lua/dbee.lua:24: in function 'toggle'
        [string ":lua"]:1: in main chunk

Health check shows the following error even after clean plugin install

DBee report ~
- ERROR Binary version "eff37431d0a7c4808d7def9013e1edcde6ab4582" doesn't match either:
    - current hash: "6d074e5472b44f1b8e6e647b1e177996f442e0d2" or
    - hash of latest tag "6d074e5472b44f1b8e6e647b1e177996f442e0d2".

Hey, healthcheck is not working properly (#57 ), but i see that your binary is the current latest one.

Are you aware of the recent refactor? and the breaking changes (see #19)

I looked over the breaking changes but I don't see anything that would affect me since I'm using a very simple base config. Maybe I'm missing something?

return {
	"kndndrj/nvim-dbee",
	dependencies = {
		"MunifTanjim/nui.nvim",
	},
	build = function()
		require("dbee").install()
	end,
	config = function()
		require("dbee").setup(		--[[optional config]]
)
	end,
}

hmm thats strange.

can you try opening a fresh nvim session and running
:lua require("dbee.entry.__register")()

and after that
:lua= vim.fn.DbeeGetCurrentConnection()
and see if that results in an error.

oh, and maybe chek the contents of
$HOME/.cache/nvim/dbee/dbee.log (or something like that) - there might be something insightful.

I am getting similar error after a clean install.
running .open() :

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1019de150
]
goroutine 11 [running]:
github.com/neovim/go-client/msgpack.handleAbort(0x14000aa7e90)
	/Users/runner/go/pkg/mod/github.com/neovim/go-client@v1.2.1/msgpack/msgpack.go:58 +0x80
panic({0x10350f8c0?, 0x1041c6cd0?})
	/Users/runner/hostedtoolcache/go/1.21.5/x64/src/runtime/panic.go:914 +0x218
github.com/kndndrj/nvim-dbee/dbee/core.(*Connection).GetID(...)
	/Users/runner/work/nvim-dbee/nvim-dbee/dbee/core/connection.go:82
E5108: Error executing lua function DbeeGetCurrentConnection[1]..remote#define#request, line 2: Vim(let):Error invoking 
'0:function:DbeeGetCurrentConnection' on channel 13:
ch 13 was closed by the client
stack traceback:
	[C]: in function 'DbeeGetCurrentConnection'
	...ocal/share/nvim/lazy/nvim-dbee/lua/dbee/handler/init.lua:156: in function 'get_current_connection'
	...al/share/nvim/lazy/nvim-dbee/lua/dbee/ui/drawer/init.lua:62: in function 'new'
	....local/share/nvim/lazy/nvim-dbee/lua/dbee/entry/init.lua:88: in function 'setup_ui'
	....local/share/nvim/lazy/nvim-dbee/lua/dbee/entry/init.lua:130: in function 'open_ui'
	...rs/f/.local/share/nvim/lazy/nvim-dbee/lua/dbee.lua:29: in function 'open'

Subsequently running .open() again getting :

E5108: Error executing lua function DbeeGetCurrentConnection[1]..remote#define#request, line 2: Vim(let):Error invoking '0:function:DbeeGetCurrentConnection' on channel 15:
Invalid channel: 15
stack traceback:

	[C]: in function 'DbeeGetCurrentConnection'
	...ocal/share/nvim/lazy/nvim-dbee/lua/dbee/handler/init.lua:156: in function 'get_current_connection'
	...al/share/nvim/lazy/nvim-dbee/lua/dbee/ui/drawer/init.lua:62: in function 'new'
	....local/share/nvim/lazy/nvim-dbee/lua/dbee/entry/init.lua:88: in function 'setup_ui'
	....local/share/nvim/lazy/nvim-dbee/lua/dbee/entry/init.lua:130: in function 'open_ui'
	...rs/f/.local/share/nvim/lazy/nvim-dbee/lua/dbee.lua:29: in function 'open'
	[string ":lua"]:1: in main chunk

I tkink i might know what the problem is. I'm not able to fix it rn, but do you have any connections specified? If not, please try specifying them and try again.

The backend is working, because the function You tried to call is not the first one to be called. These seems to just be an unhandled nil somewhere in there.

I'll get back to you once i look further into this.

I have a connection setup using env vars. same error

Can you paste the whole panic message please? e.g. the rest of this:

	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1019de150
]
goroutine 11 [running]:
github.com/neovim/go-client/msgpack.handleAbort(0x14000aa7e90)
	/Users/runner/go/pkg/mod/github.com/neovim/go-client@v1.2.1/msgpack/msgpack.go:58 +0x80
panic({0x10350f8c0?, 0x1041c6cd0?})
	/Users/runner/hostedtoolcache/go/1.21.5/x64/src/runtime/panic.go:914 +0x218
github.com/kndndrj/nvim-dbee/dbee/core.(*Connection).GetID(...)
	/Users/runner/work/nvim-dbee/nvim-dbee/dbee/core/connection.go:82```

I believe this is it:

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x103386150
]
goroutine 12 [running]:
github.com/neovim/go-client/msgpack.handleAbort(0x14000aade90)
	/Users/runner/go/pkg/mod/github.com/neovim/go-client@v1.2.1/msgpack/msgpack.go:58 +0x80
panic({0x104eb78c0?, 0x105b6ecd0?})
	/Users/runner/hostedtoolcache/go/1.21.5/x64/src/runtime/panic.go:914 +0x218
github.com/kndndrj/nvim-dbee/dbee/core.(*Connection).GetID(...)
	/Users/runner/work/nvim-dbee/nvim-dbee/dbee/core/connection.go:82
github.com/kndndrj/nvim-dbee/dbee/handler.(*connectionWrap).MarshalMsgPack(0x104e8c700?, 0x14000aa0068?
)
	/Users/runner/work/nvim-dbee/nvim-dbee/dbee/handler/marshal.go:78 +0x20
github.com/neovim/go-client/msgpack.marshalEncoder(0x0?, {0x104e8c700?, 0x14000aa0068?, 0x0?})
	/Users/runner/go/pkg/mod/github.com/neovim/go-client@v1.2.1/msgpack/encode.go:299 +0x60
github.com/neovim/go-client/msgpack.marshalPtrEncoder(0x1050bf688?, {0x104e8c700?, 0x14000aa0068?, 0x0?})
	/Users/runner/go/pkg/mod/github.com/neovim/go-client@v1.2.1/msgpack/encode.go:293 +0x98
github.com/neovim/go-client/msgpack.(*Encoder).Encode(0x14000b30000, {0x104e8c700?, 0x14000aa0068?})
	/Users/runner/go/pkg/mod/github.com/neovim/go-client@v1.2.1/msgpack/encode.go:67 +0x104
github.com/neovim/go-client/msgpack/rpc.(*Endpoint).reply(0x14000a549c0, 0x104e8d0c0?, {0x10509e058?, 0x14000a96130?}, {0x104e8c700, 0x14000aa0068})
	/Users/runner/go/pkg/mod/github.com/neovim/go-client@v1.2.1/msgpack/rpc/rpc.go:506 +0x224
github.com/neovim/go-client/msgpack/rpc.(*Endpoint).handleRequest.func1()
	/Users/runner/go/pkg/mod/github.com/neovim/go-client@v1.2.1/msgpack/rpc/rpc.go:560 +0x184
created by github.com/neovim/go-client/msgpack/rpc.(*Endpoint).handleRequest in goroutine 1
	/Users/runner/go/pkg/mod/github.com/neovim/go-client@v1.2.1/msgpack/rpc/rpc.go:549 +0x2f8

This fixed it for me