Data not persisted across usages

Hello,
I'm new to Pihole and seem to have some issues with it.

The DNS part itself seems to work fine (I can see requests incoming). However whenever I try to restart the container (docker-compose down && docker-compose up) all the statistics are gone. Stuff we can see on the main page are reset to 0, settings are correctly persisted.

I don't know if this is linked but going into "Long term data > Query log" shows an error whenever I try to set a time range.

Thanks for anyone helping !

Note: I'm running this container in a Synology NAS so I don't know which of Help/Docker or Help/Docker is the most appropriate category.


/var/log/lighttpd/error-pihole.log

2023-01-11 18:46:09: server.c.1513) server started (lighttpd/1.4.59)
2023-01-11 18:48:23: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning:  SQLite3::prepare(): Unable to prepare statement: 1, no such table: query_storage in /var/www/html/admin/api_db.php on line 94
2023-01-11 18:48:23: mod_fastcgi.c.487) FastCGI-stderr:PHP Fatal error:  Uncaught Error: Call to a member function bindValue() on bool in /var/www/html/admin/api_db.php:95
2023-01-11 18:48:23: mod_fastcgi.c.487) FastCGI-stderr:Stack trace:
2023-01-11 18:48:23: mod_fastcgi.c.487) FastCGI-stderr:#0 {main}
2023-01-11 18:48:23: mod_fastcgi.c.487) FastCGI-stderr:  thrown in /var/www/html/admin/api_db.php on line 95

docker-compose.yml

version: '3'
services:
  pihole:
    image: pihole/pihole:latest
    container_name: pihole
    env_file:
      - container.env
    network_mode: host
    volumes:
      - '/xxx/PiHole/etc-pihole:/etc/pihole'
      - '/xxx/PiHole/etc-dnsmasq:/etc/dnsmasq.d'
    cap_add:
      - NET_ADMIN
    restart: unless-stopped

container.env

TZ=Europe/Paris
INTERFACE=ovs_eth0
FTLCONF_LOCAL_IPV4=192.168.0.240
DNSMASQ_USER=root
DNSMASQ_LISTENING=local
WEB_PORT=8220
WEBPASSWORD=xxx

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

As a test, what is the output of (remember to login first):

For some reasons it is working now. I tried a lot of things so I'm not sure what specifically worked. But I think that it is the change of the volumes by adding the rw modifier :

      - '/xxx/PiHole/etc-pihole:/etc/pihole:rw'
      - '/xxx/PiHole/etc-dnsmasq:/etc/dnsmasq.d:rw'

The output of the url is now {"data":[]}. I guess that it's normal to have an empty response as it works in the UI now.

I had two suspicions:

  • low memory for PHP or
  • permissions for the volumes

The previous post was trying to test the PHP memory problem.

Yes. That's normal, since your volume was not allowing the data to be written.

1 Like