[GH-ISSUE #401] auth-file does not exist #307

Closed
opened 2026-05-07 00:22:52 +02:00 by BreizhHardware · 2 comments

Originally created by @gabrielrm on GitHub (Sep 18, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/401

Hi and congrats for your daughter!

I try using access control with auth-file: "/var/lib/ntfy/user.db" in server.yml while file user.db exists and is owned by the ntfy user and group, but still get the message auth-file does not exist; please start the server at least once to create it when try to add user with ntfy user add --role=admin someuser.

Checked on a raspberry pi 3 (selfhosted server) and on pc with debian, installed both from repository.

Any advice?

Thank you.

Originally created by @gabrielrm on GitHub (Sep 18, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/401 Hi and congrats for your daughter! I try using access control with `auth-file: "/var/lib/ntfy/user.db"` in `server.yml` while file `user.db` exists and is owned by the ntfy user and group, but still get the message `auth-file does not exist; please start the server at least once to create it` when try to add user with `ntfy user add --role=admin someuser`. Checked on a raspberry pi 3 (selfhosted server) and on pc with debian, installed both from repository. Any advice? Thank you.
Author
Owner

@wunter8 commented on GitHub (Sep 28, 2022):

I think the issue is that when you run the command, it's running as your logged in user, not as the ntfy user, so the process doesn't have permission to read user.db

Try this: sudo -u ntfy ntfy user add --role=admin someuser

<!-- gh-comment-id:1260287006 --> @wunter8 commented on GitHub (Sep 28, 2022): I think the issue is that when you run the command, it's running as your logged in user, not as the `ntfy` user, so the process doesn't have permission to read `user.db` Try this: `sudo -u ntfy ntfy user add --role=admin someuser`
Author
Owner

@gabrielrm commented on GitHub (Sep 28, 2022):

Yes, that's it. No more error if command is run as user ntfy.
Thank you.

<!-- gh-comment-id:1261111941 --> @gabrielrm commented on GitHub (Sep 28, 2022): Yes, that's it. No more error if command is run as user ntfy. Thank you.
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#307
No description provided.