kndndrj / nvim-dbee

Interactive database client for neovim
GNU General Public License v3.0
710 stars 48 forks source link

module secrets not found #1

Closed cseickel closed 1 year ago

cseickel commented 1 year ago

I'm really looking forward to trying out this plugin but I failed on the initial load. i get this on startup of nvim:

Failed to load `plugins.dbees`                                                                                                                                
/home/user/.config/nvim/lua/plugins/dbees.lua:4: module 'secrets' not found:                                                                                  
^Ino field package.preload['secrets']                                                                                                                         
cache_loader: module secrets not found                                                                                                                        
cache_loader_lib: module secrets not found                                                                                                                    
^Ino file './secrets.lua'                                                                                                                                     
^Ino file '/usr/share/luajit-2.1.0-beta3/secrets.lua'                                                                                                         
^Ino file '/usr/local/share/lua/5.1/secrets.lua'                                                                                                              
^Ino file '/usr/local/share/lua/5.1/secrets/init.lua'                                                                                                         
^Ino file '/usr/share/lua/5.1/secrets.lua'                                                                                                                    
^Ino file '/usr/share/lua/5.1/secrets/init.lua'                                                                                                               
^Ino file './secrets.so'                                                                                                                                      
^Ino file '/usr/local/lib/lua/5.1/secrets.so'                                                                                                                 
^Ino file '/usr/lib/lua/5.1/secrets.so'                                                                                                                       
^Ino file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                 
# stacktrace:                                                                                                                                                 
  - ~/.config/nvim/lua/plugins/dbees.lua:4                                                                                                                    
  - ~/.config/nvim/lua/lazy-bootstrap.lua:14                                                                                                                  
  - lua/:1 

I used the quickstart for lazy from the README:

return {
  "kndndrj/nvim-dbee",
  dir = require("secrets").get("dbee_path"),
  dependencies = {
    "MunifTanjim/nui.nvim",
  },
  build = function()
    -- Install tries to automatically detect the install method.
    -- if it fails, try calling it with one of these parameters:
    --    "curl", "wget", "bitsadmin", "go"
    require("dbee").install()
  end,
  config = function()
    require("dbee").setup(--[[optional config]])
  end,
}
Dmitrev commented 1 year ago

Same issue, uncommenting the dir line did the trick for me, lets me install it atleast:

{
  "kndndrj/nvim-dbee",
  -- dir = require("secrets").get("dbee_path"),
  dependencies = {
    "MunifTanjim/nui.nvim",
  },
  build = function()
    -- Install tries to automatically detect the install method.
    -- if it fails, try calling it with one of these parameters:
    --    "curl", "wget", "bitsadmin", "go"
    require("dbee").install()
  end,
  config = function()
    require("dbee").setup(--[[optional config]])
  end,
},

After install the plugin doesn't seem to work:

Running install

:lua require('dbee').install()

[install]: installing dbee with:  wget chmod                                                                                                                                                    
[install]: running command: wget                                                                                                                                                                
Press ENTER or type command to continue

after presssing ENTER:

Error executing luv callback:
vim/_editor.lua:0: E5560: nvim_echo must not be called in a lua loop callback
stack traceback:
        [C]: in function 'nvim_echo'
        vim/_editor.lua: in function 'notify'
        ....local/share/nvim/lazy/nvim-dbee/lua/dbee/utils/init.lua:72: in function 'log'
        ...ocal/share/nvim/lazy/nvim-dbee/lua/dbee/install/init.lua:7: in function 'log_info'
        ...ocal/share/nvim/lazy/nvim-dbee/lua/dbee/install/init.lua:168: in function 'run_jobs'
        ...ocal/share/nvim/lazy/nvim-dbee/lua/dbee/install/init.lua:199: in function <...ocal/share/nvim/lazy/nvim-dbee/lua/dbee/install/init.lua:192>
Press ENTER or type command to continue

Running open

:lua require('dbee').open()

E5108: Error executing lua FuncUndefined Autocommands for "Dbee_set_results_buf"..function remote#define#FunctionBootstrap[1]..remote#host#Require[10]..<SNR>10_Start_dbee, line 1: Vim(return):
E475: Invalid value for argument cmd: 'dbee' is not executable
stack traceback:
        [C]: in function 'Dbee_set_results_buf'
        ...ri/.local/share/nvim/lazy/nvim-dbee/lua/dbee/handler.lua:361: in function 'open'
        /home/dmitri/.local/share/nvim/lazy/nvim-dbee/lua/dbee.lua:110: in function 'open'
        [string ":lua"]:1: in main chunk
Press ENTER or type command to continue
kndndrj commented 1 year ago

@cseickel , @Dmitrev Hi, thanks for showing interest in the plugin! for the first issue: you already figured out... I'm terribly sorry about that - I just copy-pasted that from my config and didn't catch that - but yeah, "dir" shouldn't be there.

as for issue nr.2 - it seems there are some issues with nvim's built-in notify function. Either way this doesn't mean it's been installed yet:

[install]: installing dbee with:  wget chmod                                                                                                                                                    
[install]: running command: wget                                                                                                                                                                
Press ENTER or type command to continue

please wait untill you see something like sucessfully installed before pressing enter.

Please try this out and let me know if it solved the issue. meanwhile I need to remove dirfrom the readme and look into the second issue.

kndndrj commented 1 year ago

@Dmitrev @cseickel Update: Edited the readme and addressed the install issue.

cseickel commented 1 year ago

Thanks @Dmitrev. I managed to get through the install and setup, but it fails on open:

E5108: Error executing lua ...ser/.local/share/nvim/lazy/nvim-dbee/lua/dbee/drawer.lua:133: attempt to index a nil value                                         
stack traceback:                                                                                                                                                 
        ...ser/.local/share/nvim/lazy/nvim-dbee/lua/dbee/drawer.lua:133: in function 'prepare_node'                                                              
        ...er/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:388: in function 'prepare'                                                                   
        ...er/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:416: in function '_prepare_content'                                                          
        ...er/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:431: in function 'render'                                                                    
        ...ser/.local/share/nvim/lazy/nvim-dbee/lua/dbee/drawer.lua:430: in function 'open'                                                                      
        /home/user/.local/share/nvim/lazy/nvim-dbee/lua/dbee.lua:110: in function 'open'                                                                         
        [string ":lua"]:1: in main chunk 

I'm guessing it doesn't work with a brand new install without any connections.

kndndrj commented 1 year ago

Oh, you are right... I'll add a log message. Thanks

kndndrj commented 1 year ago

@cseickel Update: fixed

cseickel commented 1 year ago

That works!