macOS NTP problems in Big Sur #Timesync #macOS


Steve Golson
 

Hi all,

If you are running Big Sur on Mac, check your time. Try https://time.is

There seems to be a defect in Apple's "timed" daemon, which is responsible for maintaining accurate time in Big Sur. I saw an offset of 2s, but others have reported tens of seconds.

See these discussions:

https://apple.stackexchange.com/questions/414088/macos-timed-wont-keep-accurate-time

https://forums.macrumors.com/threads/time-synchronization-command-line-in-macos-big-sur.2279396/

According to those links, Apple is aware of this bug. So hopefully they will have a fix in a future update.

It appears that something confuses the state of "timed" and as a result it successfully tracks UTC, but with an offset.

If your time is accurate, then don't do anything. But if your time is messed up, here is a workaround.

I don't know which of these steps are really necessary, but it's worked for me... I'm running macOS 11.2.3 on both Intel and M1.

1. Open System Preferences / Date & Time / Date & Time

2. "Set date and time automatically" should be checked, which indicates you've been relying on the flawed "timed" daemon.

3. Click the lock to make changes

4. Change the host to the default "time.apple.com."

5. Uncheck the box

6. Close the System Preferences window

7. Now open Terminal and type

sudo sntp -sS time.apple.com

sudo will prompt you to enter your password.

This command will force your computer's time to the correct value. You should see something like

sntp 4.2.8p15@1.3728-o Thu Jun 25 23:19:02 UTC 2020 (1)
2021-03-28 14:17:41.837540 (+0500) +2.18836 +/- 1.459743 time.apple.com 17.253.4.253 s1 no-leap

What's being reported here:

version info about sntp command: sntp 4.2.8p15@1.3728-o Thu Jun 25 23:19:02 UTC 2020 (1)
current time on your computer: 2021-03-28 14:17:41.837540 (+0500)
estimated error in the time on your computer: +2.18836 +/- 1.459743
info about the time server you have selected: time.apple.com 17.253.4.253 s1 no-leap

You might get warning messages like this:

kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory
kq_init: detected broken kqueue; not using.: No such file or directory

That's nothing to worry about.

8. Confirm that your time is now correct, by typing in Terminal

sntp time.apple.com

and you should see something like

sntp 4.2.8p15@1.3728-o Thu Jun 25 23:19:02 UTC 2020 (1)
2021-03-28 14:18:22.880936 (+0500) +0.00023 +/- 0.000977 time.apple.com 17.253.4.253 s1 no-leap

Notice the error is now close to zero. You can run this command whenever you want, to check your clock's accuracy.

9. Restart your computer

10. Let it run for an hour

11. Open System Preferences / Date & Time / Date & Time

12. Click the lock to make changes

13. Check the box for "Set date and time automatically"

14. Close the System Preferences window

Now, "timed" should be running smoothly. Don't make any more changes to the Date & Time preferences! I think that may screw up the daemon.

You can confirm your accuracy by running "sntp time.apple.com" in a Terminal window.


All this time, us Mac guys have felt soooo superior to the poor Windows users trying to keep their clocks in sync! and now we get hosed :-)

73,
Steve
W1SEG


Steve Golson
 

On 3/29/21 9:11 AM, Steve Golson wrote:
Hi all,
If you are running Big Sur on Mac, check your time. Try https://time.is
There seems to be a defect in Apple's "timed" daemon, which is responsible for maintaining accurate time in Big Sur. I saw an offset of 2s, but others have reported tens of seconds.
I just realized I'm running a non-standard version of sntp. So this command:

7. Now open Terminal and type
  sudo sntp -sS time.apple.com
may not work for you.

I'm continuing to investigate, and I'll report back what I find.

73,
Steve
W1SEG


Ken Cox
 

I have an Imac and Macbook pro running big sur with no time issues. Time.is reports exact time +0.0003 seconds


Steve Golson
 

On 3/29/21 10:29 AM, Ken Cox wrote:
I have an Imac and Macbook pro running big sur with no time issues. Time.is reports exact time +0.0003 seconds
Thanks for the report Ken.

Two questions:

1. what version of Big Sur?
2. which time server are you using? time.apple.com, or something else?

I think this problem may be triggered with usage of non-Apple NTP servers. But I'm still investigating.

73,
Steve
W1SEG


Bill Lederer
 

I've had mixed experiences with the built-in mac timekeeping.

So on the mac that matters, I went ahead and installed openntpd and all is fine.  For best time sync, I point to pool.ntp.org, but I also have a gps hockey puck set up with openntpd on an openbsd system, and point my other computers to that one as well.

(openbsd natively understands the sentences from the gps puck)

73,
w8lvn


Bill Somerville
 

On 29/03/2021 16:50, Bill Lederer wrote:
I've had mixed experiences with the built-in mac timekeeping.

So on the mac that matters, I went ahead and installed openntpd and all is fine.  For best time sync, I point to pool.ntp.org, but I also have a gps hockey puck set up with openntpd on an openbsd system, and point my other computers to that one as well.

(openbsd natively understands the sentences from the gps puck)

73,
w8lvn

Bill,

WADR the NMEA sentences from a GPS receiver will not give you accurate time synchronization, for that you need some sort of access to a PPS pin on the GPS chip if it has one. You are better off using ntpd with Internet NTP servers unless you have the appropriate hardware a drivers to synchronize to a PPS signal, the NMEA sentences are only good for assigning PPS triggered edges to the correct date and time to 1 second resolution.

73
Bill
G4WJS.


Bill Lederer
 

Bill:

Yes, i was not complete in my statement about sentences. OpenBSD has the proper drivers to get the time portion.

I also point to the internet servers as well, so there are lots of sources.

 ntpctl -s all
5/7 peers valid, 1/1 sensors valid, constraint offset 0s, clock synced, stratum 3

peer
   wt tl st  next  poll          offset       delay      jitter
10.0.0.156 missoula
    1 10  4 1322s 1557s         1.923ms     0.382ms     0.161ms
10.0.0.223 pendroy
    2  2  -  391s 3064s             ---- peer not valid ----
192.168.7.23 pendroy-wifi
    2  2  -  505s 3174s             ---- peer not valid ----
108.61.73.244 from pool us.pool.ntp.org
    1 10  2 1100s 1550s        -0.397ms    35.844ms     1.961ms
209.51.161.238 from pool us.pool.ntp.org
 *  1 10  2  783s 1480s         0.538ms    37.776ms     5.468ms
68.183.107.237 from pool us.pool.ntp.org
    1 10  2 1246s 1571s         0.629ms    43.521ms     5.435ms
199.101.100.221 from pool us.pool.ntp.org
    1 10  2 1156s 1444s         1.105ms    43.677ms     6.940ms

sensor
   wt gd st  next  poll          offset  correction
nmea0  GPS
    1  1  0    6s   15s       -44.588ms     0.000ms


It is giving priority to the internet servers as it is.

w8lvn

On Mon, Mar 29, 2021 at 11:22 AM Bill Somerville <g4wjs@...> wrote:
On 29/03/2021 16:50, Bill Lederer wrote:
I've had mixed experiences with the built-in mac timekeeping.

So on the mac that matters, I went ahead and installed openntpd and all is fine.  For best time sync, I point to pool.ntp.org, but I also have a gps hockey puck set up with openntpd on an openbsd system, and point my other computers to that one as well.

(openbsd natively understands the sentences from the gps puck)

73,
w8lvn

Bill,

WADR the NMEA sentences from a GPS receiver will not give you accurate time synchronization, for that you need some sort of access to a PPS pin on the GPS chip if it has one. You are better off using ntpd with Internet NTP servers unless you have the appropriate hardware a drivers to synchronize to a PPS signal, the NMEA sentences are only good for assigning PPS triggered edges to the correct date and time to 1 second resolution.

73
Bill
G4WJS.






--
--w8lvn--


Ken Cox
 

big sur ver 11.2.3 and time.apple.com


Steve Golson
 

On 3/29/21 9:11 AM, Steve Golson wrote:
Hi all,
If you are running Big Sur on Mac, check your time. Try https://time.is
There seems to be a defect in Apple's "timed" daemon, which is responsible for maintaining accurate time in Big Sur. I saw an offset of 2s, but others have reported tens of seconds.
See these discussions:
https://apple.stackexchange.com/questions/414088/macos-timed-wont-keep-accurate-time
https://forums.macrumors.com/threads/time-synchronization-command-line-in-macos-big-sur.2279396/
According to those links, Apple is aware of this bug. So hopefully they will have a fix in a future update.
It appears that something confuses the state of "timed" and as a result it successfully tracks UTC, but with an offset.
If your time is accurate, then don't do anything. But if your time is messed up, here is a workaround.
After further investigation, it seems that certain NTP servers cause Apple's "timed" to get confused. However the Apple server time.apple.com works fine.

So if you see a time offset with macOS Big Sur, try this:

1. Open System Preferences / Date & Time / Date & Time

2. "Set date and time automatically" should be checked, which indicates you've been relying on the flawed "timed" daemon.

3. Click the lock to make changes

4. Change the host to the default "time.apple.com."

5. Close the System Preferences window

Within a few hours, your computer should snap back to the correct time.

Hopefully Apple will have this fixed soon, and we can go back to using any NTP server.

73,
Steve
W1SEG


Steve Golson
 

This bug still exists in macOS Big Sur 11.3, released 26 April.

73,
Steve
W1SEG


Bill Lederer
 

I gave up on this and have installed OpenNTPD everywhere, and it works very nicely. I have it on MacOs X, Linux, and an OpenBSD box or two.

w8lvn

On Tue, Apr 27, 2021 at 5:25 PM Steve Golson <sgolson@...> wrote:
This bug still exists in macOS Big Sur 11.3, released 26 April.

73,
Steve
W1SEG





--
--w8lvn--


Steve Golson
 

This bug still exists in macOS Big Sur 11.5.1, released 26 July.

73,
Steve
W1SEG


Gary Rogers
 

I use chrony control for time sync on MacBook running Big Sur. It overrides the Apple time function.

On Jul 31, 2021, at 1:15 PM, Steve Golson <sgolson@trilobyte.com> wrote:

This bug still exists in macOS Big Sur 11.5.1, released 26 July.

73,
Steve
W1SEG



Gary Rogers
 

On Jul 31, 2021, at 2:32 PM, Gary Rogers via groups.io <cgaryrogers190@...> wrote:

I use chrony control for time sync on MacBook running Big Sur. It overrides the Apple time function.
On Jul 31, 2021, at 1:15 PM, Steve Golson <sgolson@...> wrote:

This bug still exists in macOS Big Sur 11.5.1, released 26 July.

73,
Steve
W1SEG







Steve Golson
 

On 7/31/21 6:50 PM, Gary Rogers wrote:
Website here:
https://chrony.tuxfamily.org/index.html <https://chrony.tuxfamily.org/index.html>

On Jul 31, 2021, at 2:32 PM, Gary Rogers via groups.io <cgaryrogers190=gmail.com@groups.io> wrote:

I use chrony control for time sync on MacBook running Big Sur. It overrides the Apple time function.
Thanks Gary.

It appears that Apple has no intention of fixing this bug (it's been reported to them). I think I'll be installing chrony on my Macs.

73,
Steve
W1SEG

On Jul 31, 2021, at 1:15 PM, Steve Golson <sgolson@trilobyte.com> wrote:

This bug still exists in macOS Big Sur 11.5.1, released 26 July.

73,
Steve
W1SEG