I have a Pi-hole install the is constantly saying DNS not running. After DNS is restarted the service works for a while but then it stops working. Any help I would really appreciate. I know my ubuntu version is not supported but I have exactly the same setup in another server and it is currently working
Running an unsupported OS is the least of your problem:
/var/www/html/admin/api_db.php on line 402
2021-08-19 13:38:43: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: message in /var/www/html/admin/api_db.php on line 402
2021-08-19 13:38:44: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning: SQLite3::query(): Unable to prepare statement: 1, no such
-----head of pihole-FTL.log------
[2021-08-20 00:01:00.143 786/T790] SQLite3 message: no such table: network_addresses in "DELETE FROM network_addresses WHERE lastSeen < 1597896060;" (1)
[2021-08-20 00:01:00.143 786/T790] ERROR: SQL query "DELETE FROM network_addresses WHERE lastSeen < 1597896060;" failed: SQL logic error
[2021-08-20 00:01:00.143 786/T790] SQLite3 message: API call with invalid database connection pointer (21)
[2021-08-20 00:01:00.144 786/T790] SQLite3 message: misuse at line 165242 of [5d4c65779d] (21)
[2021-08-20 00:01:00.144 786/T790] Error while trying to close database: bad parameter or other API misuse
[2021-08-20 00:02:00.237 786/T790] SQLite3 message: no such table: network_addresses in "DELETE FROM network_addresses WHERE lastSeen < 1597896120;" (1)
[2021-08-20 00:02:00.237 786/T790] ERROR: SQL query "DELETE FROM network_addresses WHERE lastSeen < 1597896120;" failed: SQL logic error
[2021-08-20 00:02:00.238 786/T790] SQLite3 message: API call with invalid database connection pointer (21)
[2021-08-20 00:02:00.238 786/T790] SQLite3 message: misuse at line 165242 of [5d4c65779d] (21)
[2021-08-20 06:05:00.056 786/T790] WARN: Command "ip neigh show" failed!
[2021-08-20 06:05:00.057 786/T790] Message: Success
I remember I have seen the last two lines before:
Taken together it is very likely that your /etc/pihole/pihole-FTL.db is corrupted, probably even more places on your file system.
I would go for the nuclear option and delete the database as described here. If the errors return, it's time for a new SD card.
@yubiuser Thanks. I just did as you suggested. This PI is brand new so is the SD card.
Let's see what happens. I will continue monitoring. Anything else you think I should do in the mean time?
ubuntu@lea:~$ pihole status
[✓] DNS service is listening
[✓] UDP (IPv4)
[✓] TCP (IPv4)
[✓] UDP (IPv6)
[✓] TCP (IPv6)
[✓] Pi-hole blocking is enabled
ubuntu@lea:~$ sudo service pihole-FTL stop
ubuntu@lea:~$ sudo rm /etc/pihole/pihole-FTL.db
ubuntu@lea:~$ ls -la /etc/pihole/pihole-FTL.db
ls: cannot access '/etc/pihole/pihole-FTL.db': No such file or directory
ubuntu@lea:~$ sudo service pihole-FTL start
ubuntu@lea:~$ pihole status
[✓] DNS service is listening
[✓] UDP (IPv4)
[✓] TCP (IPv4)
[✓] UDP (IPv6)
[✓] TCP (IPv6)
[✓] Pi-hole blocking is enabled
ubuntu@lea:~$