-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vnStat stuck on future date after Chrony service finished date/time sync #267
Comments
vnStat doesn't have any built-in time synchronization functionality so only the current date/time being too much in the past (=more than timezone change could result in) compared to the latest database write can be detected. As you can see from the log, the implementation will wait for a configured time to let possible other system services do the synchronization before continuing. Since you did change the date only by one day to the future, I'd expect the issue to have fixed itself by itself due to enough time having passed. Otherwise, the database edits explained in #160 would have been the alternative. |
Understood, thanks for the response.. |
vnStat 1.x versions use a less advanced database solution resulting in those instructions not being applicable. If the vnStat 1.x database needs to be modified then it requires exporting the database content to a text file, modifying that text file by removing the problematic entries and then importing it back while hoping nothing got corrupted. Does you RaspberryPi have a clock which drifts towards the future or what's the situation that causes this "stuck issue" if you haven't intentionally manipulated the system time? I recall the RaspberryPis are mainly missing an RTC chip which means that the date/time resets if the system is rebooted or powered off. Most distributions try to minimize the effect by writing down the current date/time during shutdown and then restoring that date/time during boot and then starting some NTP client to sync for the actual time. With this setup, I don't see how the date/time would drift towards the future and that setup is also something vnStat is able to handle. |
The RaspberryPi here as IoT device, we still not investigate in more detail about the root cause that make drifts because its not really frequent, but happen one or two times. We have RTC chip in it, so i think the problem not related to that.. Because of that we relying with NTP server to be able sync the system time if the drift happen some times in the future, but while testing it with manual intervention in this case we just realized that vnStat still stuck on future date even after Chrony service that handle the NTP finished the time sync and make the system time normal again.. So maybe the last 2 question from me is,
Thanks... |
Hi, i face same problem like issue #160 and want to ask is there any way to fix vnstat stuck issue automatically ?
Sorry if this question also related to another program..
Background problem:
My device is RaspberryPi, there i have Chrony service to tackle date/time drift issue automatically. So in my testing i did set date/time manually +1 day to future and Chrony did the job to sync it back.
But after Chrony finished the sync time back to normal (i have confirm it back to normal), and i leave my device for couple of hour then i just realized that Vnstat continue the network monitoring still in +1 day in future, even though the system date/time has been sync to normal..
This some logs that i have:
Oct 23 03:15:45 beam vnstatd[805785]: Info: Latest database update is in the future (db: 2024-10-24 03:11:40 > now: 2024-10-23 03:15:45). Giving the system clock up to 5 minutes to sync before continuing.
Oct 23 03:20:45 beam vnstatd[805785]: Info: Latest database update is still in the future (db: 2024-10-24 03:11:40 > now: 2024-10-23 03:20:45), continuing. Some errors may follow.
Question:
So any idea how to tackle this issue automatically ?
Thanks in advance..
The text was updated successfully, but these errors were encountered: