I noticed while debuging a custom function a while ago that every time my Org-roam database is synchronized, the following message gets printed to my messages buffer:
As I was exploring the Org-roam database parameters lately, I stumbled upon the org-roam-db--connection variable, and noticed the last path to my local database was the only one using the ~ notation, since it is right after <finalizer> I thought I had the culprit.
#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data
("/home/USER/.local/share/org/" #s(emacsql-sqlite-builtin-connection #<sqlite db=0x64432f287950 name=/home/USER/.emacs.d/.local/cache/org-roam.db> nil #<finalizer> "~/.emacs.d/.local/cache/org-roam.db")))
I thought it was odd, because I have not customized the org-roam-db-location variable. Anyway, I decided to set it from my config using (expand-file-name "~/.emacs.d/.local/cache/org-roam.db").
Changes took effect, but the message is still there after calling org-roam-db-sync. It has no side effect that I could tell so far, but no one likes stuff to fail in their Emacs, so I thought Iād ask around.
Whatās the value of your org-roam-database-connector? If itās not āsqlite-builtinā and Doom Emacs lets you, I suggest you try the built-in SQLite. Does this make sense to you?
Thanks for replying.
The value for that variable is indeed sqlite-builtinā¦
Just to make sure that part is clear, it is as far as I know only a failure message printed; apart from that, everything seems to be working fineā¦
I would not even know about it if it was not for some unrelated debugging I did recentlyā¦
When you say āmove Doom out of the equationā, you mean for testing ?
I would not actually know how to do that and still ensure org-roam loads. That would require some minimal config if only to get the files locations right I guess.
I had this problem since yesterday too, so I spent many a hours to figure out whats going āwrongā. There are a couple of reports regarding this, but nobody has been able to figure out what is happening yet.
This is not an issue, the message is being created from redundant garbage collection calls to close the connection to the database. Turns out org-roam manually closes the connection to the database when doing a sync
And it is this finalizer call that fails - because there is nothing to close - the connection has already been closed diligently manually by org-roam, there is no loose thread to clean up.
You can debug the close function to find out more for yourself-
If the message annoys you a lot you can modify this function to gracefully handle the case when (oref connection handle) is nil, that would suppress the message.
I am using this to suppress redundant calls to emacsql-close.
(oref connection handle) would return nil if connection to the database has been closed already. A before-while advice would be responsible for checking this, the original function donāt need to be meddled with. This should be safe for all practical purpose (i hope )
Thank you for taking the time to report back on your findings in this thread; with an helpful and detailed walk through as always. It is good to know where the warning was coming from, and have a solution to suppress it too !
Unexplained warnings are always a source of concern that one is doing something wrong with their config, especially for users without a lot of experience with Emacs.