Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with NTP Server Synchronization - Clock Unsynchronized #18085

Open
Purnimayeggina opened this issue Feb 12, 2024 · 3 comments
Open

Issue with NTP Server Synchronization - Clock Unsynchronized #18085

Purnimayeggina opened this issue Feb 12, 2024 · 3 comments
Labels
Help Wanted 🆘 Triaged this issue has been triaged

Comments

@Purnimayeggina
Copy link

Purnimayeggina commented Feb 12, 2024

Issue Description:
Our NTP configuration is based on the guidelines provided in the SONiC documentation https://github.com/sonic-net/SONiC/blob/master/doc/ntp/ntp-design.md
Facing issue in synchronizing the NTP server with the client on our system. This problem was identified when reviewing the NTP logs, which indicated a time error, specifically stating that the clock is unsynchronized.

Output of show ntp:
image

NTP Status Details:
Output of ntpq -p server ip_address
image

command used to generate the NTP logs:
sudo journalctl -u ntp

Logs:

Jun 19 01:40:35 sonic ntpd[12168]: proto: precision = 0.098 usec (-23)
Jun 19 01:40:35 sonic ntpd[12168]: basedate set to 2019-08-28
Jun 19 01:40:35 sonic ntpd[12168]: gps base set to 2019-09-01 (week 2069)
Jun 19 01:40:35 sonic ntpd[12168]: restrict 0.0.0.0: KOD does nothing without LIMITED
Jun 19 01:40:35 sonic ntpd[12168]: Listen normally on 0 lo 127.0.0.1:123
Jun 19 01:40:35 sonic ntpd[12168]: Listen normally on 1 eth0 172.30.25.103:123
Jun 19 01:40:35 sonic ntpd[12168]: Listening on routing socket on fd #18 for interface updates
Jun 19 01:40:35 sonic ntpd[12168]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Jun 19 01:40:35 sonic ntpd[12168]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Jun 19 01:40:35 sonic ntp-systemd-wrapper[12162]: Starting NTP server in default-vrf: ntpd
Jun 19 01:40:35 sonic systemd[1]: Started Network Time Service.

Additional Information:

All necessary services (ntp, hostcfgd, ntp-config) have been confirmed to be running.
The server ip address is reachable via ping.

Expected Outcome:

Successful synchronization with the configured NTP server.

I am seeking community assistance to identify any potential misconfigurations or issues that may be causing the problem.

@Purnimayeggina Purnimayeggina changed the title Unable to Sync NTP with Server IP Address Issue with NTP Server Synchronization - Clock Unsynchronized Feb 13, 2024
@gechiang gechiang added Help Wanted 🆘 Triaged this issue has been triaged labels Feb 14, 2024
@gechiang
Copy link
Collaborator

Seeking help from community who may be familiar with NTPO server config to provide recommendations..

@brholmes1
Copy link
Contributor

I haven't been able to fully dig through the issue, but it may be related to how /etc/ntp.conf is being generated. The switch I am testing on does not have a management interface (eth0) and even after adding Loopback0 with an IP it does not work as described in the NTP template.

As a workaround, I was able to manually update the source interface in the config. That seems to do the trick and allows NTP to sync.

cat /etc/sonic/config_db.json | jq .NTP
{
  "global": {
    "admin_state": "enabled",
    "authentication": "disabled",
    "dhcp": "enabled",
    "server_role": "disabled",
    "src_intf": "Vlan1000",
    "vrf": "default"
  }
}

@anamehra
Copy link
Contributor

anamehra commented May 7, 2024

On our chassis, when I looked at /etc/ntpsec/ntp.conf, the server config was missing. Looks like based on the sonic-mgmgt generated minigraph, some if checks in ntp.conf.j2 did not satisfy the addition of server config.
The changes in PR #18736 helped fix this issue for us.
From sonic-mgmt, I am trying to figure out how we can set the config like iburst which is required to speed up clock sync. Without that, it takes around 1.5 to 2 mins on our chassis to sync the clock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted 🆘 Triaged this issue has been triaged
Projects
None yet
Development

No branches or pull requests

4 participants