Please follow the below template, it will help us to help you!
Expected Behaviour:
The Pi-Hole should continuously operate without any issues
Actual Behaviour:
For some time now, particularly in the morning, the Pi-Hole will stop assingning/renewing DHCP leases and/or stops resolving DNSs.
The graph on the Pi-Hole dashboard even shows a flat line (see screenshot) and this has been happening since I last updated. It's happening almost daily now and the only solution for me, so far, has been to reboot the Pi (which is a Pi B+)
Just edited it. Actualy, added a few more to have some comparison. I marked all the places where it stopped responding, though it was still "working".
There are always connected devices in the house, there should always be even a couple entries during those times and there are absolutely 0.
Did the Pi-hole stop responding in those periods (which doesn't seem to be the case, since there are small activity bumps showing), or did the clients move to another DNS server? This command (which will generate a query history in ugly text form at 10 minute intervals) will show the history in some detail. The times are in epoch time, which will need to be converted to real time to make sense.
Completely stopped at 7:35am only came back when I rebooted around 9am.
I didn't figure out to get the same kind of output for previous dates as the oldest I got with that command was Apr 15 22:05:00 BST 2020 but I'd be glad to dig deeper on the other dates like Apr 8th or between 10th and 11th.
Apr 16 07:23:50 dnsmasq[488]: reply lh3.googleusercontent.com is <CNAME>
Apr 16 07:23:50 dnsmasq[488]: reply googlehosted.l.googleusercontent.com is 172.217.168.161
Apr 16 07:23:53 dnsmasq[488]: query[AAAA] ssl.google-analytics.com from 192.168.1.22
Apr 16 07:23:53 dnsmasq[488]: /etc/pihole/gravity.list ssl.google-analytics.com is 0.0.0.0
Apr 16 07:23:53 dnsmasq[488]: query[A] ssl.google-analytics.com from 192.168.1.22
Apr 16 07:23:53 dnsmasq[488]: /etc/pihole/gravity.list ssl.google-analytics.com is 0.0.0.0
Apr 16 07:23:53 dnsmasq[488]: query[A] 2.debian.pool.ntp.org from 127.0.0.1
Apr 16 07:23:53 dnsmasq[488]: forwarded 2.debian.pool.ntp.org to 1.1.1.1
Apr 16 07:23:53 dnsmasq[488]: query[AAAA] 2.debian.pool.ntp.org from 127.0.0.1
Apr 16 07:23:53 dnsmasq[488]: forwarded 2.debian.pool.ntp.org to 1.1.1.1
Apr 16 07:23:53 dnsmasq[488]: reply 2.debian.pool.ntp.org is 194.117.47.44
Apr 16 07:23:53 dnsmasq[488]: reply 2.debian.pool.ntp.org is 193.136.152.72
Apr 16 07:23:53 dnsmasq[488]: reply 2.debian.pool.ntp.org is 2001:690:2100:14::2
Apr 16 07:23:53 dnsmasq[488]: reply 2.debian.pool.ntp.org is 2001:690:2100:80::4
Apr 16 07:23:53 dnsmasq[488]: reply 2.debian.pool.ntp.org is 2001:470:1f1d:947::1
Apr 16 07:23:53 dnsmasq[488]: reply 2.debian.pool.ntp.org is 2001:690:2100:14::1
Apr 16 09:04:17 dnsmasq[488]: query[A] api.github.com from 127.0.0.1
Apr 16 09:04:17 dnsmasq[488]: forwarded api.github.com to 1.0.0.1
/var/log/pihole-FTL.log:
[2020-04-16 07:23:44.313 486] Imported 16249 queries from the long-term database
[2020-04-16 07:23:44.315 486] -> Total DNS queries: 16249
[2020-04-16 07:23:44.316 486] -> Cached DNS queries: 4318
[2020-04-16 07:23:44.316 486] -> Forwarded DNS queries: 9221
[2020-04-16 07:23:44.316 486] -> Exactly blocked DNS queries: 2710
[2020-04-16 07:23:44.317 486] -> Unknown DNS queries: 0
[2020-04-16 07:23:44.317 486] -> Unique domains: 1188
[2020-04-16 07:23:44.317 486] -> Unique clients: 9
[2020-04-16 07:23:44.318 486] -> Known forward destinations: 2
[2020-04-16 07:23:44.318 486] Successfully accessed setupVars.conf
[2020-04-16 07:23:44.387 488] PID of FTL process: 488
[2020-04-16 07:23:44.388 488] Listening on port 4711 for incoming IPv4 telnet connections
[2020-04-16 07:23:44.390 488] Listening on port 4711 for incoming IPv6 telnet connections
[2020-04-16 07:23:44.391 488] Listening on Unix socket
[2020-04-16 07:23:44.418 488] Received SIGHUP, reloading cache
[2020-04-16 07:23:44.418 488] Blocking status is enabled
[2020-04-16 07:23:44.433 488] Compiled 0 Regex filters and 4 whitelisted domains in 13.5 msec (0 errors)
[2020-04-16 07:23:44.437 488] /etc/pihole/black.list: parsed 0 domains (took 0.4 ms)
[2020-04-16 07:23:46.804 488] /etc/pihole/gravity.list: parsed 99791 domains (took 2363.8 ms)
[2020-04-16 12:08:04.050 488] Resizing "/FTL-strings" from 28672 to 32768
[2020-04-16 14:14:18.619 488] Resizing "/FTL-strings" from 32768 to 36864
[2020-04-16 19:52:23.190 488] Resizing "/FTL-strings" from 36864 to 40960
[2020-04-16 20:08:00.060 488] dbquery(COMMIT) - SQL error (5): database is locked
That last line there got me a bit worried.
/var/log/syslog:
Apr 16 07:23:43 raspberrypi systemd[472]: Reached target Basic System.
Apr 16 07:23:43 raspberrypi systemd[1]: Started User Manager for UID 999.
Apr 16 07:23:43 raspberrypi systemd[472]: Reached target Default.
Apr 16 07:23:43 raspberrypi systemd[472]: Startup finished in 867ms.
Apr 16 07:23:43 raspberrypi systemd[1]: Started Session c1 of user pihole.
Apr 16 07:23:44 raspberrypi pihole-FTL[257]: FTL started!
Apr 16 07:23:44 raspberrypi systemd[1]: Started LSB: pihole-FTL daemon.
Apr 16 07:23:49 raspberrypi dhcpcd[456]: eth0: DHCPv6 REPLY: No Addresses Available
Apr 16 07:23:50 raspberrypi systemd[1]: systemd-fsckd.service: Succeeded.
Apr 16 09:04:12 raspberrypi systemd-timesyncd[224]: Synchronized to time server for the first time [2001:690:2100:14::2]:123 (2.debian.pool.ntp.org).
Apr 16 09:04:12 raspberrypi systemd[1]: Starting Daily apt download activities...
Apr 16 09:04:12 raspberrypi systemd[1]: Starting Clean php session files...
Apr 16 09:04:15 raspberrypi systemd[1]: phpsessionclean.service: Succeeded.
Apr 16 09:04:15 raspberrypi systemd[1]: Started Clean php session files.
At first sight, I'd say that the FTL update process is proving to be problematic somehow. I'm also attaching the pihole and pihole-FTL logs, just in case.
There are no automatic FTL updates, nor automatic FTL restarts. Is is possible that the Pi-hole host is losing power (even momentarily) that would cause a device restart?
The permissions for the database file are correct.
It seems unlikely.. I never had issues with that before but it's certainly a possibility I can try to pay attention to.
Whatever it is, it's weird. Even syslog stops until the unit is completely restarted
That seems to indicate a system level problem on that device. I would keep an eye on it, and if it happens again look specifically for any events that may be related.
It's an old Pi B+.. I already have a Pi 4 4GB waiting to replace that one but I'm still waiting on the case for it, though it might get downgraded to 2GB of RAM in the mid-term. I also want to integrate speedtest-cli with PiHole and I need the Gigabit port to verify internet speed (should be 200Mbps but the Pi B+ Ethernet port can't handle that and only reads about 64Mbps)