pi-hole / docker-pi-hole

Pi-hole in a docker container
https://pi-hole.net
Other
8.57k stars 1.13k forks source link

Error, something went wrong! While executing INSERT OT IGNORE: attempt to write a readonly database Added 0 out of 1 domains #915

Closed unurgunite closed 2 years ago

unurgunite commented 3 years ago

Versions

Platform

Expected behaviour I went to http://my_ip/admin/groups-domains.php?type=black and tried to add a domain to blacklist. Since then this domain is not accessible from my network

Actual behaviour I went to http://my_ip/admin/groups-domains.php?type=black and tried to add a domain to the blacklist, but instead get an error inside the red block:

Error, something went wrong!
While executing INSERT OT IGNORE: attempt to write a readonly database
Added 0 out of 1 domains

P.S: I have the same issue with whitelist. On top of that, pihole -w example.com and pihole -b example.com works without any errors

asyba commented 3 years ago

same issue with new fresh install on Rpi4

lightswitch05 commented 2 years ago

I believe this is a duplicate of #860

freebrowser1 commented 1 year ago

Run as root:

usermod -aG www-data pihole
usermod -aG pihole www-data
chown pihole:www-data /etc/pihole/*
chown pihole:www-data /etc/pihole/.

and restart Apache (or reboot) solved the problem for me. It is allowing the pihole and Apache user each into each others groups. And setting ownership of the /etc/pihole folder and files to pihole user and groupship Apache user.