piHole stopped working suddenly (not resolving DNS Querys) until I ran restartdns manually in CLI

Please follow the below template, it will help us to help you!

Expected Behaviour:

Running normally

Actual Behaviour:

If I visit a webpage I got a ERR_NAME_RESOL so the DNS resolv does not work.
If I do restartdns on the CLI the pihole start to work.

Debug Token:

[✓] Your debug token is: https://tricorder.pi-hole.net/495bu4tj0d

anyone?

Is there anything in any log file (check /var/log/pihole-FTL.log first)? Sorry, I cannot read debug token.

pi@raspberrypi:~ $ sudo cat /var/log/pihole-FTL.log

[2020-11-26 12:33:49.743 15583M] Using log file /var/log/pihole-FTL.log
[2020-11-26 12:33:49.743 15583M] ########## FTL started! ##########
[2020-11-26 12:33:49.743 15583M] FTL branch: master
[2020-11-26 12:33:49.743 15583M] FTL version: v5.2
[2020-11-26 12:33:49.743 15583M] FTL commit: dbd4a69
[2020-11-26 12:33:49.743 15583M] FTL date: 2020-08-09 22:09:43 +0100
[2020-11-26 12:33:49.743 15583M] FTL user: pihole
[2020-11-26 12:33:49.743 15583M] Compiled for armhf (compiled on CI) using arm-linux-gnueabihf-gcc (Debian 6.3.0-18) 6.3.0 20170516
[2020-11-26 12:33:49.744 15583M] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2020-11-26 12:33:49.744 15583M]    SOCKET_LISTENING: only local
[2020-11-26 12:33:49.744 15583M]    AAAA_QUERY_ANALYSIS: Show AAAA queries
[2020-11-26 12:33:49.744 15583M]    MAXDBDAYS: max age for stored queries is 365 days
[2020-11-26 12:33:49.744 15583M]    RESOLVE_IPV6: Resolve IPv6 addresses
[2020-11-26 12:33:49.744 15583M]    RESOLVE_IPV4: Resolve IPv4 addresses
[2020-11-26 12:33:49.744 15583M]    DBINTERVAL: saving to DB file every minute
[2020-11-26 12:33:49.744 15583M]    DBFILE: Using /etc/pihole/pihole-FTL.db
[2020-11-26 12:33:49.744 15583M]    MAXLOGAGE: Importing up to 24.0 hours of log data
[2020-11-26 12:33:49.744 15583M]    PRIVACYLEVEL: Set to 0
[2020-11-26 12:33:49.744 15583M]    IGNORE_LOCALHOST: Show queries from localhost
[2020-11-26 12:33:49.744 15583M]    BLOCKINGMODE: Null IPs for blocked domains
[2020-11-26 12:33:49.745 15583M]    ANALYZE_ONLY_A_AND_AAAA: Disabled. Analyzing all queries
[2020-11-26 12:33:49.745 15583M]    DBIMPORT: Importing history from database
[2020-11-26 12:33:49.745 15583M]    PIDFILE: Using /run/pihole-FTL.pid
[2020-11-26 12:33:49.745 15583M]    PORTFILE: Using /run/pihole-FTL.port
[2020-11-26 12:33:49.745 15583M]    SOCKETFILE: Using /run/pihole/FTL.sock
[2020-11-26 12:33:49.745 15583M]    SETUPVARSFILE: Using /etc/pihole/setupVars.conf
[2020-11-26 12:33:49.745 15583M]    MACVENDORDB: Using /etc/pihole/macvendor.db
[2020-11-26 12:33:49.745 15583M]    GRAVITYDB: Using /etc/pihole/gravity.db
[2020-11-26 12:33:49.745 15583M]    PARSE_ARP_CACHE: Active
[2020-11-26 12:33:49.745 15583M]    CNAME_DEEP_INSPECT: Active
[2020-11-26 12:33:49.745 15583M]    DELAY_STARTUP: No delay requested.
[2020-11-26 12:33:49.746 15583M]    NICE: Set process niceness to -10 (default)
[2020-11-26 12:33:49.746 15583M]    BLOCK_ESNI: Enabled, blocking _esni.{blocked domain}
[2020-11-26 12:33:49.746 15583M]    NAMES_FROM_NETDB: Enabled, trying to get names from network database
[2020-11-26 12:33:49.746 15583M] Finished config file parsing
[2020-11-26 12:33:49.747 15583M] SQLite3 message: database corruption at line 67286 of [3bfa9cc97d] (11)
[2020-11-26 12:33:49.747 15583M] SQLite3 message: database disk image is malformed in "SELECT VALUE FROM ftl WHERE id = 0;" (11)
[2020-11-26 12:33:49.748 15583M] Encountered prepare error in db_query_int("SELECT VALUE FROM ftl WHERE id = 0;"): database disk image is malformed
[2020-11-26 12:33:49.748 15583M] Database not available, please ensure the database is unlocked when starting pihole-FTL !
[2020-11-26 12:33:49.748 15583M]  -> Total DNS queries: 0
[2020-11-26 12:33:49.748 15583M]  -> Cached DNS queries: 0
[2020-11-26 12:33:49.748 15583M]  -> Forwarded DNS queries: 0
[2020-11-26 12:33:49.748 15583M]  -> Blocked DNS queries: 0
[2020-11-26 12:33:49.748 15583M]  -> Unknown DNS queries: 0
[2020-11-26 12:33:49.748 15583M]  -> Unique domains: 0
[2020-11-26 12:33:49.748 15583M]  -> Unique clients: 0
[2020-11-26 12:33:49.748 15583M]  -> Known forward destinations: 0
[2020-11-26 12:33:49.748 15583M] Successfully accessed setupVars.conf
[2020-11-26 12:33:49.760 15585M] PID of FTL process: 15585
[2020-11-26 12:33:49.762 15585/T15586] Listening on port 4711 for incoming IPv4 telnet connections
[2020-11-26 12:33:49.762 15585/T15588] Listening on Unix socket
[2020-11-26 12:33:49.763 15585/T15587] Listening on port 4711 for incoming IPv6 telnet connections
[2020-11-26 12:33:49.763 15585M] Reloading DNS cache
[2020-11-26 12:33:49.763 15585M] Blocking status is enabled
[2020-11-26 12:33:49.765 15585M] SQLite3 message: database corruption at line 67286 of [3bfa9cc97d] (11)
[2020-11-26 12:33:49.766 15585M] SQLite3 message: database disk image is malformed in "DELETE FROM message;" (11)
[2020-11-26 12:33:49.766 15585M] ERROR: SQL query "DELETE FROM message;" failed: database disk image is malformed
[2020-11-26 12:33:49.766 15585M] ERROR: flush_message_table() failed!
[2020-11-26 12:33:49.780 15585M] INFO: No regex whitelist entries found
[2020-11-26 12:33:49.781 15585M] Compiled 0 whitelist and 16 blacklist regex filters for 0 clients in 9.6 msec
[2020-11-26 12:33:49.998 15585M] New upstream server: 127.0.0.1 (0/1024)
[2020-11-26 12:34:00.296 15585/T15590] SQLite3 message: database corruption at line 67286 of [3bfa9cc97d] (11)
[2020-11-26 12:34:00.296 15585/T15590] SQLite3 message: database disk image is malformed in "SELECT name FROM network WHERE id = (SELECT network_id FROM network_addresses WHERE ip = ?);" (11)
[2020-11-26 12:34:00.296 15585/T15590] getDatabaseHostname("10.0.0.2") - SQL error prepare: database disk image is malformed
[2020-11-26 12:34:10.882 15585M] Resizing "/FTL-strings" from 4096 to 8192
[2020-11-26 12:34:10.893 15629/F15585] Remapping "/FTL-strings" from 4096 to 8192
[2020-11-26 12:37:54.256 15585M] Resizing "/FTL-dns-cache" from 4096 to 8192
[2020-11-26 12:38:05.713 15629/F15585] Remapping "/FTL-dns-cache" from 4096 to 8192
[2020-11-26 12:38:51.264 15585M] Resizing "/FTL-strings" from 8192 to 12288
[2020-11-26 12:51:33.545 15585M] Resizing "/FTL-strings" from 12288 to 16384
[2020-11-26 12:52:00.222 17061/F15585] Remapping "/FTL-strings" from 12288 to 16384
[2020-11-26 12:58:46.056 15585M] Resizing "/FTL-dns-cache" from 8192 to 12288
[2020-11-26 13:05:24.737 15585M] Resizing "/FTL-strings" from 16384 to 20480
[2020-11-26 13:31:53.318 15585M] Resizing "/FTL-strings" from 20480 to 24576
[2020-11-26 13:32:15.367 21027/F15585] Remapping "/FTL-strings" from 20480 to 24576
[2020-11-26 13:32:39.166 15585M] Resizing "/FTL-dns-cache" from 12288 to 16384
[2020-11-26 13:33:17.743 21027/F15585] Remapping "/FTL-dns-cache" from 12288 to 16384
[2020-11-26 13:45:38.582 15585M] Resizing "/FTL-strings" from 24576 to 28672
[2020-11-26 13:46:16.586 22229/F15585] Remapping "/FTL-strings" from 24576 to 28672
[2020-11-26 13:49:15.626 15585M] Resizing "/FTL-dns-cache" from 16384 to 20480
[2020-11-26 13:49:17.444 22229/F15585] Remapping "/FTL-dns-cache" from 16384 to20480
[2020-11-26 13:51:02.448 15585M] Resizing "/FTL-strings" from 28672 to 32768
[2020-11-26 13:51:16.409 15585M] Resizing "/FTL-strings" from 32768 to 36864
[2020-11-26 13:51:27.414 15585M] Resizing "/FTL-strings" from 36864 to 40960
[2020-11-26 13:51:37.061 15585M] Resizing "/FTL-strings" from 40960 to 45056
[2020-11-26 13:54:09.939 15585M] Resizing "/FTL-dns-cache" from 20480 to 24576
[2020-11-26 13:54:19.748 15585M] Resizing "/FTL-strings" from 45056 to 49152
[2020-11-26 14:01:03.288 15585M] Resizing "/FTL-queries" from 229376 to 458752

debug token updated

I am not actually sure about these messages meaning..

This typically happens for unstable power supplies, power loss without shutting down the device properly or bad SD cards.

or maybe rather

Wow! that's weird!

Thanks a lot anyway!

Anyway, I have no warning in the raspbian OS (typically it's with a thunder icon right up the screen) so I think it's weird pihole complains about that...

Actually pihole was working just fine in the previous versions also... so it's even weirer.
Do you think if I put a command like "pihole restartdns" on the contab file? Just repeat the command each 5 min for example.

Please take a look at your copy/paste method. You are embedding a lot of blank spaces (possibly from a page wrap) that is making your output difficult to read. I corrected this in both of your text outputs.

This is a bandaid and won't fix your problem.

The problem appears to lie in your long term database. Let's move that one and create a new one. Run these commands from the Pi terminal:

sudo service pihole-FTL stop

sudo mv /etc/pihole/pihole-FTL.db /etc/pihole/pihole-FTL-old.db

sudo service pihole-FTL start

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