I rebooted my fedora 37 VM, and 1 application started to dispaly the following error
Warning: Error fetching server time: Detected 50496.27999997139 seconds time difference between your browser and the server.
I discovered that day date was 1 day behind, so today is October 6 and in fedora UI I see October 5th. I tried to chnage it manually but it was not possible even when I log as root.
When I issue timedatectl status
> Local time: Thu 2023-10-05 20:58:11 CEST
Universal time: Thu 2023-10-05 18:58:11 UTC
RTC time: Thu 2023-10-05 18:55:04
Time zone: Europe/Paris (CEST, +0200)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
I tried timedatectl set-local-rtc 0
but it did not help.
As indicated this happened suddenly and datetime was Ok for more than 2 years. So what might changed or lead to this behavior and how can I fix it?
Thanks in advance
Many systems have a hardware clock powered by a small battery when the system is off. Check the user manual to see if your system uses such a battery and find out how to replace it. If you can remove the battery and have access to a voltmeter you can check that it provides the correct voltage. In my experience, clock problems occur when the voltage is substantially lower than the rated value. You also find that replacing the battery resets BIOS options if you are not using defaults.
Oct 05 14:33:39 fedora chronyd[669]: chronyd version 4.3 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS >
Oct 05 14:33:39 fedora chronyd[669]: Frequency 12.258 +/- 1.217 ppm read from /var/lib/chrony/drift
Oct 05 14:33:39 fedora chronyd[669]: Using right/UTC timezone to obtain leap second data
Oct 05 14:33:39 fedora chronyd[669]: Loaded seccomp filter (level 2)
Oct 05 14:33:40 fedora systemd[1]: Started chronyd.service - NTP client/server.
Oct 05 14:33:53 fedora.salam.net chronyd[669]: Selected source 212.27.38.253 (mafreebox.free.fr)
Oct 05 14:33:53 fedora.salam.net chronyd[669]: System clock TAI offset set to 37 seconds
Oct 05 20:12:22 fedora.salam.net chronyd[669]: Can’t synchronise: no selectable sources
Oct 05 20:17:45 fedora.salam.net chronyd[669]: Selected source 212.27.38.253 (mafreebox.free.fr)
Oct 05 20:17:45 fedora.salam.net chronyd[669]: System clock wrong by 50593.841437 seconds
Stephen, here is the output of the command timedatectl status
on a second fedora 37 VM
> Local time: Fri 2023-10-06 18:15:45 CEST
Universal time: Fri 2023-10-06 16:15:45 UTC
RTC time: Fri 2023-10-06 16:15:45
Time zone: Europe/Paris (CEST, +0200)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
I dfont know why, all of a sudden when I was trying checking some services according to Vladislav, I just noticed that right now date and time are correct on the fedora that was having the issue !!!
The total number of leap seconds ever applied is 37 seconds, that is the difference between TAI time and UTC time. On 31 December at 24:00 UTC there might be another one applied, or perhaps not.
Some NTP clients won’t start if the difference between the system time and network time is too great. chronyd can do large time jumps. journalctl should show significant clock events.
I think systemd timesyncd won’t run if ntpsec or chrony is installed.
Earth’s rotation speed slowed for years, but has increased in recent years: Earth’s rotation affects eclipses. There is a possibility that some software doesn’t handle negative leap seconds.
From the log it looks like something has stepped the VM’s clock while it was running. chronyd in the default configuration is allowed to correct the clock by step only on start. If something disturbs the clock later, chronyd would try to correct it slowly be slewing, but with such a large offset it would take few weeks to correct. If you cannot find and fix the problem that caused the clock step, you might need to allow chronyd to correct by step at any time by changing makestep in chrony.conf to 1 -1.