Apt repo issue "Failed to fetch File has unexpected size"

Hey,

Looks like something is wrong with debian apt repo. I’m getting the following error when running apt update:

E: Failed to fetch http://repo.percona.com/apt/dists/bullseye/testing/binary-amd64/Packages.gz  File has unexpected size (25355 != 25907). Mirror sync in progress? [IP: 49.12.125.205 80]
   Hashes of expected file:
    - Filesize:25907 [weak]
    - SHA256:cc6dfd1e2297de59994505167cfb0f5356c20c0df3fd2e8d182a02b330d0ff79
    - SHA1:3e9f49855e3a2d5b6c2abd313b7924d6d9c11087 [weak]
    - MD5Sum:614da3bcce3b002e9a037c26d63a9317 [weak]
   Release file created at: Tue, 26 Dec 2023 19:28:47 +0000

I’ve tried to clean apt cache, but didn’t help.

Thanks for your support.
Bartek

I’m also getting a similar error but for the focal distro. Strange thing is that this happens for some of our servers but an apt update works just fine on others, not sure why that’s the case.

In my case, I was able to resolve it by switching away from the ‘original’ repo with the percona-release tool

I tried to reproduce the issue but without success. So I suggest doing the following steps to fix this issues:

  1. Clear the APT Cache:
  • Run sudo apt-get clean to clear out the local repository of retrieved package files. It removes everything from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
  1. Update the Package Lists:
  • Run sudo apt-get update to update the list of available packages and their versions, but it does not install or upgrade any packages.

You can see for yourself that Percona Repo the Packages file is 0 bytes (therefore the gzipped file is a gzip of an empty file).

Clearing the cache is not going to help that.

Presumably it is specific to 32-bit as Percona Repo looks fine.

This needs looking at by the Percona administrators responsible for the apt repository, or at least an official explanation if the issue is that 32-bit is suddenly no longer supported.