Database error message in Windows

Greetings,
New Org-roam user here, but not new to Emacs. I’ve got it configured similarly on both Linux and Windows, with sqlite3.exe installed and found on the latter.

It’s been flawless on Linux so far, but the periodic cache saves are throwing the following error on Windows.

Debugger entered–Lisp error: (error “Selecting deleted buffer”)
#f(compiled-function (conn) #<bytecode 0x1fe4a05>)(#)
apply(#f(compiled-function (conn) #<bytecode 0x1fe4a05>) # nil)
emacsql-waiting-p(#)
#f(compiled-function (connection &optional timeout) “Block until CONNECTION is waiting for further input.” #<bytecode 0x1fe2d4d>)(#)
apply(#f(compiled-function (connection &optional timeout) “Block until CONNECTION is waiting for further input.” #<bytecode 0x1fe2d4d>) # nil)
emacsql-wait(#)
#f(compiled-function (connection sql &rest args) “Send SQL s-expression to CONNECTION and return the results.” #<bytecode 0x1fd945d>)(# [:select * :from files])
apply(#f(compiled-function (connection sql &rest args) “Send SQL s-expression to CONNECTION and return the results.” #<bytecode 0x1fd945d>) # [:select * :from files])
emacsql(# [:select * :from files])
apply(emacsql # [:select * :from files] nil)
org-roam-db-query([:select * :from files])
org-roam-db–get-current-files()
org-roam-db-build-cache()
org-roam-db-update-cache()
apply(org-roam-db-update-cache nil)
timer-event-handler([t 0 2 0 t org-roam-db-update-cache nil idle 0])

It is finding and creating my org-roam.db file, which has entries in it for the few files I’ve created. From the error here though, I’m not sure that everything is being saved when intended.

Seeing the call to org-roam-db–get-current-files in the stack trace above, I thought I would just run (org-roam-db–get-current-files) in my scratch buffer. Funny enough, that works fine.

Thoughts?

I have learned to accept it as a Windows only issue (I use Emacs+Org-roam only on Windows).

You run build cache function twice in a row; the first gets this error and the second successful. It has been the case since… the beginning of Org-roam as far as I can remember.

Tried to look; I cannot really tell exactly what or where the error is, but it seems to be coming from emacsql package. Didn’t raise any issue there, assuming the author won’t be interested in it (he might, but I could not bring myself to doing it).

My investigation is by no means definitive. You might be able to track down the root cause

Ah, OK thanks!
Since it does seem to be working (enough), I’ll focus for now on getting some notes taken.
Within org-roam specifically, I do sometimes see the delta notification at the bottom. Since it’s a cache and not the primary data store, I don’t feel any risk in at least getting more familiar.

If I feel ambitious later… :wink:

1 Like