What's new

Endless NTP Sync Failure

  • 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!

Zonkd

Very Senior Member
Edit: SOLVED by @rromeroa go Read here #27

I'm trying to solve a problem where my AC68U (running Skynet, Diversion and DNSCrypt) gets stuck never able to synchronise with NTP server or deliver internet access. And I have determined it only happens if I boot up the AC68U before the bridged modem has finished booting and established a solid line sync with the ISP. The trouble is that my UPS automatically powers them on simultaineusly.

Looking at the syslogs, I can see it's not likely to be Skynet because @Adamm made sure it doesn't start up until NTP sync was successful. It's not likely to be Diversion causing the block because I tried rebooting with Diversion disabled and NTP still failed. Therefore by process of elimination DNSCrypt is the likely culprit, maybe loading too soon. Can I delay it until NTP sync was successful? Can anyone suggest a solution?

Edit: the SNB forum says I've been blocked when I try to post a snippet of my syslog, so I dunno how to share it with you guys for analysis.
 
Last edited:
You could try fake-hwclock and see if that helps
Code:
opkg install fake-hwclock
 
You could try fake-hwclock and see if that helps
Code:
opkg install fake-hwclock

What should I look for in the syslogs to determine whether the hardware clock is a factor in this problem? I'd rather not add another moving part to this machine until I work out whats going on. @RMerlin do you have any idea?
 
Have you set timezone in DNScrypt?
 
Have you set timezone in DNScrypt?
Yes I have. Process of elimination suggests it's DNSCrypt, and to my mind the simplest solution would be adjusting the script so it doesn't launch until NTP sync was successful. Skynet does it, so why not DNSCrypt? Heck, maybe I should just set a condition that no third party packages start until NTP synced... That would include Diversion too.
 
Last edited:
Ok @thelonelycoder : here is a pastebin link to my syslog in full, from moment the router boots - simultaneously with bridged modem I might add - and you can see when the router boots quicker than the modem can boot and get a solid line sync to the ISP, the router gets a WAN IP but attempts to NTP sync endlessly and the internet is inaccessible. Eventually I get the Skynet alert telling me it didn't NTP sync within 5 minutes (I didn't wait long enough for it to appear in that syslog) and I'm left with no other option but to reboot the router manually. Only then will my problem be solved.

https://pastebin.com/raw/jyen9se3

Note: Following my Diversion log file, I can also see

Code:
 Diversion 4.0.2                  by thelonelycoder

 RT-AC68U (armv7l) FW-384.7 @ 192.168.11.1

 438,734  blocked domains  8  hosts file(s) in use
 14,202 t  14,202 w  2,050 n ads since Oct 13 05:20
____________________________________________________

 d   Diversion Lite       enabled
 c   communication        DivUn stats backup FWun

 a   ad-blocking          to IP 0.0.0.0
 l   logging              /opt/var/log/dnsmasq.log

 ep  entware packages

 b   blocking file        Custom+ Mon @ 12:00
 el  edit lists

 f   follow dnsmasq.log

 e   exit Diversion                 more options  o
____________________________________________________

 What do you want to do?  f
____________________________________________________


  i  This follows the Dnsmasq log file (tail -f)

 Continue? [1=Yes e=Exit] 1

  ✖  Dnsmasq entry detected,
     redirecting hosts to 127.0.0.1
  !  Be aware that log file entries with '127.0.0.1'
     are from another script, not Diversion

  !  Press [Enter] to acknowledge


  i  Press Ctrl-C to exit

02:43:27 dnsmasq[765]: query[A] pool.ntp.org from 192.168.1.1
02:43:27 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
02:43:30 dnsmasq[765]: query[A] pool.ntp.org from 127.0.0.1
02:43:30 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
02:43:32 dnsmasq[765]: query[A] pool.ntp.org from 192.168.1.1
02:43:32 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
02:43:32 dnsmasq[765]: query[A] pool.ntp.org from 192.168.1.1
02:43:32 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
02:43:35 dnsmasq[765]: query[A] pool.ntp.org from 127.0.0.1
02:43:35 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
 
Ok @thelonelycoder : here is a pastebin link to my syslog in full, from moment the router boots - simultaneously with bridged modem I might add - and you can see when the router boots quicker than the modem can boot and get a solid line sync to the ISP, the router gets a WAN IP but attempts to NTP sync endlessly and the internet is inaccessible. Eventually I get the Skynet alert telling me it didn't NTP sync within 5 minutes (I didn't wait long enough for it to appear in that syslog) and I'm left with no other option but to reboot the router manually. Only then will my problem be solved.

https://pastebin.com/raw/jyen9se3

Note: Following my Diversion log file, I can also see

Code:
 Diversion 4.0.2                  by thelonelycoder

 RT-AC68U (armv7l) FW-384.7 @ 192.168.11.1

 438,734  blocked domains  8  hosts file(s) in use
 14,202 t  14,202 w  2,050 n ads since Oct 13 05:20
____________________________________________________

 d   Diversion Lite       enabled
 c   communication        DivUn stats backup FWun

 a   ad-blocking          to IP 0.0.0.0
 l   logging              /opt/var/log/dnsmasq.log

 ep  entware packages

 b   blocking file        Custom+ Mon @ 12:00
 el  edit lists

 f   follow dnsmasq.log

 e   exit Diversion                 more options  o
____________________________________________________

 What do you want to do?  f
____________________________________________________


  i  This follows the Dnsmasq log file (tail -f)

 Continue? [1=Yes e=Exit] 1

  ✖  Dnsmasq entry detected,
     redirecting hosts to 127.0.0.1
  !  Be aware that log file entries with '127.0.0.1'
     are from another script, not Diversion

  !  Press [Enter] to acknowledge


  i  Press Ctrl-C to exit

02:43:27 dnsmasq[765]: query[A] pool.ntp.org from 192.168.1.1
02:43:27 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
02:43:30 dnsmasq[765]: query[A] pool.ntp.org from 127.0.0.1
02:43:30 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
02:43:32 dnsmasq[765]: query[A] pool.ntp.org from 192.168.1.1
02:43:32 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
02:43:32 dnsmasq[765]: query[A] pool.ntp.org from 192.168.1.1
02:43:32 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
02:43:35 dnsmasq[765]: query[A] pool.ntp.org from 127.0.0.1
02:43:35 dnsmasq[765]: forwarded pool.ntp.org to 127.0.0.1
Dnscrypt is not up, hence it cannot resolve the domain through it (forwarded pool.ntp.org to 127.0.0.1)
Code:
Oct 13 12:25:53 dnscrypt-proxy[129]: Timeout while waiting for network connectivity
Oct 13 12:25:53 dnscrypt-proxy[129]: Unable to use source [public-resolvers]: [dial udp 1.1.1.1:53: connect: network is unreachable]
Oct 13 12:25:53 dnscrypt-proxy[129]: No servers configured
 
There is an NTP script somewhere on the fourm.
 
There is an NTP script somewhere on the fourm.

Wait so it’s not possible to simply solve this by preventing DNSCrypt startup scripts from running UNTIL AFTER router has performed its dns lookup of pool.ntp.org and finished sync NTP. Skynet does it by default, why isn’t this the ideal solution? Is the fake hardware clock really the best fix??
 
Wait so it’s not possible to simply solve this by preventing DNSCrypt startup scripts from running UNTIL AFTER router has performed its dns lookup of pool.ntp.org and finished sync NTP. Skynet does it by default, why isn’t this the ideal solution? Is the fake hardware clock really the best fix??
It's a suggestion, it could be possible to delay the script I hope can't remember the commands in sure I've read it somewhere, some one else might be able to help with that.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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