Long-Term Data can’t be loaded

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

Expected Behaviour:

Being able to access long term data from webui.

Actual Behaviour:

When checking long term data I get the following error:

An unknown error occurred while loading the data.

Check the server's log files (/var/log/lighttpd/error-pihole.log) for details.

You may need to increase PHP memory limit.

/var/log/lighttpd/error-pihole.log has the following entries:

2023-12-11 19:55:02: (mod_fastcgi.c.451) FastCGI-stderr:PHP Warning:  Undefined array key "auth" in /var/www/html/admin/scripts/pi-hole/php/password.php on line 108
2023-12-11 19:56:40: (mod_fastcgi.c.451) FastCGI-stderr:PHP Warning:  Undefined array key "auth" in /var/www/html/admin/scripts/pi-hole/php/password.php on line 108
2023-12-11 19:58:47: (mod_fastcgi.c.451) FastCGI-stderr:PHP Warning:  Undefined array key "auth" in /var/www/html/admin/scripts/pi-hole/php/password.php on line 108
2023-12-12 13:12:14: (mod_fastcgi.c.451) FastCGI-stderr:PHP Warning:  SQLite3::prepare(): Unable to prepare statement: 1, no such table: query_storage in /var/www/html/admin/api_db.php on line 94
2023-12-12 13:12:14: (mod_fastcgi.c.451) FastCGI-stderr:PHP Fatal error:  Uncaught Error: Call to a member function bindValue() on bool in /var/www/html/admin/api_db.php:95
2023-12-12 13:12:14: (mod_fastcgi.c.451) FastCGI-stderr:Stack trace:
2023-12-12 13:12:14: (mod_fastcgi.c.451) FastCGI-stderr:#0 {main}
2023-12-12 13:12:14: (mod_fastcgi.c.451) FastCGI-stderr:  thrown in /var/www/html/admin/api_db.php on line 95
2023-12-12 13:12:22: (mod_fastcgi.c.451) FastCGI-stderr:PHP Warning:  SQLite3::prepare(): Unable to prepare statement: 1, no such table: query_storage in /var/www/html/admin/api_db.php on line 94
2023-12-12 13:12:22: (mod_fastcgi.c.451) FastCGI-stderr:PHP Fatal error:  Uncaught Error: Call to a member function bindValue() on bool in /var/www/html/admin/api_db.php:95
2023-12-12 13:12:22: (mod_fastcgi.c.451) FastCGI-stderr:Stack trace:
2023-12-12 13:12:22: (mod_fastcgi.c.451) FastCGI-stderr:#0 {main}
2023-12-12 13:12:22: (mod_fastcgi.c.451) FastCGI-stderr:  thrown in /var/www/html/admin/api_db.php on line 95
2023-12-12 13:14:27: (server.c.2057) server stopped by UID = 0 PID = 1
2023-12-12 13:14:28: (server.c.1551) server started (lighttpd/1.4.63)
2023-12-12 13:14:32: (mod_fastcgi.c.451) FastCGI-stderr:PHP Warning:  SQLite3::prepare(): Unable to prepare statement: 1, no such table: query_storage in /var/www/html/admin/api_db.php on line 94
2023-12-12 13:14:32: (mod_fastcgi.c.451) FastCGI-stderr:PHP Fatal error:  Uncaught Error: Call to a member function bindValue() on bool in /var/www/html/admin/api_db.php:95
2023-12-12 13:14:32: (mod_fastcgi.c.451) FastCGI-stderr:Stack trace:
2023-12-12 13:14:32: (mod_fastcgi.c.451) FastCGI-stderr:#0 {main}
2023-12-12 13:14:32: (mod_fastcgi.c.451) FastCGI-stderr:  thrown in /var/www/html/admin/api_db.php on line 95
2023-12-12 13:15:25: (mod_fastcgi.c.451) FastCGI-stderr:PHP Warning:  SQLite3::prepare(): Unable to prepare statement: 1, no such table: query_storage in /var/www/html/admin/api_db.php on line 94
2023-12-12 13:15:25: (mod_fastcgi.c.451) FastCGI-stderr:PHP Fatal error:  Uncaught Error: Call to a member function bindValue() on bool in /var/www/html/admin/api_db.php:95
2023-12-12 13:15:25: (mod_fastcgi.c.451) FastCGI-stderr:Stack trace:
2023-12-12 13:15:25: (mod_fastcgi.c.451) FastCGI-stderr:#0 {main}
2023-12-12 13:15:25: (mod_fastcgi.c.451) FastCGI-stderr:  thrown in /var/www/html/admin/api_db.php on line 95
2023-12-12 14:07:15: (server.c.2057) server stopped by UID = 0 PID = 1
2023-12-12 14:07:16: (server.c.1551) server started (lighttpd/1.4.63)
2023-12-12 14:07:30: (mod_fastcgi.c.451) FastCGI-stderr:PHP Warning:  SQLite3::prepare(): Unable to prepare statement: 1, no such table: query_storage in /var/www/html/admin/api_db.php on line 94
2023-12-12 14:07:30: (mod_fastcgi.c.451) FastCGI-stderr:PHP Fatal error:  Uncaught Error: Call to a member function bindValue() on bool in /var/www/html/admin/api_db.php:95
2023-12-12 14:07:30: (mod_fastcgi.c.451) FastCGI-stderr:Stack trace:
2023-12-12 14:07:30: (mod_fastcgi.c.451) FastCGI-stderr:#0 {main}
2023-12-12 14:07:30: (mod_fastcgi.c.451) FastCGI-stderr:  thrown in /var/www/html/admin/api_db.php on line 95
2023-12-12 14:31:13: (mod_fastcgi.c.451) FastCGI-stderr:PHP Warning:  SQLite3::prepare(): Unable to prepare statement: 1, no such table: query_storage in /var/www/html/admin/api_db.php on line 94
2023-12-12 14:31:13: (mod_fastcgi.c.451) FastCGI-stderr:PHP Fatal error:  Uncaught Error: Call to a member function bindValue() on bool in /var/www/html/admin/api_db.php:95
2023-12-12 14:31:13: (mod_fastcgi.c.451) FastCGI-stderr:Stack trace:
2023-12-12 14:31:13: (mod_fastcgi.c.451) FastCGI-stderr:#0 {main}
2023-12-12 14:31:13: (mod_fastcgi.c.451) FastCGI-stderr:  thrown in /var/www/html/admin/api_db.php on line 95

I followed the FAQ at FAQ - Pi-hole documentation, but unfortunately the problem persists

Debug Token:

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

Any suggestion is appreciated! Thank you!

Your database is incomplete/corrupted.

The Debug Log shows the database file size is only 44Kb (an empty database should be at least 80Kb):

*** [ DIAGNOSING ]: Pi-hole FTL Query Database
-rw-rw-r-- 1 pihole pihole 44K Dec 12 13:10 /etc/pihole/pihole-FTL.db

And there are many warnings about missing tables or columns:

... Unable to prepare statement: 1, no such table: query_storage ...

... SQLite3 message: no such column: name in "UPDATE network_addresses ..."

To fix this, run these commands to move the existing database to a new file name and create a fresh database.

sudo service pihole-FTL stop

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

sudo service pihole-FTL start
1 Like

That solved it! Thank you very much for quick reply!

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