-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
Imposible to add more domains to whitelist or blocklist. #39
Comments
Yes, i think i know what happens. Adlist, whitelist, etc. are stored in a configmap inside the cluster. If you define them in values.yaml those are mounted to the container. configmap mounts by default are read only in kubernetes. |
Hi BTW, I'm not sure it's what you're saying, I've made a test with my classic version of pihole, using a custom config map for those values and it's working fine Regards |
Ok sounds good... but for the second part, i would be very interested in your configuration because i have no idea how this should work. But maybe there is something new to learn :) Regards |
Sure, what do you need? Config map or helm values? |
The configmap definition and how the configmap is mounted into the pod would be great. |
Config map:
Deployment
Hope it’s helps |
I have a similar problem with Pihole v5.0. When I add a domain to the blocklist, I get the message "While executing: attempt to write a readonly database". How can I solve it? |
I believe this is due the change from separate files to a gravity database in pihole 5. We need to change the deployment to a stateful set to enable a writable database. I reopened issue #19 . I how I will find some time to implement this change. |
@Gory19 I tried it today on my cluster. But it was working for me. Do you have persistence enabled? |
@MoJo2600 I've same issue, and I have persistence enabled. |
Hm... then i don't get it. If I go to
This Is everything that is configured by helm. |
The issue, on my case, comes when you try to add a new domain into a whitelist, my mounts: |
Which version of the chart are you running? Are you on pihole 5? |
Yes, I have persistence enabled. |
@MoJo2600 Chart: pihole-1.7.6 |
I had a look at it today and I'm not sure what is going on. Since pihole 5 introduced the gravity database, everything you define in the files will be imported to the database during start. If you have persistence enabled, the database is stored in the persisted volume. You should be able to change everything and it should stay there, even if you restart the container. |
Here's to you: |
I'm having the same issue. I'm getting the error:
This happens when trying to add a domain to the whitelist or blacklist via the UI. |
I had a look at the configuration, but can't see a difference. I think is has to do with the PVC/PV but right now I'm just guessing. The access mode of your pvc is set to RWO? Are you able to create a file inside the container in the folder |
Hi, I’ve created a file at /etc/pihole without any problem. The permissions are root:root. I’m checking the contents, and all the files are root:root exert gravity.db which is pihole:pihole... perhaps this is the key of everything |
Hm... checked my cluster and it is as follows:
But to be sure. You use the GUI to add a domain to black/whitelist and the GUI shows you an error? Not like it is on my cluster: Adding Domain? |
Same here @MoJo2600 and yes, I’m using the GUI. I’ve changed the permissions but same results. |
There is a issue open at pihole. There seem to be two solutions on the pihole side right now. One is, that the webserver has the wrong rights, but I don't see how this could be the issue here, because our configuration should be the same. I will try and do a complete fresh deployment of pihole and see if the error is there when i do this. Maybe if someone of you would like to try if the problem goes away after a reboot? You could kill the pod and see if it is still the same after restart. At least we would know that this is a pihole issue and not an issue with the chart. |
I’ve already done, no success. Mine is an upgrade from v4, I’ll try to make a fresh installation... |
I’ve also tried pihole -r, also without success. |
I tried it right now with this minimal values.yaml on the current
The only differences I see are, that you are using cloudflare, but i don't see how this would cause an issue and that you are using nfs and I use glusterfs. And mine is a fresh install not an upgrade. But right now I'm out if ideas what the issue could be. |
I even tried an upgrade from 4.4 to 5.0. Works without issues (at least for me :/). I added to the blacklist and whitelist on 4.4, upgraded to 5 and the old entries were there and i was able to add new domains. |
Can you make a test?
Add some domains in the value file and try again, I think the problem could be there.
Regards.
… On 9 Jun 2020, at 17:07, Christian Erhardt ***@***.***> wrote:
I even tried an upgrade from 4.4 to 5.0. Works without issues. I added to the blacklist and whitelist on 4.4, upgraded to 5 and the old entries were there and i was able to add new domains.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#39 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAIFKG4ZECOO6P6O35NUJVLRVZF4VANCNFSM4L5R7Q4Q>.
|
I tried it, but it is still working. I created a values file with whitelist and blacklist entries. Then i deployed version 1.7.4 with PiHole 4.4. I am not able to add something to blacklist and whitelist. But I expected this, because the mounted configmap for the whitelist/blacklist file is read-only. Prior to 5.0 you have to update the configmap and restart the container. The new
My commands for testing:
|
One sec, you mean you did it OUTSIDE, meaning you changed it in the host mounted directory for the PV? |
Exactly... |
Then I did read it right in another post. They were doing something similar. Could maybe someone check the acls of the file on the host machine? Maybe this will show something? |
i tried using the acl solution in the post, didn’t help much. |
I'm going to make a new test: empty pv with new files then change the owners and lets see. I'll be back. :) |
My test: So my conclusions, the folder which mount the PV and gravity.db needs to be owned www-data:www-data. Happy blocking! |
OMG IT’S WORKS ! I love you :D |
It was personal :D |
Yes, I can confirm the above method works, I am using nfs-provisioner with k3s, had to change the ownership for gravity.db and the data folder to be owned |
Okay, but are there any ideas how we could fix this already during setup? Should we create a pull request on the docker repository? Or is there anything to prevent this somehow? |
For me has no sense. I mean, why with a pv is necessary change the permissions, because with the internal storage is not needed. And why, if www-data belongs to pihole group, you can’t write into the db. I don’t understand it
Obtener Outlook para iOS<https://aka.ms/o0ukef>
…________________________________
De: Christian Erhardt <[email protected]>
Enviado: Thursday, June 18, 2020 8:45:51 AM
Para: MoJo2600/pihole-kubernetes <[email protected]>
Cc: i5Js <[email protected]>; Mention <[email protected]>
Asunto: Re: [MoJo2600/pihole-kubernetes] Imposible to add more domains to whitelist or blocklist. (#39)
Okay, but are there any ideas how we could fix this already during setup? Should we create a pull request on the docker repository?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#39 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAIFKG26QGWWUTE2YIJRGC3RXGZZ7ANCNFSM4L5R7Q4Q>.
|
When running the helm install command and watching the log I can see this. Is there a way to fix it? chown: changing ownership of '/etc/pihole/pihole-FTL.conf': Operation not permitted Why is it not permitted. I am using a persistent volume on a nfs share for storage. Issue solved. I was using an Open Media Vault for my persistent volumes on a NFS share. I changed the settings of the share to (rw,no_root_squash,insecure,async,no_subtree_check,anonuid=1000,anongid=1000) and now it works. Fixed GUI issue by navigating to persistant volume data and running verified with all files show user and group ass www-data |
Manually changing the ownership on I'm also running a PersistentVolumeClaim on NFS. Edit[0]: I just tried setting the primary group for user pihole to www-data but that doesn't work: $ usermod -g www-data -G pihole pihole
$ groups pihole
pihole : www-data pihole Edit[1]: Setting the permissions to The weird thing for me is that user $ groups www-data
www-data : www-data pihole ... but still doesn't have write-permissions on gravity.db: $ sudo -u www-data touch /etc/pihole/gravity.db
touch: cannot touch '/etc/pihole/gravity.db': Permission denied |
Fixed!The problem is in the NFS server configuration! TL;DR:Remove ResearchSo I found out that if user www-data had pihole as the primary group, I was able to write the gravity.db. As soon as I made www-data primary again and pihole the secondary group again, the permission was denied. However, if I did the same on the NFS server (by adding group 999 as a secondary group to user www-data), all was fine! So now I knew it had to do something with the NFS communication. After some DuckDuckGo-ing I found this quote:
This means that when FixSo to fix our permissions problem here, I have edited my Now it works with a fresh install with persistentVolumeClaim:
enabled: true
storageClass: nfs-client
accessModes:
- ReadWriteOnce And the default file permissions: root@pihole-xxxxxxxxxx-xxxxx:/# ls -lahF /etc/pihole/
total 91M
drwxrwxr-x 3 pihole pihole 4.0K Sep 30 05:50 ./
drwxr-xr-x 1 root root 4.0K Sep 30 05:46 ../
[...]
-rw-rw-r-- 1 pihole pihole 67M Sep 30 05:47 gravity.db
[...] Hope this helps! Note: The config file also recommends to read http://wiki.debian.org/SecuringNFS, so that's a good next step. :-) PS: Thanks to @i5Js, your research helped a lot to pinpoint the exact problem! |
@brnl You are my hero! I spent hours to try to find a solution. Can anybody of the others try the solution and report back please? |
Awesome @brnl works flawless now... I modified the nfs-kernel-server file and perform a gravity update using the web-ui and the owner and permissions remains and of course it is still working. Many thanks for your knowledge here, really help me to understand which was the issue. |
Thanks @brnl for your solution, I modified the config and did a fresh reinstall of pi-hole with nfs storage client, it works now 👍 |
Glad I could help, guys! 👍 |
Does anyone have an idea how to do this for an Open Media Vault NFS share? |
Edit[0]: Nope never mind. But this might answer your question: https://forum.openmediavault.org/index.php?thread/17674-rpcmountdopts-configure-port/ To override the default ("--manage-gids") you set an empty environment variable: |
I'm using a simple manual storage, my setup doesn't have anything to do with When I reinstall the new setup with a helm installation, I loose all my I've hopped on to the container and have changed ownership of all the folders.
I keep seeing this error at boot in the logs.
Here's my setup guide I've used: Here's my values.yml
Really appreciate if I could persist my changes through updates in the future. thank you. |
I didn't
This didn't work for me but even if it did I was not comfortable doing this. I got it working by adding env variable
The key was WEB_UID and WEB_GID needed to match filesystem's id and gid. Hope this helps someone |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Hello,
I'm unable to add more domains to adlist or whitelist files using the pihole web interface. I've filled before with some domains to the values template, and I'm always get the message: "read-only filesystem". It's strange because If I let without any domain the values template, it works fine, I can add or remove domains.
Regards
The text was updated successfully, but these errors were encountered: