[GH-ISSUE #1311] Messages not being recorded in cache.db despite cache-file configuration #930

Closed
opened 2026-05-07 00:28:51 +02:00 by BreizhHardware · 3 comments

Originally created by @flik1337 on GitHub (Apr 7, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1311

I've enabled caching in my ntfy server by setting the following configuration in /etc/ntfy/server.yml:

cache-file: "/var/cache/ntfy/cache.db"
# cache-duration: "12h"
# cache-startup-queries:
# cache-batch-size: 0
# cache-batch-timeout: "0ms"

However, after setting this up, I've observed that the messages table in cache.db remains empty

no messages are being recorded in the cache.

Image

I'm sure that ntfy has been restarted and has loaded the modified configuration file

Originally created by @flik1337 on GitHub (Apr 7, 2025). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1311 I've enabled caching in my ntfy server by setting the following configuration in /etc/ntfy/server.yml: ``` cache-file: "/var/cache/ntfy/cache.db" # cache-duration: "12h" # cache-startup-queries: # cache-batch-size: 0 # cache-batch-timeout: "0ms" ``` However, after setting this up, I've observed that the messages table in cache.db remains empty **no messages are being recorded in the cache.** <img width="942" alt="Image" src="https://github.com/user-attachments/assets/a098acd1-0012-4017-bb4d-d1c2243a6391" /> I'm sure that ntfy has been restarted and has loaded the modified configuration file
BreizhHardware 2026-05-07 00:28:51 +02:00
  • closed this issue
  • added the
    🪲 bug
    label
Author
Owner

@wunter8 commented on GitHub (Apr 7, 2025):

How are you running ntfy? Are you sure permissions are correct on the cache.db file?

<!-- gh-comment-id:2783890829 --> @wunter8 commented on GitHub (Apr 7, 2025): How are you running `ntfy`? Are you sure permissions are correct on the cache.db file?
Author
Owner

@flik1337 commented on GitHub (Apr 7, 2025):

The permissions on cache.db is

-rw-r--r-- 1 ntfy ntfy 57344 Apr  7 16:59 /var/cache/ntfy/cache.db

I'm running ntfy using systemctl

systemctl start ntfy
systemctl status ntfy
(base) root@ser420866090860:~# systemctl status ntfy
● ntfy.service - ntfy server
     Loaded: loaded (/lib/systemd/system/ntfy.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2025-04-07 14:27:16 UTC; 3h 4min ago
   Main PID: 717754 (ntfy)
      Tasks: 10 (limit: 4664)
     Memory: 10.1M
        CPU: 2.843s
     CGroup: /system.slice/ntfy.service
             └─717754 /usr/bin/ntfy serve --no-log-dates

Apr 07 17:22:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent>
Apr 07 17:23:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent>
Apr 07 17:24:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent>
Apr 07 17:25:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent>
Apr 07 17:26:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent>
<!-- gh-comment-id:2784087520 --> @flik1337 commented on GitHub (Apr 7, 2025): The permissions on cache.db is ``` -rw-r--r-- 1 ntfy ntfy 57344 Apr 7 16:59 /var/cache/ntfy/cache.db ``` I'm running ntfy using systemctl ``` systemctl start ntfy systemctl status ntfy ``` ``` (base) root@ser420866090860:~# systemctl status ntfy ● ntfy.service - ntfy server Loaded: loaded (/lib/systemd/system/ntfy.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2025-04-07 14:27:16 UTC; 3h 4min ago Main PID: 717754 (ntfy) Tasks: 10 (limit: 4664) Memory: 10.1M CPU: 2.843s CGroup: /system.slice/ntfy.service └─717754 /usr/bin/ntfy serve --no-log-dates Apr 07 17:22:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent> Apr 07 17:23:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent> Apr 07 17:24:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent> Apr 07 17:25:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent> Apr 07 17:26:16 ser420866090860 ntfy[717754]: INFO Server stats (emails_received=0, emails_received_failure=0, emails_received_success=0, emails_sent=0, emails_sent_failure=0, emails_sent>
Author
Owner

@wunter8 commented on GitHub (Apr 7, 2025):

Hmm. That looks good. I'm not sure why you're having issues. Have you checked your server.yml for indentation errors using something like yamllint.com?

<!-- gh-comment-id:2784298388 --> @wunter8 commented on GitHub (Apr 7, 2025): Hmm. That looks good. I'm not sure why you're having issues. Have you checked your server.yml for indentation errors using something like yamllint.com?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#930
No description provided.