FTL offline after few hours

Hello Everybody!

I have a pihole installed on my raspberry pi for more than a year that's been working perfectly. But for no reason that I know It lost connection to API and the FTL is offline after a few hours of restarting the DNS server.

I have also installed an apache server on port 80 working fine. I have erased the avahi on the raspberry pi with no success.

This is my debug token
https://tricorder.pi-hole.net/CtpXHxMF/

Please I need some help. Thanks in advance.

Your debug log shows that you have file system issues - which might be the reason Pi-hole fails after a few hours (or any other process running on your system).

[2021-09-02 23:15:52.404 13713M] SQLite3 message: database corruption at line 81887 of [5d4c65779d] (11)
   [2021-09-02 23:15:52.404 13713M] SQLite3 message: statement aborts at 9: [SELECT name FROM network_addresses WHERE name IS NOT NULL AND ip = ?;] database disk image is malformed (11)
   [2021-09-02 23:15:52.404 13713M] SQLite3 message: database corruption at line 81887 of [5d4c65779d] (11)
   [2021-09-02 23:15:52.404 13713M] SQLite3 message: statement aborts at 20: [SELECT name FROM network_addresses WHERE name IS NOT NULL AND network_id = (SELECT network_id FROM network_addresses WHERE ip = ?) ORDER BY lastSeen DESC LIMIT 1] database disk image i (11)
   [2021-09-02 23:15:52.404 13713M] SQLite3 message: database corruption at line 81887 of [5d4c65779d] (11)
   [2021-09-02 23:15:52.405 13713M] SQLite3 message: statement aborts at 10: [SELECT interface FROM network JOIN network_addresses ON network_addresses.network_id = network.id WHERE network_addresses.ip = ? AND interface != 'N/A' AND interface IS NOT NULL;] data (11)
   [2021-09-02 23:15:52.446 13713M] SQLite3 message: database corruption at line 81887 of [5d4c65779d] (11)
   [2021-09-02 23:15:52.447 13713M] SQLite3 message: statement aborts at 25: [SELECT hwaddr FROM network WHERE id = (SELECT network_id FROM network_addresses WHERE ip = ? GROUP BY ip HAVING max(lastSeen));] database disk image is malformed (11)
   [2021-09-02 23:15:52.447 13713M] SQLite3 message: database corruption at line 81887 of [5d4c65779d] (11)
   [2021-09-02 23:15:52.447 13713M] SQLite3 message: statement aborts at 9: [SELECT name FROM network_addresses WHERE name IS NOT NULL AND ip = ?;] database disk image is malformed (11)
   [2021-09-02 23:15:52.447 13713M] SQLite3 message: database corruption at line 81887 of [5d4c65779d] (11)
   [2021-09-02 23:15:52.447 13713M] SQLite3 message: statement aborts at 20: [SELECT name FROM network_addresses WHERE name IS NOT NULL AND network_id = (SELECT network_id FROM network_addresses WHERE ip = ?) ORDER BY lastSeen DESC LIMIT 1] database disk image i (11)
   [2021-09-02 23:15:52.448 13713M] SQLite3 message: database corruption at line 81887 of [5d4c65779d] (11)
   [2021-09-02 23:15:52.448 13713M] SQLite3 message: statement aborts at 10: [SELECT interface FROM network JOIN network_addresses ON network_addresses.network_id = network.id WHERE network_addresses.ip = ? AND interface != 'N/A' AND interface IS NOT NULL;] data (11)
   [2021-09-02 23:15:52.449 13713M] SQLite3 message: database corruption at line 81887 of [5d4c65779d] (11)
   [2021-09-02 23:15:52.449 13713M] SQLite3 message: statement aborts at 25: [SELECT hwaddr FROM network WHERE id = (SELECT network_id FROM network_addresses WHERE ip = ? GROUP BY ip HAVING max(lastSeen));] database disk image is malformed (11)

That might happen after sudden power loss.
You could try to repair the database (for which you need to checkout the current development branch) or simply move/delete it (you loose historical query data).

pihole checkout ftl development
sudo service pihole-FTL stop
pihole-FTL /etc/pihole/pihole-FTL.db ".recover" | pihole-FTL ~/pihole-FTL_recovered.db
sudo mv ~/pihole-FTL_recovered.db /etc/pihole/pihole-FTL.db
sudo service pihole-FTL start
sudo service pihole-FTL stop
sudo mv /etc/pihole/pihole-FTL.db /etc/pihole/pihole-FTL_old.db
sudo service pihole-FTL start

Thanks for your help. The issue has been solved with your solution. :slight_smile:

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