Cant start docker with /etc/dnsmasq.d mapped but will start with just /etc/pihole mapped

Have a weird issue the pihole in a docker. No mapping’s of volumes and pihole loads fine, map etc/pihole and it works fine. Map /etc/dnsmasq.d and it fails to load with

Unable to copy data from /etc/pihole/gravity.db to /etc/pihole/gravity.db_temp, Unable to create gravity database. Please try again later. If the problem persists, please contact support. Stopping pihole-FTL.pihole-ftl: no process found’

1st thought was perms on the static volume but its writing the files so the docker has access. Other dockers use the same path for other containers mapings and they work fine.

TIA

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

https://tricorder.pi-hole.net/KtwcUxke/

You are also having permission problems on PHP. There's a lot of messages like this:

   2023-05-27 17:06:03: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning:  parse_ini_file(/etc/pihole/pihole-FTL.conf): failed to open stream: Permission denied in /var/www/html/admin/scripts/pi-hole/php/database.php on line 19

How did you star your container? Please post your docker run command or compose file.

Didn’t use as it was conflicting with dns already running outside the container and instead of fighting with docker run to set bridged mode and have it listen on a static ip that wasn’t local host. I created with the Ui for my container specifying bridged mode as well as mappings etc.

With no mappings container starts and runs here is a token for the same container with no mappings at all. https://tricorder.pi-hole.net/bCWvVFdw/

This is running on a QNAP nas and i currently have pi hole running in a Lhc container and has been for years. With the depreciation of lhc containers coming soon, i figured its time to get running in a docker of its own. Also running a test on the working container, it is working as it should setting my phone to its static up, it blocks as intended.

Thanks for your help

Comparing both debug logs, I noticed a small difference in permissions (the + sign):

# Container using volumes 
*** [ DIAGNOSING ]: Gravity Database
-rw-rw----+ 1 pihole pihole 12M May 27 02:59 /etc/pihole/gravity.db

# Container WITHOUT volumes 
*** [ DIAGNOSING ]: Gravity Database
-rw-rw-r-- 1 pihole pihole 12M May 27 17:43 /etc/pihole/gravity.db

This is the same for other files/directories.
Apparently your system is giving extended permissions (ACL) to this directories, causing problems inside the container.


Now that you mentioned QNAP, I remember a few issues involving permissions on QNAP (not exclusively to Pi-hole containers).

I don't have a QNAP to test and never had to deal with these issues before, so my suggestions are limited.

Maybe it's a good idea to search for "QNAP docker permissions".

Well you sent me in the right direction. Did a quick search and found a thread about a perms issue with pihole even though the perms should have worked. By running the below, the container with the folder mappings fired right up. Crazy that too many perms cause the issue.

#Clear ACL list
setfacl -Rb /share/CACHEDEV1_DATA/appdata/pihole change to your mapping dir

#Set Permissions
chmod -R 777 /share/CACHEDEV1_DATA/appdata/pihole change to your mapping dir

Thanks for taking the time to look and giving me some place to start. I was beating my head as all other dockers work fine.