-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permissions incorrect on gravity.db and pihole-FTL.conf #610
Comments
Seeing the issue here as well, causing problems when starting the container. Getting the following error before the container stops:
|
Same issue. Chowning all files to 999:999 doesn't seem to help. I believe is an issue with the webgui user and those files within docker. EDIT: Ok this is indeed a file permission problem. I have /etc/pihole binded to host. Don't know why pihole-FTL.db gets reowned to root:root when I restart the container. It's supposed to be owned by pihole:pihole or at least www-data. Also @jcputney, @umpire7777777 are you bind mounting /etc/pihole to host and using setfacl by any chance? |
the issue is, at least in my case, related to acl permissions to the /etc/pihole/pihole-FTL.db file and dirs. Tried mounting to different dir and worked without issues. Will report back how I fixed it with setfacl once I figure it out. |
ok fixed it giving permissions to each of the nodes with setfacl to rwx both user and group. |
@Panderine I'm only mounting this volume: |
I think #328 is the real root cause of the problem. |
following an upgrade from v4.4 to v5.latest, when i first stumbled over this, permissions were ALL OVER the place:
I run pihole with mounted volume to local bind like this:
inspection of the docker container reveals:
so:
however, EVEN THOUGH, after so you can do either:
OR
|
it also looks like after gravity is updated, the permissions get borked again :(
and the GROUP MOD workaround I proposed above DOES NOT WORK - annoying ... |
sigh, some recent updates (last month-ish) - since then the workaround is no longer working |
I struggled with this for a while today, on a setup with kubernetes on an NFS persistentvolume. The only thing that finally changed things to make it work was to |
@ShadowZero3000 your fix does not work on |
to slightly compete with my own comment 20 days ago .. recently I ran another cycle of docker update out of frustration (unable to change settings in the web UI due to permissions), and my "workaround" in my update script worked; sharing: fermulator@docker:/srv/pihole$ cat upgrade.sh
docker pull pihole/pihole:latest
docker rm -f pihole
docker-compose up -d pihole
# https://github.com/pi-hole/docker-pi-hole/issues/610
echo "WORKAROUND: chown for pihole /etc, requires sudo"
sudo chown -R 33:999 ./etc ^ this is run from relative path (same dir as |
I noticed yesterday that I could not add DNS entries again. Went through a few recreates with the container trying to get it to work.
From that system:
I changed the permissions as @fermulator did, but used names instead of numerical:
I was then able to delete the adlist I no longer wanted. For fun, I ran piholg -g within the container, and then checked the permissions from the docker host again:
And subsequently it would not let me delete the adlist again. Changing the permissions back in the docker host corrected this. |
going from v4 to v5 - ran into this myself. Only way after hours of fiddling, was to just use a docker volume. For any others that are curious...
In my case, on a QNAP - you can adjust as needed. This finally let me in. |
I have a similar problem, but the strange thing is that the gravity.db file is owned by the openmediavault-webgui user with UID and GID 999 and the pihole user doesn't exist at all. I'm using a docker-compose installation on OpenMediaVault 5 with Traefik proxy.
|
The permissions you show are on the host. Files are really done using the numeric UID/GID, the human readable username is just human readable. If you check If you want to affect the UID/GID in the container then you'll need to use the environment variables to do that.
|
Thanks for the explanation. Unfortunately, it doesn't change the fact that I can't add any whitelist or blacklist entries or update Gravity. |
The hint by @TWhidden was fine for me on a RPi4: @Trottel: Did you try?
|
any news? I got the same issue on fresh install RPI4 , I change from latest to v5.8.1 but same error. |
going back to v5.7 , works |
For me version 5.7 doesn't work either :( |
@C4mp3r-Grey: I'm using this docker-compose file:
|
I finally figured it out! It was my mistake. I need to use the following docker-compose file:
One question. It is possible to manually create volume in a specific location, e.g. "/srv/disk-Data/Configs/marapavelka/docker/pihole/pihole"? |
@Trottel thanks!
|
this are some debug log that are strange, not sure if are normal and can be ignore?
|
Same issue. Using this workaround in my container startup script: I'm updating from v4.1.1 using a fresh install to new server folders. No permission issues on previous version. And no idea what root cause is since I can run pihole without any mounted volumes and everything works fine but when I mount volumes it has the permission issues. Even though /etc/pihole/* looks identical from an ownership/group/permission perspective with or without mounted volumes. |
I also have the same issue. If I build the container without the volume bind mount it works fine other than persistence. The moment I bind /etc/pihole the web UI complains about permissions. I note that @danteali runs this command in the container start up script. I don’t have the knowledge or experience to understand how to do that so I run it manually. I would love it if someone could help me understand how to automate that work around. Obviously understanding the problem and fixing it is a better option for me but I’ll settle for the work around |
@PromoFaux Can we add that |
@ppastur It's not complex, I just have a simple 2 line script which runs the @dschaper While this would help some of us I'm not convinced it's a great idea globally. I don't know what other implications it might have. It's not like I'm making a lot of changes to pihole once it's set up so the problem doesn't really bother me on a day-to-day basis. And I can work around it with |
Closing to continue the discussion in #860 (which is now pinned while we attempt to look into it) |
This is a...
Description
Pi-hole builds and runs successfully. I am unable to add any whitelist or blacklist entries via the web admin page. I get this error: Error, something went wrong!
While executing: attempt to write a readonly database
Added 0 out of 1 domains
Expected Behavior
Whitelist or blacklist entry should be added to the database.
Actual Behavior
Possible Fix
Steps to Reproduce and debugging done
e.g. your docker run command, pages to visit, CLI commands you ran
Debug steps I have tried
I know permissions are the issue. Permissions on the files are the same:
-rw-rw-r--+ 1 999 spi 4947968 May 10 03:31 gravity.db
-rw-r--r-- 1 999 spi 0 May 9 23:45 pihole-FTL.conf
All others are root:root
I'm using the persisted volumes as listed in the docs:
volumes:
- './etc-pihole/:/etc/pihole/'
Cannot determine what to add to docker-compose or what user/group changes are needed to enable this to work correctly. Stock raspberry buster install with docker-ce edition. No other users/groups have been added.
docker run
example in the readme (removing any customizations I added)Context and extra information
Your Environment
raspeberry pi
Linux raspberrypi 4.19.97-v7+ Can not add domains to white or black list latest as of 2023-01-21 10:00 MST #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux
Docker version 19.03.8, build afacb8b
The text was updated successfully, but these errors were encountered: