How to fix: Your NAS time does not match your computer time

NeverEnd

Dabbler
Joined
Jun 4, 2019
Messages
32
Got this error message on dashboard today for no reason (as far as I know), running TrueNAS-SCALE-22.02.4.

timedatectl shows:
Code:
Local time: Thu 2022-10-13 09:20:22 CST
           Universal time: Thu 2022-10-13 01:20:22 UTC
                 RTC time: Thu 2022-10-13 01:20:22
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
              NTP service: n/a
          RTC in local TZ: no


NTP settings are default, and "systemctl status ntp" says ntp service is not running:
Code:
ntp.service - Network Time Service
     Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2022-10-13 09:17:09 CST; 3min 6s ago
       Docs: man:ntpd(8)
   Main PID: 3370 (code=exited, status=255/EXCEPTION)

Oct 13 09:17:01 Truenas ntpd[3370]: Listen normally on 2 lo 127.0.0.1:123
Oct 13 09:17:01 Truenas ntpd[3370]: Listen normally on 3 br001 192.168.1.100:123
Oct 13 09:17:01 Truenas ntpd[3370]: Listen normally on 4 lo [::1]:123
Oct 13 09:17:01 Truenas ntpd[3370]: Listen normally on 5 enp6s0 [fe80::21b:21ff:fee0:33a4%3]:123
Oct 13 09:17:01 Truenas ntpd[3370]: Listening on routing socket on fd #22 for interface updates
Oct 13 09:17:01 Truenas ntpd[3370]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Oct 13 09:17:01 Truenas ntpd[3370]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Oct 13 09:17:01 Truenas systemd[1]: Started Network Time Service.
Oct 13 09:17:09 Truenas systemd[1]: ntp.service: Main process exited, code=exited, status=255/EXCEPTION
Oct 13 09:17:09 Truenas systemd[1]: ntp.service: Failed with result 'exit-code'.


Tried this command and still get the warning message on dashboard:
Code:
date +%T -s "hh:mm:ss"


BIOS time is correct - "2022-10-13 01:20:22" is the actual time (GMT+8), seems SCALE adds another 8 hours to the system time. There's no time zone setting in BIOS.

I tried to do some weird things, like setting the system time zone to GMT but still no luck. Even tried to re-install SCALE and get the same warning message.

Any idea about how to fix this?
 
Last edited:

NeverEnd

Dabbler
Joined
Jun 4, 2019
Messages
32
Got this issue fixed.
looks like SCALE treats the BIOS system time as UTC and adds 8 hours to calculate the Truenas system time and resulting in time not match, and NTP service stopped running due to huge time difference.
I added "tinker panic 0" to file /etc/ntp.conf and the issue was fixed, but after a restart this manually added command was dismissed.
I then added a Pre Init script in system settings -> advanced page with command "echo "tinker panic 0" | tee -a /etc/ntp.conf ", and after restart the time is correct.

Not sure if this is a good solution but it fixed the issue, and I hope it can be helpful to anyone who run into this issue.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Always set the BIOS time to UTC for Unix/Linux systems.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
The BIOS does indeed not have an idea of a timezone. It's only important that the clock is set to the value that corresponds to UTC.
 

copz1998

Dabbler
Joined
Sep 5, 2022
Messages
22
Always set the BIOS time to UTC for Unix/Linux systems.
Thank you, Patrick. Your suggestion worked for me. Maybe TrueNAS should amend their install documentation to suggest the UTC BIOS idea.
 

aeubank

Cadet
Joined
Sep 23, 2022
Messages
4
+1 on this. I'm new to TrueNas and the BIOS time and server time were off by a few hours. The fix was to set the difference in the BIOS.
 

NerdyNAS

Cadet
Joined
Jul 14, 2023
Messages
1
If I could add a million +1 to this I would. Helped me with quite a number of issues I was seeing. Come to find out (and for others to help diagnosis their issues) here is what happened to me:

1) Installed new motherboard into new system and did not check the BIOS date/time (unsure if it was current time or VERY wrong)
2) Did install
3) System worked and reported to be the current date and time
4) Reporting area was not working (only showing NULL for everything - couldn't figure it out)
5) Eventually read something about BIOS, check it and it's off. Sooooo change to be my current local time
6) System boots up and reporting still isn't working but NOW Kubernetes isn't working. Unable to get any applications running
7) Find this post...open BIOS and change to be UTC
8) System boots up and reporting NOW works but Kubernetes is still broken

FINALLY figure out the issue. The self generated certificate that was created upon install is set IN THE FUTURE as the creation/start date. Even when I create NEW self signed certs for the UI, Kubernetes still won't start and shows errors about cert. Merely had to wait for system time to "catch up" with date the cert was generated. At which point rebooted and everything was fine.
 
Top