Strange NTP sync issue

I have two development devices here in my office and both have a strange NTP issue:

May 18 17:25:33 colibri-imx6 connmand[295]: ntp: adjust (jump): +3598.389756 sec
May 18 17:25:34 colibri-imx6 connmand[295]: ntp: adjust (jump): +3598.390291 sec
May 18 17:25:35 colibri-imx6 connmand[295]: ntp: adjust (jump): +3598.395446 sec
May 18 17:25:36 colibri-imx6 connmand[295]: ntp: adjust (jump): +3598.389542 sec

This occurs every second.

A reboot doesn’t fix the issue:

May 18 18:36:04 colibri-imx6 connmand[301]: ntp: adjust (slew): -0.001862 sec
May 18 18:36:05 colibri-imx6 connmand[301]: ntp: adjust (slew): +0.007051 sec
May 18 18:36:06 colibri-imx6 connmand[301]: ntp: adjust (slew): -0.001666 sec
May 18 18:36:07 colibri-imx6 connmand[301]: ntp: adjust (slew): +0.006501 sec
May 18 18:36:08 colibri-imx6 connmand[301]: ntp: adjust (slew): -0.001426 sec
May 18 18:36:09 colibri-imx6 connmand[301]: ntp: adjust (slew): -0.001642 sec
May 18 17:36:12 colibri-imx6 systemd-timesyncd[238]: Synchronized to time server 216.239.35.8:123 (time3.google.com).
May 18 17:36:12 colibri-imx6 connmand[301]: ntp: adjust (jump): +3598.390809 sec
May 18 17:36:13 colibri-imx6 connmand[301]: ntp: adjust (jump): +3598.386970 sec
May 18 17:36:14 colibri-imx6 connmand[301]: ntp: adjust (jump): +3598.396621 sec
May 18 17:36:15 colibri-imx6 connmand[301]: ntp: adjust (jump): +3598.396591 sec
May 18 17:36:16 colibri-imx6 connmand[301]: ntp: adjust (jump): +3598.393121 sec
May 18 17:36:17 colibri-imx6 connmand[301]: ntp: adjust (jump): +3598.395471 sec
May 18 17:36:18 colibri-imx6 connmand[301]: ntp: adjust (jump): +3598.393706 sec

Info:

root@colibri-imx6:~# cat /etc/timezone
Europe/Vienna
root@colibri-imx6:~# cat /etc/systemd/timesyncd.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See timesyncd.conf(5) for details.

[Time]
#NTP=
#FallbackNTP=time1.google.com time2.google.com time3.google.com time4.google.com
root@colibri-imx6:~# timedatectl
      Local time: Mon 2020-05-18 17:39:05 CEST
  Universal time: Mon 2020-05-18 15:39:05 UTC
        RTC time: Mon 2020-05-18 16:39:05
       Time zone: Europe/Vienna (CEST, +0200)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no
root@colibri-imx6:~#

Any idea on how to fix this issue?

Hi @cheesi

Thanks for writing to the Toradex Community!

I don’t have any experience with ntp but it seems that the time on SoM is out of sync with the NTP Server. Could you try to manually synchronize the time as explained here?

Thanks and best regards,
Jaski

Hi @jaski.tx

I already tried disabling NTP, manually setting the time and enabling NTP againg. Still the same behavior.

I don’t really think, that the time is out of sync, as the time itself is correct, it just jumps one hour into the future for a friction of a second and is then correct again.

What I find really interesting: there are +3598 seconds logs, but who setting it back to correct time, as there are not -3598 logs?

(and sorry, now I also see, this would have been information, that should have been included in the original post)

Hi

I guess this post explains the behavior. connman somehow gets configured to act as an NTP client along with systemd-timesyncd.

And from this one I guess that has to do with your DHCP server providing a NTP server in its DHCP answer or the default router acts also as an NTP server.

Does disabling connman’s NTP client functionality as suggested in the posts help?

Max

P.S. I’d guess that connman doesn’t agree with systemd-timesyncd on the timezone / daylight saving which makes them constantly setting a different time or the NTP server connman contacts provide a UTC time which is wrong by 3598 seconds.

Hi @max.tx !

Thanks for your answers, yes it seems like you are right.
connmanctl shows my crappy ISP provided router as Timeserver:

connmanctl> services ethernet_00142d4f3e94_cable
/net/connman/service/ethernet_00142d4f3e94_cable
...
  Timeservers = [ 192.168.0.1 ]
  Timeservers.Configuration = [  ]
...

And I guess the dhcp client is automatically querying the Option 42 for NTP by default, as I executed ipconfig /renew on my windows PC and sniffed the network traffic with wireshark and the DHCP ACK didn’t include that option.

Hi @cheesi

Is the issue solved now?

Best regards,
Jaski