ntp icon indicating copy to clipboard operation
ntp copied to clipboard

i/o timeout error and bogus values

Open mohdahmad17 opened this issue 4 years ago • 5 comments

The following is the output of a program querying the ntp servers 0.centos.pool.ntp.org and 1.centos.pool.ntp.org while sleeping for a few seconds between queries.

I've run into two kinds of errors

  1. Failed to reach NTP server: 1.centos.pool.ntp.org error: read udp 10.4.67.150:37627->171.66.97.126:123: i/o timeout. I've tried increasing the timeout to 10 seconds from the default of 5 but that hasn't helped. Please share any suggestions you might have.

  2. And the other is for invalid values Reached NTP server: 1.centos.pool.ntp.org offset: 3754691965.127657. Where the 3754691965.127657 is way higher than the expected offset.

I've been using the 0.3 release but have experienced the same errors in the 0.2 release.

Reached NTP server: 0.centos.pool.ntp.org offset: 19.631600
Failed to reach NTP server: 1.centos.pool.ntp.org error: read udp 10.4.67.150:57557->104.155.144.4:123: i/o timeout
Reached NTP server: 0.centos.pool.ntp.org offset: 19.626120
Reached NTP server: 1.centos.pool.ntp.org offset: 19.636507
Reached NTP server: 0.centos.pool.ntp.org offset: 19.631544
Failed to reach NTP server: 1.centos.pool.ntp.org error: read udp 10.4.67.150:38249->104.155.144.4:123: i/o timeout
Reached NTP server: 0.centos.pool.ntp.org offset: 19.626148
Failed to reach NTP server: 1.centos.pool.ntp.org error: read udp 10.4.67.150:34181->162.248.241.94:123: i/o timeout
Reached NTP server: 0.centos.pool.ntp.org offset: 19.631553
Reached NTP server: 1.centos.pool.ntp.org offset: 19.636571
Reached NTP server: 0.centos.pool.ntp.org offset: 19.633790
Reached NTP server: 1.centos.pool.ntp.org offset: 3754691965.127657
Reached NTP server: 0.centos.pool.ntp.org offset: 19.635017
Reached NTP server: 1.centos.pool.ntp.org offset: 19.626531
Reached NTP server: 0.centos.pool.ntp.org offset: 19.626131
Reached NTP server: 1.centos.pool.ntp.org offset: 19.634028
Reached NTP server: 0.centos.pool.ntp.org offset: 19.631843
Failure count: 6 bogus values: 4

mohdahmad17 avatar Aug 28 '20 23:08 mohdahmad17

I tried increasing the timeout further to 30 seconds and that didn't help either. I noticed that the queries that don't timeout return very quickly and increasing the timeout hasn't helped reduce the queries that timeout.

mohdahmad17 avatar Aug 28 '20 23:08 mohdahmad17

After using the validate function (2) is gone. One the timeout errors remain.

mohdahmad17 avatar Aug 29 '20 00:08 mohdahmad17

I'm unable to reproduce either of the issues you discovered using those NTP server addresses. Can you post a sample program that reproduces your issue?

beevik avatar Sep 12 '20 02:09 beevik

I frequently get errors like this. I've added ntp query to my server monitoring (doing every 5 minutes), running on ten-ish machines: https://github.com/julian7/sensu-base-checks/blob/master/cmd/sensu-base-checks/time.go (the code since updated, but released code still doesn't have the loop mentioned later)

Every now and then I'm receiving a random timeout.

I just checked ntpdate.c and it looks like it probes and adds all the items the DNS query responds to the servers list, and it does query all of them.

Now I'm looping through all the IPs I'm receiving from net.LookupIP, until I get a valid answer. Better than querying only one, but it doesn't do triangulation either ;)

julian7 avatar Dec 25 '20 12:12 julian7

I know this issue is a bit old but i am encountering the same issue at the moment in my application.

I found out that the teimout mostly occured during excessive ntp requests. Multiple requests per second but it also occured during some single requests every hour.

Could it be that the ntp Server we are quering have issues?

JoahTheron avatar May 06 '21 09:05 JoahTheron

Hello, I was having a similar issue to this. I fixed it by removing the limited options in my ntp.conf on the line with restrict -4 default.... I believe this option would limit the rate of request and cause issue in certain cases. Don't forget to restart the service once you make that modification.

ncareau avatar Nov 18 '22 03:11 ncareau