Initial Boot "Time Sync timed out" and apt update repo signature not valid yet => Failed install

Creating a bug report/issue

Required Information

  • DietPi version | cat /boot/dietpi/.version 8.19.1 (master, owner: MichaIng, G_LIVE_PATCH_STATUS=[applied,applied,not applied]
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN bookworm 0
  • Kernel version | uname -a Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
  • Architecture | dpkg --print-architecture arm64
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3) RPi 3 Model B+ (aarch64)
  • Power supply used | (EG: 5V 1A RAVpower) 5V DC 3A
  • SD card used | (EG: SanDisk ultra) SanDisk Extreme 32GB

Steps to reproduce

  1. Copy image onto disk (using either dd if=DietPi_RPi-ARMv8-Bookworm.img of=/dev/disk2 or Raspberry Pi Imager ; tried both)
  2. Adjust variables in dietpi.txt to the following
  3. Insert into RPi and boot up

Expected behaviour

  • System should install itself

Actual behaviour

  • System boots
  • TimeSync runs but times out after 60 tries
  • APT update starts
  • APT update fails because it says that the signature/certificate is not yet valid (probably due to the failed timesync)
  • Then a flickering info text appears on top left and stays there permanently:
[ INFO ] Dietpi-Software | Dietpi has not fully been installed.
This must be completet prior to using DietPi by selecting:
  - Go Start Install.

Extra details

fyi: I did get this error right from the beginning. When I wanted to record it in order to create this bug report, I started getting another issue instead (see here: During initial boot Could not get lock /var/lib/apt/lists/lock - #4 by Timoses )

But now, this one comes up again.

Did you adjusted the NTP server? Probably the one selected is not rechargeable from your side or maybe blocked somewhere. As a workaround you could set correct system time manually. Or if possible, select your internet router as NTP server.

Well, funny thing is, if I hit CTRL+ALT+DEL, system reboots and TimeSync succeeds (after like the 10th - 20th retry).
However, I end up with the [ INFO ] ... has not fully been installed ... again where I can do nothing.

NTP server is reachable. However, it seems to take a while until it is. Not sure why. From my network I can find no issue with NTP to

How can I set the time for the initial boot? I only find the CONFIG_NTP_MIRROR config in dietpi.txt

I find it quite odd that the two scenarios I am running into (see Link above "During initial boot Could not get lock …) do seem to stem from different bootup scenarios.

Here are two screenshots for each scenario depicting:

  1. Right before being displayed the “DietPi” header new screen where apparently the installation starts
  2. The installation start screen with the “DietPi” header on top

Here is the scenario for the TimeSync issue (this topic):

… Now my links to this image hoster are blocked… How can I share images with you?..

Both times (TIME SYNC vs APT LOCK) I do the same procedure: Copy image to SD card (using Raspberry Pi Imager currently), configure dietpi.txt, stick into RPi and boot.
These 2 scenarios (pre and install screen each) are both the INITIAL bootup.

let’s continue investigation on the other issue.

For anybody having the same issue: Workaround → use manual install

Quite possible that initial network setup and time sync takes a little longer for some reason.

A problem/regression with the APT lock indeed is that cron is enabled on first boot after the dietpi-services rework some versions ago. So if coincidentally first run setup is done during daily cron job time (1:27 AM by default), it overlaps with daily update check.

Either we need to ship images with cron disabled and enable it during first run setup, or check the install stage within our cron scripts to abort if first run setup has not finished yet.