Pi-Hole dns resolver stops working on weekends

Expected Behaviour:

My research tells me Pi-Hole runs an update check at midnight after which all should work well. All used to work well but until about 2 months ago (estimate).

OS=Ubuntu 18.04.3
Hardware= Dell Optiplex 390

 Pi-hole version is v5.1.2 (Latest: v5.1.2)
  AdminLTE version is v5.1.1 (Latest: v5.1.1)
  FTL version is v5.2 (Latest: v5.2)

Actual Behaviour:

Every Sunday between 12am -1am PST, my Pi-Hole DNS resolver stops working. I have to manually restart it in the morning to make it work.

I stayed up late yesterday to see it in action. My syslog showed "updatechecker" being run after which the problem began. Below is what I see if the FTL log

[2020-11-15 03:46:48.072 713/T716] Listening on Unix socket
[2020-11-15 03:46:48.072 713M] SQLite3 message: database corruption at line 67286 of [3bfa9cc97d] (11)
[2020-11-15 03:46:48.072 713M] SQLite3 message: database disk image is malformed in "DELETE FROM message;" (11)
[2020-11-15 03:46:48.073 713M] ERROR: SQL query "DELETE FROM message;" failed: database disk image is malformed
[2020-11-15 03:46:48.073 713M] ERROR: flush_message_table() failed!
[2020-11-15 03:46:48.074 713M] INFO: No regex whitelist entries found
[2020-11-15 03:46:48.074 713M] Compiled 0 whitelist and 3 blacklist regex filters for 0 clients in 0.9 msec
[2020-11-15 03:47:02.183 713M] New upstream server: 1.0.0.1 (0/128)

Troubleshooting done so far

I executed "pihole reconfigure" with the repair option and that doesn't seem to fix it. It appears "pihole -g" is able to reproduce the problem.

I see a few people encounter this issue as well and the solution isn't very clear. First post here so apologies if this has been answered already. I couldn't find a solution. I don't know the inner details of how Pihole works but I can provide more data if the debug log uploaded isn't enough.

Debug Token:

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

That's your problem:

SQL query "DELETE FROM message;" failed: database disk image is malformed

See here on how to proceed

1 Like

@yubiuser, Thanks for the response. I went ahead and backed up the malformed db to exam it later. I deleted the DB after that as suggested. A new one has been created after restarting the dns.

I can confirm it is still malformed after running that command and SQL Lite Browser is also unable to open it. Same "database disk image is malformed" error.

The problem started a while back and if there was any power failure the current syslog won't catch it.

I will wait for the weekly occurrence and see if this fixed it. Thank you.

@yubiuser, thanks for the help. The solution you provided above fixed my issue.

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