Package installation unreliable on systems without RTC

Bug #1951639 reported by Floris
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Medium
Unassigned

Bug Description

It seems that when you specify "packages:" to be installed in the cloud-init user-data, it attempts to update the repository files and install the packages straight away, without waiting for date/time to be synchronized through NTP.
This creates problems for systems without RTC (like the Raspberry Pi) that do not have valid date/time at that point yet, as apt throws a fit if the InRelease files are newer than current time.

==
Cloud-init v. 21.3-1-g6803368d-0ubuntu3 running 'modules:final' at Wed, 13 Oct 2021 13:33:26 +0000. Up 47.18 seconds.
Get:1 http://ports.ubuntu.com/ubuntu-ports impish InRelease [270 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports impish-updates InRelease [110 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports impish-backports InRelease [101 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports impish-security InRelease [110 kB]
Reading package lists...
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/impish/InRelease is not valid yet (invalid for another 1d 3h 1min 32s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/impish-updates/InRelease is not valid yet (invalid for another 37d 3h 47min 18s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/impish-backports/InRelease is not valid yet (invalid for another 37d 3h 47min 29s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/ubuntu-ports/dists/impish-security/InRelease is not valid yet (invalid for another 37d 3h 47min 13s). Updates for this repository will not be applied.
==

Think you should wait until systemd reaches time-sync.target before doing anything through apt.

Revision history for this message
James Falcon (falcojr) wrote :

Yes, I think ordering 'cloud-final.service' after 'time-sync.target' would fix this issue.

Changed in cloud-init:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Triaged → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.