mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 15:05:49 +03:00
[GH-ISSUE #1070] 500 Server error - unable to open database file #744
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#744
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 @ric-m on GitHub (Oct 12, 2024).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1070
Fresh install of HeathchecksUI on Raspberry Pi 64 bit OS (Bookworm) running in docker container.
I can get to the login screen but after that I get a 500 Server error.
Turning on debug I get the following output:
followed by a lot of debug output, including:
Note: the external:internal port mapping has been changed to 8010:8000 to avoid conflict
Note: healthchecks reports "unhealthy" status
I'd really appreciate someone being able to walk me through the checks I need to make to resolve the issue.
Many thanks,
Ric
@cuu508 commented on GitHub (Oct 14, 2024):
Thanks for the report.
How does the command line for starting the container look?
@ric-m commented on GitHub (Oct 15, 2024):
Hello,
All my docker containers are configured via docker compose. Strating a container is therefore nothing more than the usual
docker compose up -d.I've included an anonymised compose.yaml file at the end for completeness.
What I can see is the following screen after trying to log in:
There doesn't appear to be a file at
/usr/local/lib/python3.12/site-packages/django/db/backends/sqlite3/base.pyand yet the error is reported at line 200....compose.yaml:
It would not surprise me if theres somewthing amiss with that configration..
Regards,
Ric
@cuu508 commented on GitHub (Oct 15, 2024):
Perhaps there's a permissions issue with
../../volumes/healthchecks/healthchecks-data?If you drop into a shell inside the healthchecks container, can you create files in
/data?@BuethSam commented on GitHub (Oct 15, 2024):
I just had the same problem.
I checkt that docker image is running as user 999 with
dc exec healthchecks idI set the ownership of the directory to
999:999and that fixed it.@ric-m commented on GitHub (Oct 15, 2024):
Well now... that's very interesting here's the result:
no data folder... also
/healthchecks-datais emptyand aren't the container files mapped to
/var/lib/docker/overlay2/..?I've also just added GUID / PGID = 1000 (me) and then 0 (root). Again, same as before, "unable to open database file".
Regards,
Ric
@ric-m commented on GitHub (Oct 15, 2024):
I tried that and yes, my UID/GID, etc are all 999. Butit changed nothing. But see my next post.
Cheers,
Ric
@ric-m commented on GitHub (Oct 15, 2024):
Well, this is the most curious thing.
I have been checking other docker compose files and came across this:
I pretty much copied the file verbatim an added a superuser/passwd, etc, nothing more apart from a target IP of 192.168.1.55 and port 8000.
Using those credentials I could log in and accessed the screen where it says "My First Check".
So I guess that's it. Why the one should work and not the other I still have to find out. I intend to add-in, incrementally, more of the parameters from my original compose.yaml file to see if there is a specific directive that breaks it.
For reference, here is the compose.yaml from linuxserver, anonymised:
The first thing I'm going to do is change the location of the volumes file to be consistent with all the other containers.
Thanks all for your comments. I am pretty much a newcomer to linux, Raspberry Pi, docker, etc but I'm enjoying the learning from people who know a lot more than me...
I also need to get to know how to use the software.
Regards,
Ric
@cuu508 commented on GitHub (Oct 16, 2024):
@ric-m
You are looking for the data folder inside
/opt/healthchecksand inside/opt/healthchecks/docker.But your docker-compose file mounts the volume on a folder inside the root directory:
/data. It also instructs healthchecks to look for the sqlite database there:@crazybob1215 commented on GitHub (Oct 18, 2024):
I'm seeing this same error. My volume mapping looks like this:
From a fresh install, the external folder permissions look like this:
If I change the permissions to be 999:999, it changes to:
But fixing the group doesn't seem to matter since it's not getting read or write anyway. I've tried manually adding read & write for the group, but when I restart the container it is set back to no permissions for the group.
Moving into the container, if I try to follow the internal volume mapping, the postgresql folder isn't being created, and permissions for the /var directory are all root.
I'm not sure what I'm missing here?
@cuu508 commented on GitHub (Oct 19, 2024):
@crazybob1215 the original issue is about sqlite driver not being able to access the database file. But from your comment it seems like you are using postgresql. Are you sure you are seeing the same error?
@retifrav commented on GitHub (Oct 11, 2025):
In case someone else ends up here like me: with Docker in rootless mode the
999:999user within the container results in100998:100998on the host, so I needed to change the ownership of the mappeddatapath on the host to those values. Of course, a crudechmod -R 777 /path/to/datawould have "solved" the problem too, but that's not a good way to go about it.Alternatively, it could have probably been solved with
--useror/andUID/GIDon creating the container, but I've never been able to apply those correctly.