this post was submitted on 09 Jul 2023
4 points (100.0% liked)

ntfy

45 readers
1 users here now

ntfy (pronounced notify) is a simple HTTP-based pub-sub notification service. You can use it to send push notifications to your phone via HTTP PUT/POST.

ntfy websiteDocumentationGitHubGoogle PlayF-DroidDiscordApp StoreMatrix

If you'd like to become a sponsor, I would be humbled to accept your donation via GitHub Sponsors or Liberapay 💸💰.

founded 1 year ago
MODERATORS
 

I do POSTs from a backend app to a self-hosted ntfy instance (docker). The POSTs do not fail and I also save them in local db. I now compare the notifications cached in /var/cache/ntfy/cache.db against the ones I save in my local db and I see that ntfy is missing a lot. As an example, today for example I have POSTed 540 times and in cache.db I see only 60 of them. The skipped ones are not even at regular intervals.

Is there a logfile I can check in the ntfy service? The output of the ntfy process itself only shows the expected INFO Server stats... message but not errors.

Is there any reason ntfy may not be registering some of the POSTed notifications?

Best regards.

Edit: I can also confirm on the mobile app that I did not receive the skipped ones; I have only received indeed the ones that I see in ntfy's cache.db.

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 11 months ago (1 children)

Nevermind. I found the problem. It was not NTFY's fault. Some of the notifications that were POSTed to NTFY, didn't follow the correct syntax (was sending "attach" in the JSON as string[] instead of a single string).

Would be nice though if NTFY could provide a debug log to catch such cases.

[–] [email protected] 2 points 11 months ago (1 children)

That's a great username, dude. 😎 Glad you solved your problem.

Next time, check out this page to help you increase the log levels: https://docs.ntfy.sh/troubleshooting/

[–] [email protected] 1 points 11 months ago (1 children)

I also see log-file option. Is it possible to log both to a file (for later inspection) and to stderr?

[–] [email protected] 1 points 11 months ago

It is not possible to log to both. I'm sure there is some Unix trick to do both, but I don't know.