Disable pihole breaks DNS, Pi-hole v5.1.2 and FTL v5.2

Expected Behaviour:

I'm running Pi-hole on a Pi 1 and it is acting as my DHCP server. It has worked great for a long time on v4 and I recently updated to v5. After upgrading, I'm no longer able to use the temporary disable feature from the web interface.

I expect clicking disable to stop blocking any domains for the duration of the disable period and then resume blocking once the disable period is over.

Pi-hole v5.1.2
Web interface v5.1.1
FTL v5.2

Actual Behaviour:

All DNS resolution ends and no websites are accessible. The Pi-hole is no longer accessible via pi.hole/admin and only via direct IP address. DNS resolution does not come back after the disable period ends. I have to reboot the Pi-hole in order to regain DNS resolution.

I've found this reported before on Reddit: 1, 2, 3, 4, 5
And here: 1, 2

That last link suggests that the behavior was fixed in FTL v5.2. However, I am still experiencing the issue.

Debug Token:

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

Two other related issues that I've observed today.

  1. If a device disconnects from the network after this has occurred, it is not assigned an address when it attempts to reconnect.
  2. I just tried adding a domain to the whitelist via the web interface and this also seemed to crash DNS/DHCP. I had to restart the Pi-hole to get it working again.

From your debug log, it would seem your database has been corrupted:

*** [ DIAGNOSING ]: contents of /var/log
-rw-r--r-- 1 pihole pihole 5638 Sep 12 08:22 /var/log/pihole-FTL.log
   -----tail of pihole-FTL.log------
   [2020-09-12 07:44:15.230 526M] SQLite3 message: database corruption at line 67286 of [3bfa9cc97d] (11)
   [2020-09-12 07:44:15.230 526M] SQLite3 message: database disk image is malformed in "SELECT VALUE FROM ftl WHERE id = 0;" (11)
   [2020-09-12 07:44:15.231 526M] Encountered prepare error in db_query_int("SELECT VALUE FROM ftl WHERE id = 0;"): database disk image is malformed
   [2020-09-12 07:44:15.231 526M] Database not available, please ensure the database is unlocked when starting pihole-FTL !

You could confirm this by running a quick integrity check for your db on your Pi-hole machine like this:

sudo sqlite3 pihole-FTL.db "PRAGMA integrity_check"

The safest measure to alleviate this would be to move or delete that defective database, e.g. by executing:

mv pihole-FTL.db pihole-FTL.malformed.db

The older query history may still be recoverable in parts from the malformed database.
However, if you can do without that history, I would recommend to delete the malformed db altogether.
Above command is just moving it out of the way for the moment, allowing you to keep it until you've made your mind up.

A fresh (but empty) pihole-FTL.db will be created once you restart pihole-FTL, eg. by:

pihole restartdns

And finally, while db corruption was possibly the cause of your observation, there's still to ponder what caused that corruption in the first place.
File corruption could hint at your sd card nearing its EOL, or possibly at a power supply issue, or maybe you had any powercuts lately?

You could check your logs for recent under-voltage events by running:

grep -ni "voltage" /var/log/syslog*

Sorry it has taken me a while to return to this. I've had trouble finding time to work on it.

I ran the two checks mentioned above and found not integrity issues and no voltage events. I'll try to troubleshoot some more and report back again if I find anything.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.