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

missing references from database #97

Open
inevespace opened this issue Sep 27, 2024 · 1 comment
Open

missing references from database #97

inevespace opened this issue Sep 27, 2024 · 1 comment

Comments

@inevespace
Copy link

papis.nvim shows fewer references than my database has (18 from 60). I believe it is due to following error I get when open any file.

Error detected while processing function startify#open_buffers[13]..<SNR>51_open_buffer[12]..BufReadPost Autocommands for "*":  
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:35: Error executing lua: /usr/share/nvim/runtime/filetype.lua
:36: function startify#open_buffers[13]..<SNR>51_open_buffer[12]..BufReadPost Autocommands for "*"..FileType Autocommands for "markdown"..FileType Autocommands for "markdown": Vim(append):Error executing lua callback: ...nvim/lazy-rocks/papis.nvim/share/lua/5.1/sqlite/stmt.lua:57: sqlite.lua: couldn't finalize statement, ERRMSG: UNIQUE constraint failed: data.ref stmt = (insert into data (abstract, author, files, papis_id, ref, title, year) values(:abstract, :author, :files, :papis_id, :ref, :title, :year))
                                                                                                                                
stack traceback:                                                                                                                
        [C]: in function 'assert'                                                                                               
        ...nvim/lazy-rocks/papis.nvim/share/lua/5.1/sqlite/stmt.lua:57: in function 'finalize'                                  
        ...e/nvim/lazy-rocks/papis.nvim/share/lua/5.1/sqlite/db.lua:451: in function 'fn'                                       
        ...nvim/lazy-rocks/papis.nvim/share/lua/5.1/sqlite/defs.lua:639: in function 'wrap_stmts'                               
        ...e/nvim/lazy-rocks/papis.nvim/share/lua/5.1/sqlite/db.lua:445: in function 'insert'                                   
        .../nvim/lazy-rocks/papis.nvim/share/lua/5.1/sqlite/tbl.lua:380: in function 'insert'                                   
        ...lai/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:72: in function 'update_main_tbls'                          
        ...lai/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:128: in function 'sync_storage_data'                        
        ...lai/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:164: in function 'sync_db'                                  
        ...lai/.local/share/nvim/lazy/papis.nvim/lua/papis/init.lua:115: in function 'start'                                    
        ...lai/.local/share/nvim/lazy/papis.nvim/lua/papis/init.lua:20: in function <...lai/.local/share/nvim/lazy/papis.nvim/lu
a/papis/init.lua:18>                                                                                                            
        [C]: in function 'nvim_exec_autocmds'                                                                                   
        ...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:161: in function <...hare/nvim/lazy/lazy.nvim/lua/lazy/core/
handler/event.lua:160>                                                                                                          
        [C]: in function 'xpcall'                                                                                               
        .../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:135: in function 'try'                                      
        ...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:160: in function 'trigger'                                  
        ...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:89: in function <...hare/nvim/lazy/lazy.nvim/lua/lazy/core/h
andler/event.lua:72>                                                                                                            
        [C]: in function 'nvim_cmd'                                                                                             
        /usr/share/nvim/runtime/filetype.lua:36: in function </usr/share/nvim/runtime/filetype.lua:35>                          
        [C]: in function 'nvim_buf_call'                                                                                        
        /usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>
stack traceback:                                                                                                                
        [C]: in function 'nvim_cmd'                                                                                             
        /usr/share/nvim/runtime/filetype.lua:36: in function </usr/share/nvim/runtime/filetype.lua:35>                          
        [C]: in function 'nvim_buf_call'                                                                                        
        /usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>                          
stack traceback:                                                                                                                
        [C]: in function 'nvim_buf_call'                                                                                        
        /usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>  

It looks like sqlite can't include some references to database from papis database. I tried to use whoosh and papis backend in papis.
:Papis reload data will cause same error message.

@jghauser
Copy link
Owner

Hi! Thanks for the error report. Usually, this error is caused by Papis entries that contain some mistakes. In particular, are you sure that the ref is unique for each entry? One way to check if there's a problem is to use the papis doctor command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants