OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: hushcoden on March 11, 2021, 10:57:22 am

Title: NTP error: clock unsynchronized
Post by: hushcoden on March 11, 2021, 10:57:22 am
Does anybody have got the same error message? Rebooting the router didn't make any difference.

Code: [Select]
2021-03-10T22:49:58 ntpd[99842] kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
2021-03-10T22:49:58 ntpd[99842] kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
2021-03-10T22:49:58 ntpd[99842] Listening on routing socket on fd #26 for interface updates
2021-03-10T22:49:58 ntpd[99842] Listen normally on 5 pppoe0 51.x.x.x:123
2021-03-10T22:49:58 ntpd[99842] Listen normally on 4 pppoe0 [fe80::20d:b9ff:fe55:a4e8%8]:123
2021-03-10T22:49:58 ntpd[99842] Listen normally on 3 lo0 127.0.0.1:123
2021-03-10T22:49:58 ntpd[99842] Listen normally on 2 lo0 [::1]:123
2021-03-10T22:49:58 ntpd[99842] Listen and drop on 1 v4wildcard 0.0.0.0:123
2021-03-10T22:49:58 ntpd[99842] Listen and drop on 0 v6wildcard [::]:123
2021-03-10T22:49:58 ntpd[99842] restrict: 'monitor' cannot be disabled while 'limited' is enabled
2021-03-10T22:49:58 ntpd[99842] gps base set to 2021-01-17 (week 2141)
2021-03-10T22:49:58 ntpd[99842] basedate set to 2021-01-13
2021-03-10T22:49:58 ntpd[99842] proto: precision = 0.418 usec (-21)
2021-03-10T22:49:58 ntpd[78182] ----------------------------------------------------
2021-03-10T22:49:58 ntpd[78182] available at https://www.nwtime.org/support
2021-03-10T22:49:58 ntpd[78182] corporation. Support and training for ntp-4 are
2021-03-10T22:49:58 ntpd[78182] Inc. (NTF), a non-profit 501(c)(3) public-benefit
2021-03-10T22:49:58 ntpd[78182] ntp-4 is maintained by Network Time Foundation,

I'm on the latest 21.1.3

And is there an easy fix for this?

Tia.
Title: Re: NTP error: clock unsynchronized
Post by: Ricardo on March 11, 2021, 01:01:30 pm
I had some similar NTP clock unsyncd issue some months ago (it was on opnsense version 20.7.5), that got resolved automagically after a couple of days. I still dont know what was the problem, neither others had any clue.

https://forum.opnsense.org/index.php?topic=20196.0
Title: Re: NTP error: clock unsynchronized
Post by: qinohe on March 11, 2021, 07:10:15 pm
Message: '0x2041', The clock was not synchronized, yet.
Run 'ntptime'
You see: 'status 0x2001 (PLL,NANO)'?
All is fine, the clock is synchronized.
Title: Re: NTP error: clock unsynchronized
Post by: hushcoden on March 11, 2021, 07:56:46 pm
Message: '0x2041', The clock was not synchronized, yet.
Run 'ntptime'
You see: 'status 0x2001 (PLL,NANO)'?
All is fine, the clock is synchronized.
Ah, so it works  :P
Code: [Select]
getto@hush:~ % ntptime
ntp_gettime() returns code 0 (OK)
  time e3f4e609.555ed070  Thu, Mar 11 2021 18:55:05.333, (.333478690),
  maximum error 500031 us, estimated error 589 us, TAI offset 0
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset 2337.078 us, frequency 35.980 ppm, interval 4 s,
  maximum error 500031 us, estimated error 589 us,
  status 0x2001 (PLL,NANO),
  time constant 8, precision 0.001 us, tolerance 496 ppm,
  pps frequency 30.434 ppm, stability 0.000 ppm, jitter 0.000 us,
  intervals 0, jitter exceeded 0, stability exceeded 0, errors 0.
getto@hush:~ %
Title: Re: NTP error: clock unsynchronized
Post by: qinohe on March 11, 2021, 08:47:51 pm
Yes, it just looks okay.
First message:
Code: [Select]
PLL         0x0001  /* enable PLL updates (rw) */
UNSYNC      0x0040  /* clock unsynchronized (rw) */
NANO        0x2000  /* resolution (0 = us, 1 = ns) (ro) */

The status returned by ntptime:
Code: [Select]
PLL         0x0001  /* enable PLL updates (rw) */
NANO        0x2000  /* resolution (0 = us, 1 = ns) (ro) */
If your curious where ive got my info from, I'm a nitwit you know  :P
ftp://ftp.ripe.net/test-traffic/ROOT/libDelay/Delay.h

edit: forgot to paste the 'NANO' in 'first message ;)

And for completion here's OPNsense source file (±210):
https://github.com/opnsense/src/blob/master/contrib/ntp/kernel/sys/timex.h