Skip to content

Systemd-timesyncd not syncing system time #34220

Closed

Description

@4piu

systemd version the issue has been seen with

252.26-1~deb12u2
252.30-1~deb12u2

Used distribution

Debian 12.6

Linux kernel version used

6.7.12-edge-sunxi

CPU architectures issue was seen on

arm

Component

systemd-timesync

Expected behaviour you didn't see

System time sync automatically

Unexpected behaviour you saw

System time is not synced. Since the host does not have hardware RTC the time is wrong on reboot.

➜ ~ sudo timedatectl status

               Local time: Sat 2024-08-31 20:14:16 EDT
           Universal time: Sun 2024-09-01 00:14:16 UTC
                 RTC time: Sun 2024-09-01 00:13:59
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

➜ ~ sudo timedatectl timesync-status

       Server: n/a (n/a)
Poll interval: 0 (min: 32s; max 34min 8s)
 Packet count: 0

➜ ~ sudo systemctl status systemd-timesyncd.service

● systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; preset: enabled)
     Active: active (running) since Sat 2024-08-31 19:49:05 EDT; 18min ago
       Docs: man:systemd-timesyncd.service(8)
   Main PID: 475 (systemd-timesyn)
     Status: "Daemon is running"
      Tasks: 1 (limit: 898)
     Memory: 824.0K
        CPU: 320ms
     CGroup: /system.slice/systemd-timesyncd.service
             └─475 /lib/systemd/systemd-timesyncd

Aug 31 19:49:04 nanopineo systemd[1]: Starting systemd-timesyncd.service - Network Time Synchronization...
Aug 31 19:49:05 nanopineo systemd[1]: Started systemd-timesyncd.service - Network Time Synchronization.

➜ ~ sudo journalctl -u systemd-timesyncd

Aug 31 20:11:56 nanopineo systemd[1]: Stopping systemd-timesyncd.service - Network Time Synchronization...
Aug 31 20:11:56 nanopineo systemd[1]: systemd-timesyncd.service: Deactivated successfully.
Aug 31 20:11:56 nanopineo systemd[1]: Stopped systemd-timesyncd.service - Network Time Synchronization.
Aug 31 20:11:56 nanopineo systemd[1]: Starting systemd-timesyncd.service - Network Time Synchronization...
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Bus bus-api-timesync: changing state UNSET → OPENING
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: sd-bus: starting bus bus-api-timesync by connecting to /run/dbus/system_bus_socket...
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Bus bus-api-timesync: changing state OPENING → AUTHENTICATING
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Registering bus object implementation for path=/org/freedesktop/LogControl1 iface=org.freedesktop.LogControl1
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Added new fallback server 0.debian.pool.ntp.org.
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Added new fallback server 1.debian.pool.ntp.org.
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Added new fallback server 2.debian.pool.ntp.org.
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Added new fallback server 3.debian.pool.ntp.org.
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: systemd-timesyncd running as pid 24820
Aug 31 20:11:56 nanopineo systemd[1]: Started systemd-timesyncd.service - Network Time Synchronization.
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Bus bus-api-timesync: changing state AUTHENTICATING → HELLO
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RequestName cookie=2 reply_cookie=0 signature=su error-name=n/a error-message=n/a
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.24 path=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 signature=s error-name=n/a error-message=n/a
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Bus bus-api-timesync: changing state HELLO → RUNNING
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Got message type=signal sender=org.freedesktop.DBus.Local destination=n/a path=/org/freedesktop/DBus/Local interface=org.freedesktop.DBus.Local member=Connected cookie=4294967295 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Got message type=signal sender=org.freedesktop.DBus destination=:1.24 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=2 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Got message type=signal sender=org.freedesktop.DBus destination=:1.24 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=3 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.24 path=n/a interface=n/a member=n/a cookie=4 reply_cookie=2 signature=u error-name=n/a error-message=n/a
Aug 31 20:11:56 nanopineo systemd-timesyncd[24820]: Successfully acquired requested service name.

/etc/systemd/timesyncd.conf:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the timesyncd.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# See timesyncd.conf(5) for details.

[Time]
#NTP=
#FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048
#ConnectionRetrySec=30
#SaveIntervalSec=60

Steps to reproduce the problem

No response

Additional program output to the terminal or log subsystem illustrating the issue

No response

Activity

  1. added
    bug 🐛
    on Sep 1, 2024
  2. Winterhuman commented on Sep 1, 2024

    @Winterhuman
    Contributor

    I've experienced this issue before when my hardware RTC started failing. The reason systemd-timesyncd couldn't do anything, in my case, was because the NTP servers are specified as DNS domains, however, DNS resolvers may fail to get a response if the time is too out of sync.

    Perhaps systemd could save the IP address(es) of whatever NTP server was last successfully connected to, and check for it if DNS is unavailable?

  3. 4piu commented on Sep 1, 2024

    @4piu
    ContributorAuthor

    @Winterhuman Thank you for the reply. In my case, I can ping the NTP servers without issue. I also tried manually correcting the system clock, but the systemd-timesyncd still won't sync.

  4. Winterhuman commented on Sep 1, 2024

    @Winterhuman
    Contributor

    What DNS resolver are you using? Can you confirm that a command like dig 0.debian.pool.ntp.org definitely works? If it does, I'm not sure how to help unfortunately; we probably have different issues in that case

  5. yuwata commented on Sep 2, 2024

    @yuwata
    Member

    Sorry, here is an upstream issue tracker, and v252 is too old. Please reproduce the issue with a recent release (v255, v256) or the current git HEAD. If the issue can be reproducible with them, then please provide

    • result of resolvectl
    • result of dig 0.debian.pool.ntp.org as suggested by @Winterhuman in the above,
    • result of debugging logs of systemd-timesyncd, which can be generated by creating the following drop-in config by sudo systemctl edit systemd-timesyncd.service:
    # /etc/systemd/system/systemd-timesyncd.service.d/override.conf
    [Service]
    Environment=SYSTEMD_LOG_LEVEL=debug
    

    Closing. Feel free to request to reopen this page with the above information. Or, please contact to your downstream.

  6. 4piu commented on Sep 2, 2024

    @4piu
    ContributorAuthor

    Thank you. The problem is fixed after I upgrading Debian to sid with systemd 256 (256.5-2). I also reinstall the fake-hwclock

    The debug log seems normal now. Previously it never sends out NTP request after Successfully acquired requested service name

    Sep 01 17:41:05 nanopineo systemd[1]: Started systemd-timesyncd.service - Network Time Synchronization.
    Sep 01 17:41:06 nanopineo systemd-timesyncd[477]: Got inotify event on bus bus-api-timesync.
    Sep 01 17:41:06 nanopineo systemd-timesyncd[477]: sd-bus: starting bus bus-api-timesync by connecting to /run/dbus/system_bus_socket...
    Sep 01 17:41:06 nanopineo systemd-timesyncd[477]: Bus bus-api-timesync: changing state WATCH_BIND → AUTHENTICATING
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Bus bus-api-timesync: changing state AUTHENTICATING → HELLO
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RequestName cookie=2 reply_cookie=0 signature=su error-name=n/a error-message=n/a
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.2 path=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 signature=s error-name=n/a error-message=n/a
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Bus bus-api-timesync: changing state HELLO → RUNNING
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Got message type=signal sender=org.freedesktop.DBus.Local destination=n/a path=/org/freedesktop/DBus/Local interface=org.freedesktop.DBus.Local member=Connected cookie=4294967295 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Got message type=signal sender=org.freedesktop.DBus destination=:1.2 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=2 reply_cookie=0 signature=s error-name=n/a error-message=n/a
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Got message type=signal sender=org.freedesktop.DBus destination=:1.2 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=3 reply_cookie=0 signature=s error-name=n/a error-message=n/a
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.2 path=n/a interface=n/a member=n/a cookie=4 reply_cookie=2 signature=u error-name=n/a error-message=n/a
    Sep 01 17:41:07 nanopineo systemd-timesyncd[477]: Successfully acquired requested service name.
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Network configuration changed, trying to establish connection.
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Selected server 0.debian.pool.ntp.org.
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Resolving 0.debian.pool.ntp.org...
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Resolved address 23.150.40.242:123 for 0.debian.pool.ntp.org.
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Resolved address 66.205.249.28:123 for 0.debian.pool.ntp.org.
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Resolved address 152.70.159.102:123 for 0.debian.pool.ntp.org.
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Resolved address 108.61.73.244:123 for 0.debian.pool.ntp.org.
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Selected address 23.150.40.242:123 of server 0.debian.pool.ntp.org.
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Connecting to time server 23.150.40.242:123 (0.debian.pool.ntp.org).
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: Sent NTP request to 23.150.40.242:123 (0.debian.pool.ntp.org).
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]: NTP response:
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   leap         : 0
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   version      : 4
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   mode         : 4
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   stratum      : 2
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   precision    : 0.000000 sec (-25)
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   root distance: 0.012299 sec
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   reference    : n/a
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   origin       : 1725235621.145
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   receive      : 1725252285.683
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   transmit     : 1725252285.683
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   dest         : 1725235621.194
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   offset       : +16664.513 sec
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   delay        : +0.049 sec
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   packet count : 1
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   jitter       : 0.000
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   poll interval: 32
    Sep 01 20:07:01 nanopineo systemd-timesyncd[477]:   adjust (jump): +16664.513 sec
    Sep 02 00:44:45 nanopineo systemd-timesyncd[477]:   status       : 8192 sync
    Sep 02 00:44:45 nanopineo systemd-timesyncd[477]:   time now     : 1725252285.713
    Sep 02 00:44:45 nanopineo systemd-timesyncd[477]:   constant     : 2
    Sep 02 00:44:45 nanopineo systemd-timesyncd[477]:   offset       : +0.000 sec
    Sep 02 00:44:45 nanopineo systemd-timesyncd[477]:   freq offset  : +0 (+0 ppm)
    Sep 02 00:44:45 nanopineo systemd-timesyncd[477]: interval/delta/delay/jitter/drift 32s/+16664.513s/0.049s/0.000s/+0ppm
    Sep 02 00:44:45 nanopineo systemd-timesyncd[477]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/timesync1 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=3 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
    Sep 02 00:44:45 nanopineo systemd-timesyncd[477]: Contacted time server 23.150.40.242:123 (0.debian.pool.ntp.org).
    Sep 02 00:44:45 nanopineo systemd-timesyncd[477]: Initial clock synchronization to Mon 2024-09-02 00:44:45.712830 EDT.
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]: Sent NTP request to 23.150.40.242:123 (0.debian.pool.ntp.org).
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]: NTP response:
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   leap         : 0
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   version      : 4
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   mode         : 4
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   stratum      : 2
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   precision    : 0.000000 sec (-25)
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   root distance: 0.012329 sec
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   reference    : n/a
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   origin       : 1725252317.917
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   receive      : 1725252317.945
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   transmit     : 1725252317.945
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   dest         : 1725252317.968
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   offset       : +0.002 sec
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   delay        : +0.051 sec
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   packet count : 2
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   jitter       : 0.001
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   poll interval: 64
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   adjust (slew): +0.002 sec
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   status       : 8193 sync
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   time now     : 1725252317.969
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   constant     : 2
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   offset       : +0.002 sec
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]:   freq offset  : +0 (+0 ppm)
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]: interval/delta/delay/jitter/drift 64s/+0.002s/0.051s/0.001s/+0ppm
    Sep 02 00:45:17 nanopineo systemd-timesyncd[477]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/timesync1 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=4 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
    Sep 02 00:45:32 nanopineo systemd-timesyncd[477]: Bus bus-api-timesync: changing state RUNNING → CLOSED
    
  7. thomas-slamcore commented on Sep 29, 2025

    @thomas-slamcore

    I had exactly the same issue. I tracked it down. I was using NetworkManager to manage my interfaces but systemd-networkd was enabled anyway. systemd-networkd was advertising it's internal ONLINE_STATE=offline to systemd-timesyncd which in turn caused it to stall indefinitely. In my case the fix was to disable systemd-networkd.

  8. igrmm commented on Jan 3, 2026

    @igrmm

    I had exactly the same issue. I tracked it down. I was using NetworkManager to manage my interfaces but systemd-networkd was enabled anyway. systemd-networkd was advertising it's internal ONLINE_STATE=offline to systemd-timesyncd which in turn caused it to stall indefinitely. In my case the fix was to disable systemd-networkd.

    Thank you, this fix worked for me, just disabled systemd-networkd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛timesync

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions