web icon indicating copy to clipboard operation
web copied to clipboard

Query Log shows as blank after a day of usage, comes back with reboot

Open GoodnessJSON opened this issue 8 months ago • 6 comments

Versions

  • Core version is v6.0.5 (Latest: v6.0.5)
  • Web version is v6.0.2 (Latest: v6.0.2)
  • FTL version is v6.0.4 (Latest: v6.0.4)

Platform

  • OS and version: Debian GNU/Linux 12 (bookworm)
  • Platform: Raspberry Pi

Expected behavior

When I visit the query log in PiHole Web, I expect to see a number of rows of history showing all the recent DNS queries that has been made to PiHole.

Actual behavior / bug

The query log is empty and is blank. There are no records. The homepage graphs continue to show requests in the bar chart, but the query log is empty. When I reboot the device and PiHole, QL functionality is then restored but will eventually stop again 24-48 hours later. Advanced Filtering does not work either.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to PiHole Homepage
  2. Click on Query Log
  3. See empty table.

Debug Token

  • URL: https://tricorder.pi-hole.net/ei1KECkV/

Screenshots

I have just rebooted my instance so unfortunately do not have a screenshot. But the query log is empty.

Additional context

I have otherwise had a very stable V5 install and have been a long time PiHole user. I've had to resort to doing a daily reboot to ensure the query log works, but this isn't preferable as it wipes the cache among other impacts. I have no privacy related settings turned on, everything is logged.

GoodnessJSON avatar Mar 11 '25 09:03 GoodnessJSON

This is the issue

  2025-03-11 00:21:00.044 AEDT [1228/T1329] WARNING: Database /etc/pihole/pihole-FTL.db is damaged and cannot be used.
   2025-03-11 00:21:00.044 AEDT [1228/T1329] ERROR: delete_old_queries_in_DB() failed!
   2025-03-11 00:21:00.044 AEDT [1228/T1329] ERROR: SQLite3: statement aborts at 1: [BEGIN TRANSACTION IMMEDIATE] cannot start a transaction within a transaction (1)
   2025-03-11 00:21:00.044 AEDT [1228/T1329] ERROR: ERROR: SQL query "BEGIN TRANSACTION IMMEDIATE" failed: SQL logic error (SQLITE_ERROR)
   2025-03-11 00:21:00.044 AEDT [1228/T1329] ERROR: Storing devices in network table ("BEGIN TRANSACTION IMMEDIATE") failed
   2025-03-11 00:24:00.073 AEDT [1228/T1329] ERROR: SQLite3: statement aborts at 1: [BEGIN TRANSACTION IMMEDIATE] cannot start a transaction within a transaction (1)
   2025-03-11 00:24:00.073 AEDT [1228/T1329] ERROR: ERROR: SQL query "BEGIN TRANSACTION IMMEDIATE" failed: SQL logic error (SQLITE_ERROR)

Try

systemctl stop pihole-FTL
sudo mv /etc/pihole/pihole-FTL.db /etc/pihole/pihole-FTL.db.bck
systemctl start pihole-FTL

yubiuser avatar Mar 11 '25 09:03 yubiuser

Try

systemctl stop pihole-FTL
sudo mv /etc/pihole/pihole-FTL.db /etc/pihole/pihole-FTL.db.bck
systemctl start pihole-FTL

Many thanks for this, I'll give it a go now.

I actually did DB reset at the start of the V5 -> V6 migration, as well as a fresh install of V6 due to the slowdown issue in the GUI.

It seems there is something problematic with how FTL writes to its DB, I see this a lot on the Reddit posts as well. Apologies for this issue post, I'll be more mindful to look at the logs first myself in the future. Keep up the great work, one of my favourite OS projects.

GoodnessJSON avatar Mar 11 '25 09:03 GoodnessJSON

No worries. There might be a bug hidden somewhere but it would affect only a few users. If this happens more often to you, you should check your filesystem for issues as well.

yubiuser avatar Mar 11 '25 10:03 yubiuser

Try

systemctl stop pihole-FTL
sudo mv /etc/pihole/pihole-FTL.db /etc/pihole/pihole-FTL.db.bck
systemctl start pihole-FTL

Many thanks for this, I'll give it a go now.

I actually did DB reset at the start of the V5 -> V6 migration, as well as a fresh install of V6 due to the slowdown issue in the GUI.

It seems there is something problematic with how FTL writes to its DB, I see this a lot on the Reddit posts as well. Apologies for this issue post, I'll be more mindful to look at the logs first myself in the future. Keep up the great work, one of my favourite OS projects.

Thanks a lot. Got the same issue and is solved the problem.

GUINN355 avatar Apr 04 '25 13:04 GUINN355

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

github-actions[bot] avatar May 05 '25 08:05 github-actions[bot]

I have been experiencing the same issue since the new release. The commands only temporarily resolve the issue for a few days. Similar configuration as the OP.

sidial01 avatar May 05 '25 14:05 sidial01

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

github-actions[bot] avatar Jun 05 '25 08:06 github-actions[bot]