apt-cacher-ng not working lately / 503 Errors

Posted by frashmanf@reddit | linuxadmin | View on Reddit | 19 comments

We have been using apt-cacher-ng for a couple of years now and have been having constant problems with it lately. The apt-cache host is an LXC container on our proxmox cluster and ran for years without problems. The errors are not persistent. I recently updated all of our clients at the same time via Ansible - some worked without error, some didn't, and the next time other PCs are affected. I can't see any pattern. Most of our clients are Debian 12, some are still on Debian 11. The error messages are mostly 503 errors like:

$ sudo apt update
Ign:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://ftp.debian.org/debian bookworm InRelease
Hit:3 http://ftp.debian.org/debian bookworm-updates InRelease
Hit:4 http://ftp.debian.org/debian bookworm-backports InRelease
Hit:5 http://ftp.debian.org/debian unstable InRelease
Ign:1 http://security.debian.org/debian-security bookworm-security InRelease
Ign:1 http://security.debian.org/debian-security bookworm-security InRelease
Err:1 http://security.debian.org/debian-security bookworm-security InRelease
  503  DNS error - nodename nor servname provided, or not known [IP: 10.0.1.147 3142]
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://security.debian.org/debian-security/dists/bookworm-security/InRelease  503  DNS error - nodename nor servname provided, or not known [IP: 10.0.1.147 3142]
W: Some index files failed to download. They have been ignored, or old ones used instead.

mostly security.debian.org is affected, but the other sources as well. We've often also seeing:

this is the sources.list for all our clients:

$ cat /etc/apt/sources.list
deb http://ftp.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb http://ftp.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb http://ftp.debian.org/debian bookworm-backports main contrib non-free non-free-firmware

this is the proxy config of the clients:

$ cat /etc/apt/apt.conf.d/00aptproxy 
# BEGIN ANSIBLE MANAGED BLOCK
Acquire::http::Proxy "http://10.0.1.147:3142";
Acquire::http::timeout "120";
Acquire::https::timeout "120";
# END ANSIBLE MANAGED BLOCK

things we tried/testet: