Wrong timezone in apps and shell TrueNAS SCALE #24

Closed
opened 2023-09-15 11:54:23 +02:00 by tdpeuter · 5 comments
Owner

The timezone, which is displayed correctly in the webUI is different in the shell and apps that are running. About two hours apart, suspiciously the same amount of difference between UTC and Europe/Brussels.

I confirm times in shells using date.

This system is running TrueNAS SCALE.

The timezone, which is displayed correctly in the webUI is different in the shell and apps that are running. About two hours apart, suspiciously the same amount of difference between UTC and Europe/Brussels. I confirm times in shells using `date`. This system is running TrueNAS SCALE.
Author
Owner

I believe my RTC was in Local time (probably thanks to Windows running on that hardware before).

(Also see SOLVED NTP Issue) Adjusted the times, using

sudo date -s "2 hours ago"
sudo hwclock --systohc --utc
NTP now manages to stay online:
admin@H4G0[~]$ sudo systemctl status ntp
● ntp.service - Network Time Service
     Loaded: loaded (/lib/systemd/system/ntp.service; enabled; preset: enabled)
     Active: active (running) since Fri 2023-09-15 10:57:47 CEST; 8min ago
       Docs: man:ntpd(8)
    Process: 3129914 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status=0/SUCCESS)
   Main PID: 3129919 (ntpd)
      Tasks: 2 (limit: 153192)
     Memory: 1.6M
        CPU: 121ms
     CGroup: /system.slice/ntp.service
             └─3129919 /usr/sbin/ntpd -p /var/run/ntpd.pid -c /etc/ntp.conf -u 114:119

Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 86 veth22709943 [fe80::c8fd:49ff:fe61:a472%43]:123
Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 87 veth90ef17b1 [fe80::2c0c:3fff:fe67:791c%44]:123
Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 88 vethcde7e1d1 [fe80::d45e:5fff:fe82:d744%45]:123
Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 89 vethf0a693fe [fe80::18d3:74ff:fe52:2d02%46]:123
Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 90 vethcbae1d98 [fe80::e80f:5fff:fe94:c6f5%47]:123
Sep 15 10:57:47 H4G0 ntpd[3129919]: Listening on routing socket on fd #107 for interface updates
Sep 15 10:57:47 H4G0 ntpd[3129919]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Sep 15 10:57:47 H4G0 ntpd[3129919]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Sep 15 10:57:47 H4G0 systemd[1]: Started ntp.service - Network Time Service.
Sep 15 11:02:51 H4G0 ntpd[3129919]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized

Unsynchronized clock is fixed by a simple reboot:
admin@H4G0[~]$ sudo systemctl status ntp
● ntp.service - Network Time Service
     Loaded: loaded (/lib/systemd/system/ntp.service; enabled; preset: enabled)
     Active: active (running) since Fri 2023-09-15 11:16:42 CEST; 1min 34s ago
       Docs: man:ntpd(8)
   Main PID: 4347 (ntpd)
      Tasks: 2 (limit: 153192)
     Memory: 2.0M
        CPU: 66ms
     CGroup: /system.slice/ntp.service
             └─4347 /usr/sbin/ntpd -p /var/run/ntpd.pid -c /etc/ntp.conf -u 114:119

Sep 15 11:17:58 H4G0 ntpd[4347]: Listen normally on 72 veth3bf83ae5 [fe80::d8cb:ff:fe47:b730%27]:123
Sep 15 11:17:58 H4G0 ntpd[4347]: Listen normally on 73 vethbbb8eb29 [fe80::582b:83ff:fed5:7a57%28]:123
Sep 15 11:17:58 H4G0 ntpd[4347]: new interface(s) found: waking up resolver
Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 74 vethdf554126 [fe80::9c66:97ff:fe4b:aaa1%29]:123
Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 75 vethaf608fe6 [fe80::6c42:f7ff:fe40:5d82%30]:123
Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 76 veth957a103c [fe80::f474:f6ff:fee7:b11%31]:123
Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 77 vetha3a22b25 [fe80::789f:ceff:fe0d:b849%32]:123
Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 78 veth794e49d9 [fe80::f453:deff:fe39:69eb%33]:123
Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 79 vethbd98b587 [fe80::c89:52ff:fe33:5718%34]:123
Sep 15 11:18:05 H4G0 ntpd[4347]: new interface(s) found: waking up resolver

I believe my RTC was in Local time (probably thanks to Windows running on that hardware before). (Also see [SOLVED NTP Issue](https://www.truenas.com/community/threads/ntp-issue.108638/)) Adjusted the times, using ```bash sudo date -s "2 hours ago" sudo hwclock --systohc --utc ``` <details> <summary>NTP now manages to stay online:</summary> <pre><code>admin@H4G0[~]$ sudo systemctl status ntp ● ntp.service - Network Time Service Loaded: loaded (/lib/systemd/system/ntp.service; enabled; preset: enabled) Active: active (running) since Fri 2023-09-15 10:57:47 CEST; 8min ago Docs: man:ntpd(8) Process: 3129914 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status=0/SUCCESS) Main PID: 3129919 (ntpd) Tasks: 2 (limit: 153192) Memory: 1.6M CPU: 121ms CGroup: /system.slice/ntp.service └─3129919 /usr/sbin/ntpd -p /var/run/ntpd.pid -c /etc/ntp.conf -u 114:119 Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 86 veth22709943 [fe80::c8fd:49ff:fe61:a472%43]:123 Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 87 veth90ef17b1 [fe80::2c0c:3fff:fe67:791c%44]:123 Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 88 vethcde7e1d1 [fe80::d45e:5fff:fe82:d744%45]:123 Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 89 vethf0a693fe [fe80::18d3:74ff:fe52:2d02%46]:123 Sep 15 10:57:47 H4G0 ntpd[3129919]: Listen normally on 90 vethcbae1d98 [fe80::e80f:5fff:fe94:c6f5%47]:123 Sep 15 10:57:47 H4G0 ntpd[3129919]: Listening on routing socket on fd #107 for interface updates Sep 15 10:57:47 H4G0 ntpd[3129919]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Sep 15 10:57:47 H4G0 ntpd[3129919]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Sep 15 10:57:47 H4G0 systemd[1]: Started ntp.service - Network Time Service. Sep 15 11:02:51 H4G0 ntpd[3129919]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized</code></pre> </details> <details> <summary>Unsynchronized clock is fixed by a simple reboot:</summary> <pre><code>admin@H4G0[~]$ sudo systemctl status ntp ● ntp.service - Network Time Service Loaded: loaded (/lib/systemd/system/ntp.service; enabled; preset: enabled) Active: active (running) since Fri 2023-09-15 11:16:42 CEST; 1min 34s ago Docs: man:ntpd(8) Main PID: 4347 (ntpd) Tasks: 2 (limit: 153192) Memory: 2.0M CPU: 66ms CGroup: /system.slice/ntp.service └─4347 /usr/sbin/ntpd -p /var/run/ntpd.pid -c /etc/ntp.conf -u 114:119 Sep 15 11:17:58 H4G0 ntpd[4347]: Listen normally on 72 veth3bf83ae5 [fe80::d8cb:ff:fe47:b730%27]:123 Sep 15 11:17:58 H4G0 ntpd[4347]: Listen normally on 73 vethbbb8eb29 [fe80::582b:83ff:fed5:7a57%28]:123 Sep 15 11:17:58 H4G0 ntpd[4347]: new interface(s) found: waking up resolver Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 74 vethdf554126 [fe80::9c66:97ff:fe4b:aaa1%29]:123 Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 75 vethaf608fe6 [fe80::6c42:f7ff:fe40:5d82%30]:123 Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 76 veth957a103c [fe80::f474:f6ff:fee7:b11%31]:123 Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 77 vetha3a22b25 [fe80::789f:ceff:fe0d:b849%32]:123 Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 78 veth794e49d9 [fe80::f453:deff:fe39:69eb%33]:123 Sep 15 11:18:05 H4G0 ntpd[4347]: Listen normally on 79 vethbd98b587 [fe80::c89:52ff:fe33:5718%34]:123 Sep 15 11:18:05 H4G0 ntpd[4347]: new interface(s) found: waking up resolver</code></pre> </details>
Author
Owner

Nice, things are out of order now.

Nice, things are out of order now.
tdpeuter 2023-09-15 11:45:06 +02:00
  • closed this issue
  • added the
    bug
    label
tdpeuter changed title from Wrong timezone in apps and shell to Wrong timezone in apps and shell TrueNAS SCALE 2023-09-15 12:01:15 +02:00
Author
Owner
Do I have to check the BIOS? [Synchronizing System and SCALE Time](https://www.truenas.com/docs/scale/scaletutorials/dashboard/scaletimesync/) [Truenas Scale's Date and Time Issues](https://docs.xstar97thenoob.com/docs/platforms/scale/networking/scale-date-time/)
tdpeuter self-assigned this 2023-09-15 12:04:44 +02:00
Author
Owner

Output of timedatectl:

admin@H4G0[~]$ timedatectl
               Local time: Fri 2023-09-15 12:13:58 CEST
           Universal time: Fri 2023-09-15 10:13:58 UTC
                 RTC time: Fri 2023-09-15 10:13:59
                Time zone: Europe/Brussels (CEST, +0200)
System clock synchronized: no
              NTP service: n/a
          RTC in local TZ: no
Compared to a server that is known the function:
root@hugo[~]# timedatectl
               Local time: Fri 2023-09-15 10:18:21 CEST
           Universal time: Fri 2023-09-15 08:18:21 UTC
                 RTC time: Fri 2023-09-15 08:18:21
                Time zone: Europe/Brussels (CEST, +0200)
System clock synchronized: yes
              NTP service: n/a
          RTC in local TZ: no
Output of `timedatectl`: ``` admin@H4G0[~]$ timedatectl Local time: Fri 2023-09-15 12:13:58 CEST Universal time: Fri 2023-09-15 10:13:58 UTC RTC time: Fri 2023-09-15 10:13:59 Time zone: Europe/Brussels (CEST, +0200) System clock synchronized: no NTP service: n/a RTC in local TZ: no ``` <details> <summary>Compared to a server that is known the function:</summary> <pre><code>root@hugo[~]# timedatectl Local time: Fri 2023-09-15 10:18:21 CEST Universal time: Fri 2023-09-15 08:18:21 UTC RTC time: Fri 2023-09-15 08:18:21 Time zone: Europe/Brussels (CEST, +0200) System clock synchronized: yes NTP service: n/a RTC in local TZ: no</code></pre> </details>
Author
Owner

Something might be up with ntp...

n@H4G0[~]$ sudo systemctl status ntp
× ntp.service - Network Time Service
     Loaded: loaded (/lib/systemd/system/ntp.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Fri 2023-09-15 12:37:06 CEST; 82ms ago
   Duration: 6.913s
       Docs: man:ntpd(8)
    Process: 2904510 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status=0/SUCCESS)
   Main PID: 2904515 (code=exited, status=255/EXCEPTION)
        CPU: 59ms

Sep 15 12:36:59 H4G0 ntpd[2904515]: Listen normally on 87 veth90ef17b1 [fe80::2c0c:3fff:fe67:791c%44]:123
Sep 15 12:36:59 H4G0 ntpd[2904515]: Listen normally on 88 vethcde7e1d1 [fe80::d45e:5fff:fe82:d744%45]:123
Sep 15 12:36:59 H4G0 ntpd[2904515]: Listen normally on 89 vethf0a693fe [fe80::18d3:74ff:fe52:2d02%46]:123
Sep 15 12:36:59 H4G0 ntpd[2904515]: Listen normally on 90 vethcbae1d98 [fe80::e80f:5fff:fe94:c6f5%47]:123
Sep 15 12:36:59 H4G0 ntpd[2904515]: Listening on routing socket on fd #107 for interface updates
Sep 15 12:36:59 H4G0 ntpd[2904515]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Sep 15 12:36:59 H4G0 ntpd[2904515]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Sep 15 12:36:59 H4G0 systemd[1]: Started ntp.service - Network Time Service.
Sep 15 12:37:06 H4G0 systemd[1]: ntp.service: Main process exited, code=exited, status=255/EXCEPTION
Sep 15 12:37:06 H4G0 systemd[1]: ntp.service: Failed with result 'exit-code'.

Restarting the service does not help.

Something might be up with `ntp`... ``` n@H4G0[~]$ sudo systemctl status ntp × ntp.service - Network Time Service Loaded: loaded (/lib/systemd/system/ntp.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Fri 2023-09-15 12:37:06 CEST; 82ms ago Duration: 6.913s Docs: man:ntpd(8) Process: 2904510 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status=0/SUCCESS) Main PID: 2904515 (code=exited, status=255/EXCEPTION) CPU: 59ms Sep 15 12:36:59 H4G0 ntpd[2904515]: Listen normally on 87 veth90ef17b1 [fe80::2c0c:3fff:fe67:791c%44]:123 Sep 15 12:36:59 H4G0 ntpd[2904515]: Listen normally on 88 vethcde7e1d1 [fe80::d45e:5fff:fe82:d744%45]:123 Sep 15 12:36:59 H4G0 ntpd[2904515]: Listen normally on 89 vethf0a693fe [fe80::18d3:74ff:fe52:2d02%46]:123 Sep 15 12:36:59 H4G0 ntpd[2904515]: Listen normally on 90 vethcbae1d98 [fe80::e80f:5fff:fe94:c6f5%47]:123 Sep 15 12:36:59 H4G0 ntpd[2904515]: Listening on routing socket on fd #107 for interface updates Sep 15 12:36:59 H4G0 ntpd[2904515]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Sep 15 12:36:59 H4G0 ntpd[2904515]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Sep 15 12:36:59 H4G0 systemd[1]: Started ntp.service - Network Time Service. Sep 15 12:37:06 H4G0 systemd[1]: ntp.service: Main process exited, code=exited, status=255/EXCEPTION Sep 15 12:37:06 H4G0 systemd[1]: ntp.service: Failed with result 'exit-code'. ``` Restarting the service does not help.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Bos55/Hugo#24
No description provided.