Please follow the below template, it will help us to help you!
Expected Behaviour:
I clicked 'flush logs' in the GUI and ran 'pihole -f' via ssh and expected the graphs and data to be reset in the GUI.
Actual Behaviour:
Nothing happened.
Debug Token:
uymyohzxwp
Same issue here with a fresh install of Pi-hole v3.3, debug token: 56979r1aw2
I ran pi-hole -f and checked the pihole.log and it appears to have flushed the logs, but the dashboard and it's graphs have not updated.
same here...
Pi-hole Version v3.3 Web Interface Version v3.3 FTL Version v3.0
same problem here, debug token: 2o58n2l8n9
We're aware of the issue and we're working on a fix to push out.
3 Likes
I believe this is the relevant GitHub issue:
pi-hole:development
← pi-hole:fix/flushDB
opened 12:52PM - 21 Jan 18 UTC
**By submitting this pull request, I confirm the following:**
- [X] I have re… ad and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md), as well as this entire template.
- [X] I have made only one major change in my proposed changes.
- [X] I have commented my proposed changes within the code.
- [X] I have tested my proposed changes, and have included unit tests where possible.
- [X] I am willing to help maintain this change if there are issues with it later.
- [X] I give this submission freely and claim no ownership.
- [X] It is compatible with the [EUPL 1.2 license](https://opensource.org/licenses/EUPL-1.1)
- [X] I have squashed any insignificant commits. ([`git rebase`](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
- [X] I have Signed Off all commits. ([`git commit --signoff`](https://git-scm.com/docs/git-commit#git-commit---signoff))
---
**What does this PR aim to accomplish?:**
Flush also the most recent 24 hours in `FTL`'s long-term database when the user calls `pihole -f`.
**How does this PR accomplish the above?:**
It executes `DELETE FROM queries WHERE timestamp >= strftime('%s','now')-86400` on the database file to delete all queries that are younger than 24 hours in the past.
```
pihole -f
[✓] Flushed /var/log/pihole.log
[✓] Deleted 5563 queries from database
```
1 Like
I don't know, it only started happening again with 3.3, flushing logs didn't work at one point before 3.3 but you guys fixed it quick then.
aamck
February 19, 2018, 12:40pm
9
Is there a way too force it in the mean time?
Mcat12
February 19, 2018, 9:51pm
10
I think only if you run the SQL command from the PR manually.
Mcat12
February 26, 2018, 6:28pm
12
It is fixed in development.
1 Like
InguX
February 27, 2018, 6:39pm
13
Same here. after update statistics not resetting. In fact not even clears after pihole -f , found by login in with scp . Log archives still persist
Sorted it out with renaming /etc/pihole-FTL.db to /etc/pihole-FTL.db_old and use pihole -r to rebuild instalation.
Seem works only for a while
Try this
cd /etc/pihole
sudo service pihole-FTL stop
sudo rm pihole-FTL.db
sudo service pihole-FTL start
arun
March 26, 2018, 11:55am
15
I have the same issue with latest version ( Pi-hole version is v3.3 (Latest: v3.3), AdminLTE version is v3.3 (Latest: v3.3), FTL version is v3.0 (Latest: v3.0) ).
command from PR means ? ( Can any one help me that , what it means PR here ) , I want to try below command.
DELETE * FROM queries WHERE timestamp >= strftime('%s','now')-86400
mibere
March 26, 2018, 12:44pm
16
@arun This is what the above PR (Pull request) does:
Delete most recent 24 hours from FTL's database, leave even older data intact (don't wipe out all history)
You can try to execute the following single-line command. Use at your own risk
sqlite3 "/etc/pihole/pihole-FTL.db" "DELETE FROM queries WHERE timestamp >= strftime('%s','now')-86400; select changes() from queries limit 1"
2 Likes
arun
March 27, 2018, 6:12am
17
mibere:
@arun This is what the above PR (Pull request) does:
Delete most recent 24 hours from FTL's database, leave even older data intact (don't wipe out all history)
You can try to execute the following single-line command. Use at your own risk
sqlite3 "/etc/pihole/pihole-FTL.db" "DELETE FROM queries WHERE timestamp >= strftime('%s','now')-86400; select changes() from queries limit 1"
Hi Friend ,
I tried this , Pi-hole is in a debian box here, I installed sqllite3 and run above command , initially it shown 'database lock error' later I stopped logging from web interface and executed this and worked !! , Thanks once again . Hope this issue will be rectified soon!!
1 Like
arun
March 28, 2018, 8:29am
18
Hi @aamck , used @mibere idea & created cron job for this
#!/bin/bash
/usr/local/bin/pihole -l off
/bin/sleep 10
/usr/bin/sqlite3 "/etc/pihole/pihole-FTL.db" "DELETE FROM queries WHERE timestamp >= strftime('%s','now')-86400; select changes() from queries limit 1"
/bin/sleep 10
/usr/local/bin/pihole -f
/bin/sleep 10
/usr/local/bin/pihole -l on
system
Closed
April 18, 2018, 8:29am
19
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.