So I was also struggling with this error. Pi-hole on Linux Raspberry Pi "Buster" with Apache.
After a lot of searching, I found this: You need to add www-data to the group pihole.
I made this post for some reasons:
- maybe it helps others
- I wonder why the installation of pihole did not do this.
- I wonder if the error-handling could be improved so that people know what could be the case
So in my case, after changing the groupfile and the shadow-groupfile, it looked like this
more /etc/group | grep hole
pihole:x:995:www-data
more /etc/gshadow | grep hole
pihole:!::www-data