The graphs are displayed in the web UI after start the Pi where Pi-hole is installed.
Actual Behaviour:
I switch off the Pi running Pi-hole with normal shutdown if I'm not at home for some time. The graphs are not displayed in any web UI (Chrome, FF on Windows or Safari on an iPad) after start the Pi. This does not recover if I let the Pi run for some days. Restarting a browser or client does not help to display the graphs. That I expect it's more a Pi-hole related issue.
The only way to get the Graphs be shown is to restart the Pi with "shutdown -r". The graphs are displayed on all devices afterwards.
The following debug token is provided after a restart with graphs working.
When you start Pi-Hole, the information to populate the dashboard is read from the long term database at /etc/pihole/pihole-FTL.db. The default is to read 24 hours of data.
If there is a problem with your database, then this can affect this process. In your debug log, Pi-Hole is doing a number of activities to prune the database.
As a test, I would temporarily move the long term database and restart FTL. If the problem resolves after 24 hours of data collection, then it would indicate a problem with the existing database.
sudo service pihole-FTL stop
sudo mv /etc/pihole/pihole-FTL.db /etc/pihole/pihole-FTL-old.db
sudo service pihole-FTL start
I'll try the FTL DB stuff now. Report back tomorrow.
Edit: The graphs is displayed at the moment. But it's unclear if this is because the DB is changed. Or if this is the same behavior as the usual restart. Lets see later.
I did some investigations after the problem is still happening.
I started monitoring the requests to the PiHole Server with the browsers web dev tools. Only one URL was requested frequently: 'http://192.168.2.253/admin/api.php?summary'
Scrolling back to the top of the requests (after reload the whole page) shows a request '/admin/api.php?overTimeData10mins' returning '{"domains_over_time":{"1575802500":3473},"ads_over_time":{"1575802500":1190}}'. Checking the timestamp shows a date 'Sunday, December 8, 2019 10:55:00 AM' which is incorrect.
Restarting the 'pihole-FTL' service on the PI shows other results for the '/admin/api.php?overTimeData10mins' request with current time stamps:
'{"domains_over_time":{"1576182900":34,"1576183500"'
And two other requests are now active frequently from the client:
'/admin/api.php?summaryRaw&topItems'
'/admin/api.php?summaryRaw&getQuerySources&topClientsBlocked'
I think the problem is a mix of restart the PI and internal time handling of the programs:
the Pi does not have a HW clock running while it's powered off
the clock is the last value on shutdown
the PI and some time sync to set the hw clock is starting in parallel
storing the DNS lookup events (including good, bad decision) is running with the current time after the startup
looking up values from the DB is using the OLD date and it does not update with the current setting from the HW clock
Question:
Is it possible to start the 'pihjole-FTL' after the hwclock.sh is run on a PI?