What's new

ntpMerlin Chrony clients fail to syncronize

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Markfree

Regular Contributor
I've got 2 RT-AX86U routers that use ntpMerlin configured with Chrony.
In this installation, both routers are on different networks and configured as NTP servers.

Everytime I reboot any of them, the router time gets synchronized correctly, but Chrony stops responding to NTP requests.
When I check Chrony clients, I can't see any and all local NTP clients are unable to synchronize with the router.
Bash:
# chronyc clients
Hostname                      NTP   Drop Int IntL Last     Cmd   Drop Int  Last
===============================================================================

Checking Chrony configuration, I could not see anything odd.
Bash:
# grep -v "^[#!%;]" /opt/share/ntpmerlin.d/chrony.conf | grep .
pool pool.ntp.br iburst prefer trust minpoll 7 maxsources 2
cmdport 0
maxupdateskew 5
driftfile /opt/var/lib/chrony/drift
dumponexit
dumpdir /opt/var/lib/chrony
pidfile /opt/var/run/chrony/chronyd.pid
logdir /opt /var /log/
log measurements statistics tracking
allow 192.168.7.0/24
local stratum 10
ratelimit interval 3 burst 8
logchange 0.5
lock_all

Chrony itself has no logs (empty dir /opt/var /log /chrony/), but I can see an ntpd log file at /opt /var /log /ntp.log. It seems NTPd is started on boot for an initial syncronization.
The NTPd log usually shows some errors right after reboot.
Bash:
5 Mar 09:31:30 ntpd[3646]: ntpd 4.2.8p15@1.3728-o Wed Jul 27 16:41:18 UTC 2022 (1): Starting
5 Mar 09:31:30 ntpd[3646]: Command line: ntpd -c /opt/etc /ntp.conf -p /opt/var /run/ntpd.pid -f /opt /var /spool/ntp/ntp.drift -s /opt /var /spool/ntp -k /opt /etc/ntp -g -l /opt /var /log/ntp.log
5 Mar 09:31:30 ntpd[3646]: ----------------------------------------------------
5 Mar 09:31:30 ntpd[3646]: ntp-4 is maintained by Network Time Foundation,
5 Mar 09:31:30 ntpd[3646]: Inc. (NTF), a non-profit 501(c)(3) public-benefit
5 Mar 09:31:30 ntpd[3646]: corporation.  Support and training for ntp-4 are
5 Mar 09:31:30 ntpd[3646]: available at https://www.nwtime.org/support
5 Mar 09:31:30 ntpd[3646]: ----------------------------------------------------
5 Mar 09:31:30 ntpd[3656]: proto: precision = 0.260 usec (-22)
5 Mar 09:31:30 ntpd[3656]: authreadkeys: file '/opt /etc/ntp': No such file or directory
5 Mar 09:31:31 ntpd[3656]: line 15 column 31 syntax error, unexpected T_String, expecting T_EOC
5 Mar 09:31:31 ntpd[3656]: syntax error in /opt/etc/ntp.conf line 15, column 31
5 Mar 09:31:31 ntpd[3656]: basedate set to 2022-07-15
5 Mar 09:31:31 ntpd[3656]: gps base set to 2022-07-17 (week 2219)
(...)
5 Mar 09:31:31 ntpd[3656]: Listening on routing socket on fd #35 for interface updates
5 Mar 09:31:31 ntpd[3656]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
5 Mar 09:31:31 ntpd[3656]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
5 Mar 09:31:36 ntpd[3656]: error resolving pool pool.ntp.br: Temporary failure in name resolution (-3)
5 Mar 09:32:36 ntpd[3656]: Soliciting pool server 200.20.186.76
(...)
5 Mar 09:37:14 ntpd[3656]: Soliciting pool server 2001:12ff:0:7::197
5 Mar 09:37:45 ntpd[3656]: kernel reports TIME_ERROR: 0x40: Clock Unsynchronized
5 Mar 09:37:45 ntpd[3656]: frequency error 2220 PPM exceeds tolerance 500 PPM
5 Mar 09:38:20 ntpd[3656]: Soliciting pool server 2001:12f8:9:1::8

Looking at the messages file, I found some Chronyd logs.
Bash:
Mar  5 09:33:00 [hostname] chronyd[3661]: Could not open /opt /var /log//measurements.log : Permission denied
Mar  5 09:33:04 [hostname] chronyd[3661]: Could not open /opt /var /log/ /statistics.log : Permission denied
Mar  5 09:33:04 [hostname] chronyd[3661]: Selected source 200.160.0.8 (pool.ntp.br)
Mar  5 09:33:06 [hostname] chronyd[3661]: Selected source 200.20.186.76 (pool.ntp.br)
(...)
Mar  5 09:37:24 [hostname] chronyd[3661]: Can't synchronise: no majority
Mar  5 09:37:26 [hostname] chronyd[3661]: Selected source 200.160.0.8 (pool.ntp.br)
Mar  5 09:37:26 [hostname] chronyd[3661]: System clock wrong by 0.638665 seconds
Mar  5 09:37:26 [hostname] chronyd[3661]: Source 200.160.0.8 replaced with 200.160.7.186 (pool.ntp.br)
(...)

And it keeps repeating those "Selected source" and "Can't synchronise" messages.

Only when Chrony service is restarted that local clients are able to syncronize again.
Bash:
# /opt /etc /init.d /S77chronyd restart
Starting timeserverd...              done.


# chronyc clients
Hostname                      NTP   Drop Int IntL Last     Cmd   Drop Int  Last
===============================================================================
[client]                              1      0   -   -    70       0      0   -     -

Currently NTP boot watchdog script is enabled.

Any idea of what's going on?
 
Last edited:
Not sure about the actual syncronization, but your chrony.conf files logdir is incorrectly formatted. You have space between the directory names.
You have:
logdir /opt /var /log
it should be:
logdir /opt/var/log

Remove the spaces after /opt and /var, restart chrony and see if you can see messages in chrony logfile (in /opt/var/log)
 
Not sure about the actual syncronization, but your chrony.conf files logdir is incorrectly formatted. You have space between the directory names.
You have:
logdir /opt /var /log
it should be:
logdir /opt/var/log

Remove the spaces after /opt and /var, restart chrony and see if you can see messages in chrony logfile (in /opt/var/log)
@JGrana , sorry. I forgot to mention that, just for this forum text editor, I added spaces to all directory paths so it would allow my post.
Or else, it issues the following message:
Oops! We ran into some problems.
Oops! We ran into some problems. Please try again later. More error details may be in the browser console.
 
Oops, nevermind. ;-)
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top