SOLVED TrueNAS displays time correctly but sets it in BIOS

Stromkompressor

Dabbler
Joined
Mar 13, 2023
Messages
18
Hi!

I have a pretty fresh install of TrueNAS-SCALE-22.12.1. The time in the web UI is always correct but the underlying system time (checked with SSH and timedatectl) is wrong:

Code:
admin@truenas[~]$ timedatectl
               Local time: Tue 2023-04-18 20:17:50 CEST
           Universal time: Tue 2023-04-18 18:17:50 UTC
                 RTC time: Tue 2023-04-18 18:17:50
                Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: no
              NTP service: n/a
          RTC in local TZ: no


I am in CEST but it is 18:18 not 20:18. Even though I have the default 3 NTP servers still configured, it says NTP service: n/a. Also somehow my BIOS time resets itself to the local time after reboots:
1681835153380.png

I tried enabling NTP with the +2 timezone in the BIOS/IPMI but it is still wrong in timedatectl. The web UI always shows the correct time (maybe it's just the browser's time).

I am using a Supermicro mainboard and the screenshot above is from the IPMI web interface. How should the setup be in general? Set the IPMI to use NTP and set the timezone to +2? And then remove all NTP servers from TrueNAS?

Basically the main issue I want to fix is the reporting is showing everything as null. I found out that setting the time correctly makes the reporting work but sadly I can't reproduce the correct time after rebooting.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You need to set your BIOS time to UTC and set the time zone in the UI. That means when it is 18:20 CEST at your place, you need to set the hardware clock of your server to 16:20.
 
Last edited:

Stromkompressor

Dabbler
Joined
Mar 13, 2023
Messages
18
@samarium Thanks, this made date respond with the correct time! It says -7200 s which is exactly the 2 h difference.

Code:
root@truenas:/home/admin# date
Wed Apr 19 19:57:06 CEST 2023
root@truenas:/home/admin# systemctl stop ntp
root@truenas:/home/admin# ntpd -g -q
19 Apr 19:57:16 ntpd[9343]: ntpd 4.2.8p15@1.3728-o Wed Sep 23 11:46:38 UTC 2020 (1): Starting
19 Apr 19:57:16 ntpd[9343]: Command line: ntpd -g -q
19 Apr 19:57:16 ntpd[9343]: ----------------------------------------------------
19 Apr 19:57:16 ntpd[9343]: ntp-4 is maintained by Network Time Foundation,
19 Apr 19:57:16 ntpd[9343]: Inc. (NTF), a non-profit 501(c)(3) public-benefit
19 Apr 19:57:16 ntpd[9343]: corporation.  Support and training for ntp-4 are
19 Apr 19:57:16 ntpd[9343]: available at https://www.nwtime.org/support
19 Apr 19:57:16 ntpd[9343]: ----------------------------------------------------
19 Apr 19:57:16 ntpd[9343]: proto: precision = 0.047 usec (-24)
19 Apr 19:57:16 ntpd[9343]: basedate set to 2020-09-11
19 Apr 19:57:16 ntpd[9343]: gps base set to 2020-09-13 (week 2123)
19 Apr 19:57:16 ntpd[9343]: Listen and drop on 0 v6wildcard [::]:123
19 Apr 19:57:16 ntpd[9343]: Listen and drop on 1 v4wildcard 0.0.0.0:123
19 Apr 19:57:16 ntpd[9343]: Listen normally on 2 lo 127.0.0.1:123
19 Apr 19:57:16 ntpd[9343]: Listen normally on 3 eno1 192.168.2.12:123
19 Apr 19:57:16 ntpd[9343]: Listen normally on 4 lo [::1]:123
19 Apr 19:57:16 ntpd[9343]: Listen normally on 5 eno1 [2003:d0:df01:9a00:ae1f:6bff:fe1c:930]:123
19 Apr 19:57:16 ntpd[9343]: Listen normally on 6 eno1 [fe80::ae1f:6bff:fe1c:930%2]:123
19 Apr 19:57:16 ntpd[9343]: Listening on routing socket on fd #23 for interface updates
19 Apr 17:57:27 ntpd[9343]: ntpd: time set -7195.075982 s
ntpd: time set -7195.075982s
root@truenas:/home/admin# systemctl start ntp
root@truenas:/home/admin# hwclock --show
2023-04-19 19:57:56.296045+02:00
root@truenas:/home/admin# hwclock --systohc
root@truenas:/home/admin# hwclock --show
2023-04-19 17:58:14.249072+02:00
root@truenas:/home/admin# date
Wed Apr 19 17:58:18 CEST 2023
root@truenas:/home/admin#


After a reboot the date command still returns the correct time. But it says the reporting database is broken:

1681920170752.png

1681920196624.png

After clearing the reporting database everything seems to work now! Thanks for your help :)
 

cole21771

Cadet
Joined
Aug 19, 2023
Messages
1
If after that you are still having issues:
Code:
sudo bash
date
systemctl stop ntp
ntpd -g -q
systemctl start ntp
hwclock --systohc
date
Holy shit, thank you! This should be in the standard setup docs as it solved both my reporting and catalog fetching issues!
 

turment

Dabbler
Joined
Feb 3, 2020
Messages
46
If after that you are still having issues:
Code:
sudo bash
date
systemctl stop ntp
ntpd -g -q
systemctl start ntp
hwclock --systohc
date

I have some issues:

Code:
root@XeoNAS:~# systemctl stop ntp
Failed to stop ntp.service: Unit ntp.service not loaded.
root@XeoNAS:~# ntpd -g -q
bash: ntpd: command not found
root@XeoNAS:~# systemctl start ntp
Failed to start ntp.service: Unit ntp.service not found.


I have the last stable version of Scale.

Can you help me?
 
Top