TimeSync Failed

Hello, 2 version of DietPi full upgrade I started to receive the following daily:

/etc/cron.daily/dietpi:
[FAILED] DietPi-TimeSync | systemctl restart systemd-timesyncd [FAILED] DietPi-TimeSync | Unable to continue, DietPi-TimeSync will now terminate.
[FAILED] DietPi-TimeSync | systemctl start systemd-timesyncd [FAILED] DietPi-TimeSync | Unable to continue, DietPi-TimeSync will now terminate.


I was hoping it would have fixed what ever broke in the latest update, but it did not.

Can anyone suggest any ideas on how to fix this?
-D

could you do following and share the output

systemctl restart systemd-timesyncd
journalctl -u systemd-timesyncd

Here is the output:

root@PI:~# systemctl restart systemd-timesyncd
Failed to restart systemd-timesyncd.service: Unit systemd-timesyncd.service not found.
root@PI:~# journalctl -u systemd-timesyncd
Journal file /var/log/journal/ceacfe8e75bb4870a0270623dfe449ef/user-1000.journal is truncated, ignoring file.
-- Journal begins at Thu 2022-05-05 06:16:49 PDT, ends at Thu 2022-05-19 09:01:42 PDT. --
-- No entries --
root@PI:~#

Pls do following and restart your system

apt install systemd-timesyncd

Corrected and working, Thank you!

root@PI:~# systemctl restart systemd-timesyncd
root@PI:~# journalctl -u systemd-timesyncd
Journal file /var/log/journal/ceacfe8e75bb4870a0270623dfe449ef/user-1000.journal is truncated, ignoring file.
-- Journal begins at Thu 2022-05-05 06:16:49 PDT, ends at Thu 2022-05-19 09:45:14 PDT. --
May 19 09:45:03 PI.shiplofts.com systemd[1]: Starting Network Time Synchronization...
May 19 09:45:03 PI.shiplofts.com systemd[1]: Started Network Time Synchronization.
May 19 09:45:02 PI.shiplofts.com systemd-timesyncd[5385]: Initial synchronization to time server 38.229.56.9:123 (0.debian.pool.ntp.org).
May 19 09:45:13 PI.shiplofts.com systemd[1]: Stopping Network Time Synchronization...
May 19 09:45:13 PI.shiplofts.com systemd[1]: systemd-timesyncd.service: Succeeded.
May 19 09:45:13 PI.shiplofts.com systemd[1]: Stopped Network Time Synchronization.
May 19 09:45:13 PI.shiplofts.com systemd[1]: Starting Network Time Synchronization...
May 19 09:45:13 PI.shiplofts.com systemd[1]: Started Network Time Synchronization.
May 19 09:45:14 PI.shiplofts.com systemd-timesyncd[5392]: Initial synchronization to time server 103.242.68.68:123 (0.debian.pool.ntp.org).
root@PI:~#

Did you have done any update from Debian Buster to Bullseye?

I do have bulllseye installed

root@PI:~# lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

well question was if you did an upgrade from Buster to Bullseye beforehand :slight_smile:
As the missing time sync service is a known symptom for the upgrade.

That is about the time it happened! Thanks again

Hi, i have same problem but i am unable to solve it. when i log on over ssh on main board it shows me info that ssl certificate is not valid >

  • Device model : Generic Device (armv7l)
  • CPU temp : 48 °C / 118 °F : Optimal temperature
  • LAN IP : 192.168.1.10 (eth0)
    curl: (60) SSL certificate problem: certificate is not yet valid
    More details here: curl - SSL CA Certificates

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.


when i run update or upgrade then it gives me information that :slight_smile:

  • Command: systemctl start systemd-timesyncd │
    │ - Exit code: 5 │
    │ - DietPi version: v8.16.2 (MichaIng/master) | HW_MODEL: 22 | HW_ARCH: 2 | DISTRO: 6 │
    │ - Image creator: orangepi │
    │ - Pre-image: orangepi │
    │ - Error log: │
    │ Failed to start systemd-timesyncd.service: Unit systemd-timesyncd.service not found.

i tried running folowing comand but without succsses >
apt install systemd-timesyncd


date and time is not set propperly but i am not able to correct by changing NTP:
Failed to enable unit: Unit file systemd-timesyncd.service does not exist.

Any help. Thanks in advance

Did you performed a Debian Destro upgrade before? And did you already tried solution above?

apt install systemd-timesyncd
systemctl unmask systemd-timesyncd
/boot/dietpi/func/run_ntpd 1

this is end resoult of comand you provided . >

[FAILED] DietPi-TimeSync | systemctl restart systemd-timesyncd
[FAILED] DietPi-TimeSync | systemctl restart systemd-timesyncd
[FAILED] DietPi-TimeSync | systemctl restart systemd-timesyncd



Details:

  • Date | Pon 17 Apr 2023 03:51:27 CEST
  • DietPi version | v8.16.2 (MichaIng/master)
  • Image creator | orangepi
  • Pre-image | orangepi
  • Hardware | Generic Device (armv7l) (ID=22)
  • Kernel version | Linux DietPi 5.15.93-sunxi #23.02.2 SMP Fri Feb 17 23:49:46 UTC 2023 armv7l GNU/Linux
  • Distro | bullseye (ID=6)
  • Command | systemctl restart systemd-timesyncd
  • Exit code | 5
  • Software title | DietPi-TimeSync

Steps to reproduce:

Expected behaviour:

Actual behaviour:

Extra details:

Additional logs:

Failed to restart systemd-timesyncd.service: Unit systemd-timesyncd.service not found.

[FAILED] DietPi-TimeSync | Unable to continue, DietPi-TimeSync will now terminate.

What is the output of

apt install --reinstall systemd-timesyncd
root@DietPi:~# apt install --reinstall systemd-timesyncd
Čitam spiskove paketa... Done
Gradim stablo zavisnosti... Done
Reading state information... Done
Slijedeći NOVI paketi će biti instalirani:
  systemd-timesyncd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 131 kB of archives.
After this operation, 195 kB of additional disk space will be used.
Err:1 https://deb.debian.org/debian bullseye/main armhf systemd-timesyncd armhf 247.3-7+deb11u1
  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses not yet valid certificate.  Could not handshake: Error in the certificate verification. [IP: 199.232.18.132 443]
E: Failed to fetch https://deb.debian.org/debian/pool/main/s/systemd/systemd-timesyncd_247.3-7%2bdeb11u1_armhf.deb  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses not yet valid certificate.  Could not handshake: Error in the certificate verification. [IP: 199.232.18.132 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I also tried > apt-get update or --fix-missing

Pls try to set time manually until it has been fixed using following format. Try to be accurate as much as possible.

date -s "2 OCT 2006 18:00:00"

Once done try following again

apt update 
apt install systemd-timesyncd
systemctl unmask systemd-timesyncd
/boot/dietpi/func/run_ntpd 1

Pls share whole output afterwards

1 Like

After corecting time
date -s “2 OCT 2006 18:00:00”
everything get back to normal and all problems are gone (offcourse with todays date and time ) . System is now able to upgrade and update.

root@DietPi:~# apt install systemd-timesyncd
Čitam spiskove paketa... Done
Gradim stablo zavisnosti... Done
Reading state information... Done
Slijedeći NOVI paketi će biti instalirani:
  systemd-timesyncd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 131 kB of archives.
After this operation, 195 kB of additional disk space will be used.
Get:1 https://deb.debian.org/debian bullseye/main armhf systemd-timesyncd armhf                                                                                         247.3-7+deb11u2 [131 kB]
Fetched 131 kB in 1s (179 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package systemd-timesyncd.
(Reading database ... 24462 files and directories currently installed.)
Preparing to unpack .../systemd-timesyncd_247.3-7+deb11u2_armhf.deb ...
Unpacking systemd-timesyncd (247.3-7+deb11u2) ...
Setting up systemd-timesyncd (247.3-7+deb11u2) ...
root@DietPi:~# systemctl unmask systemd-timesyncd
root@DietPi:~# /boot/dietpi/func/run_ntpd 1
[  OK  ] DietPi-TimeSync | systemctl restart systemd-timesyncd
[ INFO ] DietPi-TimeSync | Waiting for time sync (1/60)
[ INFO ] DietPi-TimeSync | Waiting for time sync (2/60)
[ INFO ] DietPi-TimeSync | Waiting for time sync (3/60)

and so on …

Does the time sync complete successfully?

Not at first , but since i was trying to change NTP mirror before, i set back NTP mirror to default and then sync was activated automaticly and finished successesfuly .


For double check , if i run time sync by your script it works fine.
:slight_smile: many thanks / i hope that this topic will help to many others