Package: apt
Version: 2.9.5
Severity: important

I'm trying to use apt's repository snapshot with an overridden snapshot
server location.  However, apt is inconsistent with its usage of the
overriden server versus the snapshot.debian.org server.

It appears to be the case that if /var/lib/apt/*Release files exist, then
the override is applied as expected, but if they don't (yet) exist, then it
is not applied, and apt still tries to retrieve snapshots from hardcoded
configuration.  This is particularly problematic during system installation,
including container or VM image builds, as packages will be pulled from the
wrong server.

The relevant apt.conf content from my configuration is:
root@sid:/etc/apt# cat /etc/apt/apt.conf.d/90snapshot
Acquire
{
  Snapshots::URI
  {
    Override::Label::Debian "http://10.212.0.5/snapshot/@SNAPSHOTID@/debian/";;
    Override::Label::Debian-Security 
"http://10.212.0.5/debian-security/snapshot/@SNAPSHOTID@/debian-security/";;
    Override::Label::"Debian Backports" 
"http://10.212.0.5/snapshot/@SNAPSHOTID@/debian/";;
  };
};

And the output from an initial and subsequent 'update' operation follows:

### Initial update run:
root@sid:/etc/apt# apt update
Get:1 https://deb.debian.org/debian trixie InRelease [169 kB]
Get:2 https://deb.debian.org/debian trixie-updates InRelease [49.6 kB]
Get:3 https://deb.debian.org/debian trixie-backports InRelease [49.8 kB]
Ign:4 https://snapshot.debian.org/archive/debian/2024-06-27T19:18:25Z trixie 
InRelease
Get:5 https://deb.debian.org/debian-security trixie-security InRelease [43.5 kB]
Get:6 https://deb.debian.org/debian trixie/main Sources [9991 kB]
Get:7 https://deb.debian.org/debian trixie/main arm64 Packages [9115 kB]
Get:8 https://deb.debian.org/debian trixie/main Translation-en [6163 kB]
Ign:9 https://snapshot.debian.org/archive/debian/2024-06-27T19:18:25Z 
trixie-updates InRelease
Ign:10 https://snapshot.debian.org/archive/debian/2024-06-27T19:18:25Z 
trixie-backports InRelease
Ign:11 https://snapshot.debian.org/archive/debian-security/2024-06-27T19:18:25Z 
trixie-security InRelease
Err:12 https://snapshot.debian.org/archive/debian/2024-06-27T19:18:25Z trixie 
Release
  404  NOT FOUND [IP: 185.17.185.185 443]
Err:13 https://snapshot.debian.org/archive/debian/2024-06-27T19:18:25Z 
trixie-updates Release
  404  NOT FOUND [IP: 185.17.185.185 443]
Err:14 https://snapshot.debian.org/archive/debian/2024-06-27T19:18:25Z 
trixie-backports Release
  404  NOT FOUND [IP: 185.17.185.185 443]
Err:15 https://snapshot.debian.org/archive/debian-security/2024-06-27T19:18:25Z 
trixie-security Release
  404  NOT FOUND [IP: 185.17.185.185 443]
Error: The repository 
'https://snapshot.debian.org/archive/debian/2024-06-27T19:18:25Z trixie 
Release' does not have a Release file.
Notice: Updating from such a repository can't be done securely, and is 
therefore disabled by default.
Notice: See apt-secure(8) manpage for repository creation and user 
configuration details.
Error: The repository 
'https://snapshot.debian.org/archive/debian/2024-06-27T19:18:25Z trixie-updates 
Release' does not have a Release file.
Notice: Updating from such a repository can't be done securely, and is 
therefore disabled by default.
Notice: See apt-secure(8) manpage for repository creation and user 
configuration details.
Error: The repository 
'https://snapshot.debian.org/archive/debian/2024-06-27T19:18:25Z 
trixie-backports Release' does not have a Release file.
Notice: Updating from such a repository can't be done securely, and is 
therefore disabled by default.
Notice: See apt-secure(8) manpage for repository creation and user 
configuration details.
Error: The repository 
'https://snapshot.debian.org/archive/debian-security/2024-06-27T19:18:25Z 
trixie-security Release' does not have a Release file.
Notice: Updating from such a repository can't be done securely, and is 
therefore disabled by default.
Notice: See apt-secure(8) manpage for repository creation and user 
configuration details.

# A second update, with the lists/ content from deb.debian.org cached:
root@sid:/etc/apt# apt update
Get:1 http://10.212.0.5/snapshot/2024-06-27T19:18:25Z/debian trixie InRelease 
[169 kB]
Get:2 http://10.212.0.5/snapshot/2024-06-27T19:18:25Z/debian trixie-updates 
InRelease [49.6 kB]
Get:3 http://10.212.0.5/snapshot/2024-06-27T19:18:25Z/debian trixie-backports 
InRelease [49.8 kB]
Get:4 
http://10.212.0.5/debian-security/snapshot/2024-06-27T19:18:25Z/debian-security 
trixie-security InRelease [43.5 kB]
Get:5 http://10.212.0.5/snapshot/2024-06-27T19:18:25Z/debian trixie/main 
Sources [9991 kB]
Get:6 http://10.212.0.5/snapshot/2024-06-27T19:18:25Z/debian trixie/main arm64 
Packages [9115 kB]
Hit:7 https://deb.debian.org/debian trixie InRelease
Hit:8 https://deb.debian.org/debian trixie-updates InRelease
Hit:9 https://deb.debian.org/debian trixie-backports InRelease
Hit:10 https://deb.debian.org/debian-security trixie-security InRelease
Get:11 http://10.212.0.5/snapshot/2024-06-27T19:18:25Z/debian trixie/main 
Translation-en [6163 kB]
Fetched 25.6 MB in 2s (11.8 MB/s)
All packages are up to date.

Reply via email to