Data get reset after reboot of system or Pihole

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

Expected Behaviour:

That the data should be store in the database and that it should not be resetting back to 0 when i reboot the service or the VM.

Actual Behaviour:

When i reboot the computer or Pihole all the statistic data get deleted and it starting back on 0 again.

Debug Token:

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

I have try to pihole -r but that don't seems to be helping.

Seeing this errors in the error log

2023-09-23 09:20:08: (mod_fastcgi.c.451) 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 385
2023-09-23 09:20:13: (mod_fastcgi.c.451) 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 385
2023-09-23 09:25:29: (mod_fastcgi.c.451) 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 385
2023-09-23 09:25:32: (mod_fastcgi.c.451) 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 385
2023-09-23 09:25:34: (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-09-23 09:25:34: (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-09-23 09:25:34: (mod_fastcgi.c.451) FastCGI-stderr:Stack trace:
2023-09-23 09:25:34: (mod_fastcgi.c.451) FastCGI-stderr:#0 {main}
2023-09-23 09:25:34: (mod_fastcgi.c.451) FastCGI-stderr: thrown in /var/www/html/admin/api_db.php on line 95
2023-09-23 09:25:37: (mod_fastcgi.c.451) 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 385

Can that be related?

I manage to fix this my self whit following step.

cd /etc/pihole
sudo rm -r pihole-FTL.db
pihole -r

So it seems like maybe something got wrong during the pihole install.

Probably.

Your debug log shows the database was only 20Kb in size:

*** [ DIAGNOSING ]: Pi-hole FTL Query Database
-rw-rw-r-- 1 pihole pihole 20K Sep 16 17:04 /etc/pihole/pihole-FTL.db

Even a completely empty pihole-FTL database should be larger (around 80Kb). I think something went wrong during the database creation, leading to this error.

Glad you fixed!

Yes i thought so to. That`s why i posted how i fix it if someone else end up whit the same problem they could try this out to.

I had the mysterious phenomenon and used the same solution.

The error was solved and never occurred again.

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