# Database issue: processing modified files every time

**URL:** https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823
**Category:** Troubleshooting
**Created:** [July 1, 2025, 9:39am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823 "2025-07-01T09:39:02Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [July 1, 2025, 9:39am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/1 "2025-07-01T09:39:02Z")

</div>

Hey! I keep getting very slow startup and repeated scanning of nodes every time I open up a node. Something seems to be up with my database. Any idea how to resolve this?

```auto
*Messages*
Clearing removed files...                           
Processing modified files...done                   
Finalizer failed: (wrong-type-argument sqlitep nil)

```

I tried `C-u M-x org-roam-db-sync` based on [user-error The Org-roam database was created with a newer Org-roam version · Issue #832 · org-roam/org-roam · GitHub](https://github.com/org-roam/org-roam/issues/832)  
but that didn’t work.

I’m not sure on which version I am, since `org-roam-version` returns  
`funcall-interactively: Search failed: "\\(?:;; Version: \\([^z-a]*?$\\)\\)"`. But the folder name is `~/.emacs.d/elpa/org-roam-20250701.528/`.

I got the below warnings when updating the package:

```auto
 ■ Warning (native-compiler): org-roam.el:217:29: Warning: the function ‘org-roam-descendant-of-p’ is not known to be defined.
 ■ Warning (native-compiler): org-roam-id.el:88:19: Warning: the function ‘org-roam-list-files’ is not known to be defined.
 ■ Warning (native-compiler): org-roam-id.el:60:43: Warning: the function ‘org-roam-node-point’ is not known to be defined.
 ■ Warning (native-compiler): org-roam-id.el:55:23: Warning: the function ‘org-roam-node-file’ is not known to be defined.
 ■ Warning (native-compiler): org-roam-id.el:54:35: Warning: the function ‘org-roam-node-create’ is not known to be defined.
 ■ Warning (native-compiler): org-roam-id.el:54:16: Warning: the function ‘org-roam-populate’ is not known to be defined.
 ■ Warning (native-compiler): org-roam-id.el:42:7: Warning: the function ‘org-roam-up-heading-or-point-min’ is not known to be defined.
 ■ Warning (native-compiler): org-roam-id.el:40:22: Warning: the function ‘org-roam-db-node-p’ is not known to be defined.
 ■ Warning (native-compiler): org-pdftools.el:446:19: Warning: the function ‘org-export-file-uri’ is not known to be defined.
 ■ Warning (native-compiler): org-pdftools.el:138:74: Warning: the function ‘equalp’ is not known to be defined.

```

I’ve manually removed the org-roam folder mentioned above and restarted emacs to see if there was an issue with the native compiled cache or something, but I get the same issue. It triggers when I hit `org-roam-dailies-goto-today` or just open up any org-mode file for the first time.

---

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [July 1, 2025, 11:44am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/2 "2025-07-01T11:44:19Z")

</div>

Someone on `#emacs` pointed me to  
[Enabling org-roam leads to launch error finalizer failed: (wrong-type-argument sqlitep nil) · Issue #8066 · doomemacs/doomemacs · GitHub](https://github.com/doomemacs/doomemacs/issues/8066),  
which then forwards to  
[What is responsible for this db-sync 'finalizer failure' message? - #12 by akashp](https://org-roam.discourse.group/t/what-is-responsible-for-this-db-sync-finalizer-failure-message/3567/12)  
I don’t fully get it though. I’m on emacs 30.1.

---

<div class="post-metadata">

### Author: ![akashp](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/akashp/32/1383_2.png) [@akashp](https://org-roam.discourse.group/u/akashp)
#### Post date: [July 1, 2025, 1:42pm UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/3 "2025-07-01T13:42:35Z")

</div>

try recompiling packages - `package-recompile-all`  
if not solved, eval `(sqlite-available-p)` and see whether it returns y or n.

---

<div class="post-metadata">

### Author: ![dmg](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dmg](https://org-roam.discourse.group/u/dmg)
#### Post date: [July 1, 2025, 9:26pm UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/4 "2025-07-01T21:26:40Z")

</div>

something else you might want to try is erasing your sqlite database file. It will be created automatically next time you use org-roam functions.

---

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [July 2, 2025, 8:28am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/5 "2025-07-02T08:28:06Z")

</div>

Thanks! I’ve done `package-recompile-all` and then `(sqlite-available-p)` returns `t`. I’ve then deleted `~/org/org-roam.db` (my org-roam-directory is a different folder though, so this may be an older file!).

These are some relevant settings in [my config](https://github.com/japhir/ArchConfigs/blob/master/myinit.org):

```auto
    (setq org-roam-db-update-on-save nil) ;; I've also tried t
    (org-roam-db-autosync-mode)

```

I’m not seeing a new database file pop up now. When I manually `org-roam-db-sync` I get the message (not warning!) `finalizer failed: (wrong-type-argument sqlitep nil)`.  
So I’m guessing it’s slow because it never manages to write the db and tries to rebuild it every time, only to fail… But e.g. `org-roam-node-find` does work.

---

<div class="post-metadata">

### Author: ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)
#### Post date: [July 2, 2025, 9:54am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/6 "2025-07-02T09:54:11Z")

</div>

> [@japhir](#):
>
> I keep getting very slow startup and repeated scanning of nodes every time I open up a node.

Is this the issue you would like to resolve? There are two problems you report (they may or may not be technically related).

1. “Slow startup”
2. “Repeated scanning of nodes every time I open up a node.

Separately, you reported

- Finalizer failed: (wrong-type-argument sqlitep nil)
- `org-roam-version` returns some error
- Multiple warnings about functions not known

Do not worry about “Finalizer failed” message for now. We collectively know what it is, and it is unlikely related to 1 or 2 (I could be wrong but it won’t be the first thing to look into).

Has either of your main issues (1 or 2) behave any differently?

Where is your database? Do you know how to find it?

---

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [July 2, 2025, 11:36am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/7 "2025-07-02T11:36:22Z")

</div>

Thanks! I don’t care so much about the slow startup because I use emacs as a daemon. It’s really the fact that every time I open a node or file with nodes or C-z to add a note to drawer, it needs to Clear and Process files and this takes so long that’s it’s disruptive.

Good point about the database, I was using [fd](https://github.com/sharkdp/fd) “org-roam.db” but this didn’t find it, because I forgot to pass the `-H` flag 😇. Doing C-h v org-roam-db-location showed me `~/.emacs.d/elpa/org-roam-20250701.528/org-roam.db.el` and `.elc` so I’ve deleted that file as well as the `~/.emacs.d/eln-cache/` directory. I have now deleted all the org-roam-db.el and org-roam.db files I could find and have triggered re-creating the database (whew it’s a bit slow!). Fingers crossed that this will fix the issue! I’ll resolve this if it does.

---

<div class="post-metadata">

### Author: ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)
#### Post date: [July 2, 2025, 1:03pm UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/8 "2025-07-02T13:03:18Z")

</div>

> [@japhir](#):
>
> `~/.emacs.d/elpa/org-roam-20250701.528/org-roam.db.el`

This and .elc files are not your database… They are part of the program source. The db is saved as the filename specified by variable `org-roam-db-location`. The extension is `.db` by default.

---

<div class="post-metadata">

### Author: ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)
#### Post date: [July 2, 2025, 1:12pm UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/9 "2025-07-02T13:12:58Z")

</div>

> [@japhir](#):
>
> It’s really the fact that every time I open a node or file with nodes or C-z to add a note to drawer, it needs to Clear and Process files

How exactly do you “open a node”? And what is C-z map to? By default C-z is not mapped to any org-file. Are you using Doom or something?

When you use Emacs as a demon, does it keep the session? Or a new session is created every time? (If you don’t run emacs-server, this may be the case). If latter, it is possible that every time you open a file from your terminal emulator (with `emacs -nw FILE.org` as an example) your org-roam may get initialized — hence, your Emacs on daemon may scan all files in your org-roam repository.

This is my speculation. You need to share or think about how exactly you initialize Emacs, org-roam, and “open” your org-roam node.

I use Emacs as an app (with GUI) without daemon, so I keep a single Emacs session for the whole day. My Emacs does not scan all the org-roam files every time I visit one of them via org-roam-node-find or find-file commands.

---

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [July 2, 2025, 1:26pm UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/10 "2025-07-02T13:26:26Z")

</div>

Ah yeah that was dumb. Deleted the whole package so my use-package will re-install. The next restart of emacs re-created the `~/.emacs.d/org-roam.db` file. However, after building the database this still triggers (on creating a new node, opening a node, or anything to do with nodes) those “Processing modified files…50%” churns… Will try to delete the db once more and see what happens…

---

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [July 3, 2025, 2:51pm UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/11 "2025-07-03T14:51:26Z")

</div>

Hmm it’s still behaving weird. Now when I open any org-roam file it shows the same warnings as before, but after indexing these files are now no longer delayed. But somehow it has not scanned all my nodes, and only half of my notes show up when I org-roam-node-find. When I open up one of the notes that refer to these notes that don’t show up, it re-indexes again and then these also show up and the system is fast. But after several hours it starts all over even though I’m still in the same emacs session… This is really frustrating my daily use ☹.

Thanks for the help so far! 🙂

---

<div class="post-metadata">

### Author: ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)
#### Post date: [July 3, 2025, 4:56pm UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/12 "2025-07-03T16:56:09Z")

</div>

> [@japhir](#):
>
> But after several hours it starts all over even though I’m still in the same emacs session…

Do you sync your note files with an external server? I suspect the answer is yes, and if this is the case, please make sure the sync does not change the file’s attributes — e.g. modified date. If file attributes get updated, I believe Org-roam treats that as a change to the file for database update.

> [@japhir](#):
>
> Now when I open any org-roam file

How do you open them?

---

<div class="post-metadata">

### Author: ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)
#### Post date: [July 3, 2025, 4:58pm UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/13 "2025-07-03T16:58:22Z")

</div>

Has Org-roam ever behaved without any issues before? Is this your first time to use Org-roam?

---

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [July 9, 2025, 11:16am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/14 "2025-07-09T11:16:43Z")

</div>

Yes, I sync the files via owncloud for backup. I don’t think it changes anything about the files but I’ll disable the sync for a while to see if that improves things.

I open files either with e.g. `org-roam-dailies-find-today` (which I have bound to C-c C-n n) but also just opening my regular todo files or org-files that contain ID’s trigger the change, i.e. with `find-file` C-x C-f.

I have been using org-roam for at least 4 years, from before v2. I’ve never had to deal with this kind of cache issue! 😮

---

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [July 17, 2025, 6:35am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/15 "2025-07-17T06:35:15Z")

</div>

Hmmm could this be because I’ve recently moved my entire org directory into an encrypted mirror that is then mounted to plaintext (with [gocryptfs](https://nuetzlich.net/gocryptfs/quickstart/))?

---

<div class="post-metadata">

### Author: ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)
#### Post date: [July 18, 2025, 12:22am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/16 "2025-07-18T00:22:53Z")

</div>

I have no idea what all these encryptions do, but org-roam uses SHA1 hash of the content of the current buffer to check if it has been changed from the state when the file was saved (SHA1 hash is saved along the absolute file name). If any part of your system (sync or file encryption) changes the file’s hash (this may include file’s attributes such as last modified time stamp), then Org-roam will see the file as changed.

See this part of the code as an example: [org-roam/org-roam-db.el at 89dfaef38b6caa3027f20f96a551dc8f194ac533 · org-roam/org-roam · GitHub](https://github.com/org-roam/org-roam/blob/89dfaef38b6caa3027f20f96a551dc8f194ac533/org-roam-db.el#L559)

---

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [July 18, 2025, 8:17am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/17 "2025-07-18T08:17:43Z")

</div>

I just went back through my daily notes and I was experiencing this org-roam slowness before I encrypted my `~/org` folder. I’ve experienced a more reasonable amount of slowness recently, but it’s still not anywhere close to the speed I had come to expect. I think the improvement may be just because I’ve been running long sessions and most of the notes were open already as buffers and at least that was now fast. I’ve moved the database location to the same folder in the hopes that it getting the same encryption treatment would help somehow.

Recently I also noticed that when I startup, not all the nodes were listed. When I opened up the today daily note, and from there try to insert a link (`org-roam-node-insert`) or switch to a node (`org-roam-node-find`) that I know exist, some of them were not shown. After opening the note up manually with C-x C-f everything in the folder shows up again and starts to work normally. Weirdly this now no longer reproduce when I restart my emacsclient, even though I have not changed my settings.

To reproduce what’s happening now, I’ve restarted my emacsclient and looked at it from scratch:  
I’ve now configured org-roam to defer loading until I open an org-node. This means that opening a regular org-file is now fast (basically instant) again initially. However, when I org-roam-dailies-find-today and roam initializes (slow, same messages as in first post), opening up regular org files triggers the same slow process as well. In contrast to what I describe above prior to my restart, however, now processing modified/deleted files is pretty fast and it seems workable but still not as fast as it used to be.

Sorry for the hard-to-reproduce issue, I’m very confused by this.

---

<div class="post-metadata">

### Author: ![dmg](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dmg](https://org-roam.discourse.group/u/dmg)
#### Post date: [August 13, 2025, 5:12am UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/18 "2025-08-13T05:12:09Z")

</div>

One thing you can try is determine if the problem is the database or is updating the database.

Open the database with SQLIte and look for a file in the DB that you have trouble with (adjust to the location of your database). Note that filenames are wrapped between double quotes (that is an emacsql thing).

 ![image](https://global.discourse-cdn.com/free1/uploads/orgroam/original/2X/a/a62dc773bfd58f7f31e763f44cd7be5562872d61.jpeg)

---

<div class="post-metadata">

### Author: ![japhir](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@japhir](https://org-roam.discourse.group/u/japhir)
#### Post date: [March 3, 2026, 7:58pm UTC](https://org-roam.discourse.group/t/database-issue-processing-modified-files-every-time/3823/19 "2026-03-03T19:58:13Z")

</div>

Phew, quite a bit later I have finally figured it out!  
In my citar-org-roam setup, I had set it up such that every time org-mode is initialized, citar-org-roam-mode is set as well, and this apparently triggered a database update.

Changing my init from the bad:

```auto
(use-package citar-org-roam
  :after (citar org-roam)
  :hook (org-mode . citar-org-roam-mode))

```

to simply

```auto
(use-package citar-org-roam
  :after (citar org-roam)
  :config (citar-org-roam-mode 1))

```

resolved the issue for me!

phew, that was a hard one to catch. I don’t know what got into me to hook it in like that!

> <https://github.com/japhir/ArchConfigs/blob/master/myinit.org#citar>
