mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #628] Help: /var/lib/ntfy/user.db not creating on docker #467
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#467
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @obxjames on GitHub (Feb 21, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/628
Problem:
Trying to set up user system from new release however running into the issue...
option auth-file not set; auth is unconfigured for this server
If it does recognise the server.yml is configured correctly it will error
2023/02/21 21:24:38 FATAL unable to open database file: no such file or directory (exit_code=1)
unable to open database file: no such file or directory
Tried so far:
Setup:
Using binwiederhier/ntfy:latest
Server.yml
@atomicangel commented on GitHub (Feb 23, 2023):
I am experiencing this issue as well. The only lines I have modified are base-url:, auth-file:, and auth-default-access:.
If anything can be done to assist in testing, let me know.
My configuration is Let's Encrypt certs through Nginx reverse proxy with a redirect set for non-HTTPS connections, if that makes a difference. I did notice I had to specify https:// when referring to my server instead of ntfy.sh, when posting via curl.
@atomicangel commented on GitHub (Feb 23, 2023):
Adding to this, I tried enabling the cache.db and that also failed with the following:
`2023/02/23 16:26:50 FATAL database is locked (exit_code=1)
database is locked
2023/02/23 16:26:56 FATAL database is locked (exit_code=1)
database is locked
2023/02/23 16:27:03 FATAL database is locked (exit_code=1)
database is locked
2023/02/23 16:27:09 FATAL database is locked (exit_code=1)
database is locked
Here are the relevant bits of the config:cache-file: "/var/cache/ntfy/cache.db"
cache-duration: "12h"
# cache-startup-queries:
# cache-batch-size: 0
# cache-batch-timeout: 0ms
auth-file: "/var/lib/ntfy/user.db"
auth-default-access: "read-write"
# auth-startup-queries:
`
@binwiederhier commented on GitHub (Feb 23, 2023):
This is likely a permissions issue. Be sure that the user that ntfy is running as can read and write the
/var/cache/ntfyfolder and the file/var/cache/ntfy/cache.db, and/or theuser.dbfile and its folder as well.@atomicangel commented on GitHub (Feb 24, 2023):
A little more context for my situation: I'm mapping the /var and /etc folders to a mounted network share. However, I have confirmed that I am mounting them using the correct user UID and GID's for the shares. I tried adding the PUID and PGID variables without success.
I did open the console and I was able to successfully touch a file under both /etc/ntfy and /var/cache/ntfy that appeared in the external folder as expected.
@binwiederhier commented on GitHub (Feb 28, 2023):
These sort of problems are easier to solve on Discord or Matrix. I cannot help you much here, without a lot of interactive back and forth.
@obxjames commented on GitHub (Mar 1, 2023):
No worries, happy for you to message me on matrix. obxjames@obexus.co.uk
@binwiederhier commented on GitHub (Mar 3, 2023):
That's not what I meant. I meant for you to join the Matrix/Discord room and ask for help there. :-)
@rounakdatta commented on GitHub (Apr 13, 2023):
@obxjames can you share what was the resolution for you?
@bulburDE commented on GitHub (Oct 22, 2023):
I had this issue that I got the error message
when setting
auth-file: "/var/lib/ntfy/user.db"I was using the docker-compose.yml from the documentation. I looked into the container and noticed that /var/lib/ntfy didn't exist which seems to be the reason for hte
no such file or directoryerror.After adding
to the docker-compose.yml it worked.
I rechecked the documentation but couldn't find such instructions.
@ovizii commented on GitHub (Oct 31, 2023):
Thanks for sharing your solution to the problem it immediately fixed my issue too. This should be added to the documentation :-)
@DatadudeDev commented on GitHub (Nov 23, 2024):
I resolved my issue this way (Same problem, no user.db created on runtime).
My docker compose file:
version: "2.3"
services:
ntfy:
image: binwiederhier/ntfy
container_name: ntfy
command:
- serve
environment:
- TZ=UTC # optional: set desired timezone
user: USER:USER ###update this part ###
volumes:
- /var/cache/ntfy:/var/cache/ntfy
- /etc/ntfy:/etc/ntfy
ports:
- 4547:80
healthcheck: # optional: remember to adapt the host:port to your environment
test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:80/v1/health -O - | grep -Eo '"healthy"\s*:\s*true' || exit 1"]
interval: 60s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
@vs4vijay commented on GitHub (Dec 9, 2024):
I am facing the same issue, I have mounted the directory from docker, here my config:
I tried adding docker volume as well:
Still same errors:
@wunter8 commented on GitHub (Dec 9, 2024):
@vs4vijay are you on Discord? That generally works better for troubleshooting stuff like this. And it would avoid notifying everyone that's participated in this issue each time we send a message back and forth