Sock_cb: ucs not in sync, skipping this server

The Masterserver can’t provide the time anymore.
How can I fix this?

Thanks a lot,
meg

meg@ucs:~$ sntp -d ucs
sntp 4.2.8p10@1.3728-o Sun Feb 25 21:22:25 UTC 2018 (1)
kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory
handle_lookup(ucs,0x2)
move_fd: estimated max descriptors: 32768, initial socket boundary: 16
sntp sendpkt: Sending packet to ucs:123 ...
Packet sent.
sock_cb: ucs.rent24.com ucs:123
sock_cb: Stratum unspecified, going to check for KOD (stratum: 0)
sock_cb: Packet refid: INIT
sock_cb: ucs not in sync, skipping this server
sock_cb: handle_pkt() returned -1

ggf noch relevant:

meg@ucs:~$ sudo ucr get timeserver
de.pool.ntp.org
meg@ucs:~$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 10.0.10.2       .INIT.          16 u    -   64    0    0.000    0.000   0.000
meg@ucs:~$ sntp -d 10.0.10.2
sntp 4.2.8p10@1.3728-o Sun Feb 25 21:22:25 UTC 2018 (1)
kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory
handle_lookup(10.0.10.2,0x2)
move_fd: estimated max descriptors: 32768, initial socket boundary: 16
sntp sendpkt: Sending packet to 10.0.10.2:123 ...
Packet sent.
10.0.10.2 no UCST response after 5 seconds

Hey,

10.0.10.2 is obviously not de.pool.ntp.org. Try:

  • ucr commit /etc/ntp.conf
  • systemctl restart ntp.service

Then run the following commands and post their output here, please:

  • grep '^server' /etc/ntp.conf
  • `systemctl status ntp.service
  • ntpq -p

Kind regards
mosu

File: /etc/ntp.conf

server de.pool.ntp.org
server 127.127.1.0
● ntp.service - LSB: Start NTP daemon
   Loaded: loaded (/etc/init.d/ntp; generated; vendor preset: enabled)
   Active: active (running) since Thu 2018-08-30 12:58:23 CEST; 7min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 9708 ExecStop=/etc/init.d/ntp stop (code=exited, status=0/SUCCESS)
  Process: 9719 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)
    Tasks: 2 (limit: 4915)
   Memory: 848.0K
      CPU: 43ms
   CGroup: /system.slice/ntp.service
           └─9732 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -c /run/ntp.conf.dhcp -u 117:125

Aug 30 12:58:23 ucs systemd[1]: Started LSB: Start NTP daemon.
Aug 30 12:58:23 ucs ntpd[9732]: proto: precision = 0.058 usec (-24)
Aug 30 12:58:23 ucs ntpd[9732]: MS-SNTP signd operations currently block ntpd degrading service to all clients.
Aug 30 12:58:23 ucs ntpd[9732]: Listen and drop on 0 v6wildcard [::]:123
Aug 30 12:58:23 ucs ntpd[9732]: Listen and drop on 1 v4wildcard 0.0.0.0:123
Aug 30 12:58:23 ucs ntpd[9732]: Listen normally on 2 lo 127.0.0.1:123
Aug 30 12:58:23 ucs ntpd[9732]: Listen normally on 3 eth0 10.0.10.76:123
Aug 30 12:58:23 ucs ntpd[9732]: Listen normally on 4 lo [::1]:123
Aug 30 12:58:23 ucs ntpd[9732]: Listen normally on 5 eth0 [fe80::20c:29ff:fe04:f375%2]:123
Aug 30 12:58:23 ucs ntpd[9732]: Listening on routing socket on fd #22 for interface updates
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 10.0.10.2       .INIT.          16 u    -   64    0    0.000    0.000   0.000

Hey,

ist there an entry in /etc/hosts for de.pool.ntp.org? What’s the output of:

  • host de.pool.ntp.org
  • grep -i de.pool.ntp.org /etc/hosts

See last response:

de.pool.ntp.org has address 85.214.38.116
de.pool.ntp.org has address 217.144.138.234
de.pool.ntp.org has address 185.207.104.70
de.pool.ntp.org has address 141.22.13.9

None.

The (wrong) ntp is set by DHCP (router ip - seems default settings when option 42 is not set). But afaik this should be overwritten with our settings!?

My general recommendation is never to use DHCP for obtaining the addresses of servers. Then you probably wouldn’t have this particular problem in the first place.

Sure, but this is not an option. We using DHCP with fixed ips. This prevent at lest addressconflicts :wink:

So, why the appliance uses 10.0.10.2 if it is not configured anywhere?
And how I could overwrite it?

Thanks a lot,
Best,
meg

The DHCP client configuration file /etc/dhcp/dhclient.conf includes ntp-servers in its request clause. Maybe removing that will help. Note though that this file is generated from the template file /etc/univention/templates/files/etc/dhcp/dhclient.conf, therefore changes to /etc/dhcp/dhclient.conf won’t persist. You may have to change the template itself as there’s no UCR variable controlling those settings.

1 Like

So removing ntp-servers from /etc/univention/templates/files/etc/dhcp/dhclient.conf should be the option?

I don’t know; I don’t use DHCP on my UCS machines. It’s just the first thing I found looking through that configuration file that looked related.

root@ucs:~# dhclient
File: /etc/resolv.conf
RTNETLINK answers: File exists
File: /etc/resolv.conf
root@ucs:~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 LOCAL(0)        .LOCL.           5 l    6   64    1    0.000    0.000   0.000
 main.macht.org  192.53.103.108   2 u    5   64    1   27.864  -19762.   0.000
root@ucs:~# sntp -d localhost
sntp 4.2.8p10@1.3728-o Sun Feb 25 21:22:25 UTC 2018 (1)
kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory
handle_lookup(localhost,0x2)
move_fd: estimated max descriptors: 1024, initial socket boundary: 16
sntp sendpkt: Sending packet to [::1]:123 ...
Packet sent.
sock_cb: localhost [::1]:123
sock_cb: Stratum unspecified, going to check for KOD (stratum: 0)
sock_cb: Packet refid: INIT
sock_cb: ::1 not in sync, skipping this server
sock_cb: handle_pkt() returned -1
sntp sendpkt: Sending packet to 127.0.0.1:123 ...
Packet sent.
sock_cb: localhost 127.0.0.1:123
sock_cb: Stratum unspecified, going to check for KOD (stratum: 0)
sock_cb: Packet refid: INIT
sock_cb: 127.0.0.1 not in sync, skipping this server
sock_cb: handle_pkt() returned -1

So… at the end, this seems not solve the problem :frowning:

Well, ntpq -p shows that the NTP server is running and has synced to an external machine from the de.pool.ntp.org pool. That’s what we want.

The fact is that your UCS server’s clock is simply way off at the moment (the offset column is in seconds, meaning the clock is off by roughly 5.5 hours). That’s why sntp won’t use the UCS server as a source.

Try forcing a clock update:

systemctl stop ntp.service
ntpdate de.pool.ntp.org
systemctl start ntp.service

But date shown the current (correct) date (and time)

30 Aug 17:09:44 ntpdate[4341]: adjust time server 89.163.128.33 offset -0.002786 sec

Fixed. THX

Mastodon