apt-mirror not syncing correctly

Bug #2051996 reported by Gustavo Sanchez
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt-mirror (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

===== Mirror Pov
After syncing multiple times there is one file that is always mirroring out of sync

Taking a look the official archive shows 13M (14090084) on the file http://archive.ubuntu.com/ubuntu/dists/jammy/universe/binary-amd64/Packages.xz

While my mirror is getting 9M
I deleted the file and mirrored again and still have a diff

===== Client Pov
Now from the client POV I will get the following error

$ apt update
Hit:1 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy-updates InRelease
Hit:2 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy-backports InRelease
Hit:3 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy-security InRelease
Get:4 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy InRelease [270 kB]
Get:5 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/main amd64 Packages [1395 kB]
Get:6 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/main Translation-en [510 kB]
Get:7 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/main amd64 c-n-f Metadata [30.3 kB]
Get:8 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/restricted amd64 Packages [129 kB]
Get:9 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/restricted Translation-en [18.6 kB]
Get:10 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/restricted amd64 c-n-f Metadata [488 B]
Get:11 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/universe amd64 Packages [14.1 MB]
Get:11 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/universe amd64 Packages [14.1 MB]
Get:11 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/universe amd64 Packages [14.1 MB]
Get:11 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/universe amd64 Packages [14.1 MB]
Get:11 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/universe amd64 Packages [14.1 MB]
Ign:11 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/universe amd64 Packages
Get:11 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/universe amd64 Packages [14.1 MB]
Err:11 http://ubuntu-archive.mirror.maas:8000/ubuntu jammy/universe amd64 Packages
  File has unexpected size (9596946 != 14090084). Mirror sync in progress? [IP: 10.10.11.63 8000]
  Hashes of expected file:
   - Filesize:14090084 [weak]
   - SHA256:d29cb24c93fec5f43255706bce7eb46d4779952039d8c68ac1bb14a6f3655ce2
   - SHA1:48f33706c3a3711801af4d1910f5e44722260458 [weak]
   - MD5Sum:b5650e6cdfe32048f4362e5c46bd0251 [weak]
  Release file created at: Thu, 21 Apr 2022 17:16:08 +0000
Fetched 270 kB in 1s (189 kB/s)
Reading package lists... Done
E: Failed to fetch http://ubuntu-archive.mirror.maas:8000/ubuntu/dists/jammy/universe/binary-amd64/Packages.xz File has unexpected size (9596946 != 14090084). Mirror sync in progress? [IP: 10.10.11.63 8000]
   Hashes of expected file:
    - Filesize:14090084 [weak]
    - SHA256:d29cb24c93fec5f43255706bce7eb46d4779952039d8c68ac1bb14a6f3655ce2
    - SHA1:48f33706c3a3711801af4d1910f5e44722260458 [weak]
    - MD5Sum:b5650e6cdfe32048f4362e5c46bd0251 [weak]
   Release file created at: Thu, 21 Apr 2022 17:16:08 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

=== "Workaround"
Hacky workaround is to manually download the file
curl http://archive.ubuntu.com/ubuntu/dists/jammy/universe/binary-amd64/Packages.xz -o /var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/dists/jammy/universe/binary-amd64/Packages.xz

However,
1. I will have to manually download the file after each sync
2. I am worried this might happen later with other files

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt-mirror (Ubuntu):
status: New → Confirmed
Revision history for this message
nE0sIghT (ne0sight) wrote :

Hello!

I believe this issue can not be easily fixed in the apt-mirror because it currently doesn't enforce mirror data integrity.
You can try apt-mirror2 that enforces data integrity checks: https://gitlab.com/apt-mirror2/apt-mirror2

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.