# Log flooded with "indexing attachment: silverbullet.db-shm" and db-wal

**URL:** <https://community.silverbullet.md/t/log-flooded-with-indexing-attachment-silverbullet-db-shm-and-db-wal/1545>\
**Category:** v1: Troubleshooting (legacy)\
**Created:** [December 28, 2024, 3:53pm UTC](https://community.silverbullet.md/t/log-flooded-with-indexing-attachment-silverbullet-db-shm-and-db-wal/1545 "2024-12-28T15:53:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanzoghenzo](https://community.silverbullet.md/user_avatar/community.silverbullet.md/sanzoghenzo/32/796_2.png) [@sanzoghenzo](https://community.silverbullet.md/u/sanzoghenzo)\
**Post date:** [December 28, 2024, 3:53pm UTC](https://community.silverbullet.md/t/log-flooded-with-indexing-attachment-silverbullet-db-shm-and-db-wal/1545/1 "2024-12-28T15:53:19Z")

</div>

Hi there!

I’m hosting silverbullet on my NixOS server; I might have done something wrong with the setup, but while the web/PWA app runs OK, I constantly get these entries in the log:

```auto
Detected file change silverbullet.db-shm 1735400821454 1735400854531
Outside file change: reindexing silverbullet.db-shm
Indexing attachment silverbullet.db-shm
Outside file change: reindexing silverbullet.db-shm
Indexing attachment silverbullet.db-shm
Detected file change silverbullet.db-wal 1735400851471 1735400881445
Outside file change: reindexing silverbullet.db-wal
Indexing attachment silverbullet.db-wal
Outside file change: reindexing silverbullet.db-wal
Indexing attachment silverbullet.db-wal

```

notes and the database are all in the /var/lib/silverbullet folder, is this the issue? should the index db be in a separate folder than the notes?

---

<div class="post-metadata">

**Author:** ![sanzoghenzo](https://community.silverbullet.md/user_avatar/community.silverbullet.md/sanzoghenzo/32/796_2.png) [@sanzoghenzo](https://community.silverbullet.md/u/sanzoghenzo)\
**Post date:** [December 31, 2024, 10:56am UTC](https://community.silverbullet.md/t/log-flooded-with-indexing-attachment-silverbullet-db-shm-and-db-wal/1545/2 "2024-12-31T10:56:47Z")

</div>

Just for a sanity check: can anyone else see these messages or it’s only me?

I now have added the `*.db*` rule to the `spaceIgnore` section in my settings (and in`.gitignore` since I’m using the git plug) so everything is OK, but I thought that this would be something that silverbullet does automatically.

I must add that I had manually set up the envvar `SB_KV_DB=/var/lib/silverbullet/silverbullet.db` (no dot at the start of the filename), could it be that the outside file change detector ignores hidden files, so it is not a problem with the default options?

After some searching through the code base, I only found this, but I don’t know if it’s relevant (and it certainly doesn’t do anything even with the default database name)

> <https://github.com/silverbulletmd/silverbullet/blob/df9edc5d64711c970687e3547f610864f8578aa9/common/spaces/disk_space_primitives.ts#L15>

---

<div class="post-metadata">

**Author:** ![justyns](https://community.silverbullet.md/user_avatar/community.silverbullet.md/justyns/32/132_2.png) [@justyns](https://community.silverbullet.md/u/justyns)\
**Post date:** [January 5, 2025, 3:47pm UTC](https://community.silverbullet.md/t/log-flooded-with-indexing-attachment-silverbullet-db-shm-and-db-wal/1545/3 "2025-01-05T15:47:49Z")

</div>

I’m not 100% sure, but I think this is what excludes files that begin with `.`:

> <https://github.com/silverbulletmd/silverbullet/blob/f801fd263bd2eecdea1c6ef3da300c5acaf31a54/lib/plugos/syscalls/fs.deno.ts#L86>

And this is what triggers the attachment indexing:

> <https://github.com/silverbulletmd/silverbullet/blob/f801fd263bd2eecdea1c6ef3da300c5acaf31a54/common/spaces/evented_space_primitives.ts#L36-L40>

I think if you change `SB_KV_DB` to `/var/lib/silverbullet/.silverbullet.db`, you’ll probably get rid of the issue. But the code probably should automatically ignore the db file. If changing `SB_KV_DB` works for you, it’d be a good idea to open up a github issue

---

<div class="post-metadata">

**Author:** ![sanzoghenzo](https://community.silverbullet.md/user_avatar/community.silverbullet.md/sanzoghenzo/32/796_2.png) [@sanzoghenzo](https://community.silverbullet.md/u/sanzoghenzo)\
**Post date:** [January 5, 2025, 10:08pm UTC](https://community.silverbullet.md/t/log-flooded-with-indexing-attachment-silverbullet-db-shm-and-db-wal/1545/4 "2025-01-05T22:08:11Z")

</div>

Thanks for the pointers, I saw the indexing code, but missed the fs module!

As I wrote in my previous post, I solved by adding the files in the `spaceIgnore` in my SETTINGS file, but If I have to start over I’ll make sure to make it an hidden file.

I agree with you that silverbullet should automatically add the SB\_KV\_DB path (and the related wal and shm files) to the ignored paths.

---

<div class="post-metadata">

**Author:** ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)\
**Post date:** [January 8, 2025, 7:32pm UTC](https://community.silverbullet.md/t/log-flooded-with-indexing-attachment-silverbullet-db-shm-and-db-wal/1545/5 "2025-01-08T19:32:02Z")

</div>

Ok this just clicked. The reason you’re seeing this is indeed because your `.db` file does _not_ start with a `.` SilverBullet excludes all files and folders that start with `.` and therefore would never attempt to sync it. Simply renaming your DB file to start with a dot should fix this.

**Edit:** sorry I missed @justyns message, indeed — what he said.
