apt-cacher-ng and proxmox-offline-mirror-docs / proxmox-offline-mirror-helper

silverstone

Renowned Member
Apr 28, 2018
212
33
93
37
Ever since Proxmox VE started requesting / recommending the installation of proxmox-offline-mirror-docs / proxmox-offline-mirror-helper (either as Dependency or as recommended Packages), I had all Clients failing to download these Packages via apt-cacher-ng.

It causes a HTTP 400 Bad Request.

All other Packages, both on Debian's and Proxmox VE's Repository (pve-no-subscription), download without Issues.

I tried to dig into it a bit yesterday via Google Gemini, but I admit that I didn't manage to get anywhere unfortunately :( .

According to Google Gemini, the Issue seems to stem from 3 possible Causes:
  • Too many Hyphens (-) in Package Name
  • Package Name contains docs in its Name (not sure why helper also fails though :rolleyes: )
  • Bad HTTP Headers (not sure why it only fails with these 2 Packages though)

Here are some Examples of what I tried to do, although none of them worked.
It's difficult to know exactly why it fails, because I feel like the Error Message aren't nowhere near Verbose enough, even though Verbose is set to 7.

Code:
#PfilePatternEx = ^proxmox-offline-mirror-.*$
#PfilePatternEx = ^.*proxmox.*$
#PfilePattern = ^.*proxmox.*$|^.*((\.[ud]?deb|\.rpm|\.drpm|\.dsc|\.tar(\.gz|\.bz2|\.lzma|\.xz|\.zst)(\.sig)?)|\.diff(\.gz|\.bz2|\.lzma|\.xz|\.zst)|\.jigdo|\.template|changelog|copyright|\.debdelta|\.diff/.*\.gz|[a-f0-9]+-(susedata|updateinfo|primary|deltainfo).xml.gz|fonts/(final/)?[a-z]+32.exe(\?download.*)?|/dists/.*/installer-[^/]+/[0-9][^/]+/images/.*|/[[:alpha:]]{1,2}/[a-f0-9]{64}(-[a-f0-9]{64})?(\.gz)?|/by-hash/(SHA|MD)[0-9]+/.*|\.asc$|changelogs/pool/.*/changelog.txt$|/objects/.*/.*\.(dirtree|filez|commit|commitmeta)|/repo/deltas/.*|[a-f0-9]+-modules.yaml.gz|[a-f0-9]+-(primary|filelists|comps-[^.]*.[^.]*|updateinfo|prestodelta).xml(|.gz|.xz|.zck))$
#PfilePattern = ^.*(proxmox.*\.deb|proxmox.*\.tar.*)$|^.*((\.[ud]?deb|\.rpm|\.drpm|\.dsc|\.tar(\.gz|\.bz2|\.lzma|\.xz|\.zst)(\.sig)?)|\.diff(\.gz|\.bz2|\.lzma|\.xz|\.zst)|\.jigdo|\.template|changelog|copyright|\.debdelta|\.diff/.*\.gz|[a-f0-9]+-(susedata|updateinfo|primary|deltainfo).xml.gz|fonts/(final/)?[a-z]+32.exe(\?download.*)?|/dists/.*/installer-[^/]+/[0-9][^/]+/images/.*|/[[:alpha:]]{1,2}/[a-f0-9]{64}(-[a-f0-9]{64})?(\.gz)?|/by-hash/(SHA|MD)[0-9]+/.*|\.asc$|changelogs/pool/.*/changelog.txt$|/objects/.*/.*\.(dirtree|filez|commit|commitmeta)|/repo/deltas/.*|[a-f0-9]+-modules.yaml.gz|[a-f0-9]+-(primary|filelists|comps-[^.]*.[^.]*|updateinfo|prestodelta).xml(|.gz|.xz|.zck))$
#VfilePattern = ^$
#WfilePattern = ^.*proxmox.*$
#PfilePattern = ^.*proxmox.*$
#VfilePattern = ^$
#SPfilePatternEx = .*proxmox.*

#UserBlockPattern = ^download\.proxmox\.com/.*\.deb$
#SPfilePattern = ^.*proxmox-offline-mirror.*$

Example of Log parsed via grep --color -ri proxmox-offline-mirror -B5 -A5 /var/log/apt-cacher-ng/apt-cacher.err:
Code:
Sun May 24 07:09:49 2026|Detected incoming connection from the TCP socket
Sun May 24 07:09:49 2026|Client name: 192.168.2.23:34932
Sun May 24 07:09:49 2026|Decoded request URI: /
Sun May 24 07:09:49 2026|Detected incoming connection from the TCP socket
Sun May 24 07:09:49 2026|Client name: 192.168.2.23:34936
Sun May 24 07:09:49 2026|Decoded request URI: http://download.proxmox.com/debian/pve/dists/trixie/pve-no-subscription/binary-amd64/proxmox-offline-mirror-docs_0.7.4_all.deb
Sun May 24 07:09:49 2026|Processing new job, http://download.proxmox.com/debian/pve/dists/trixie/pve-no-subscription/binary-amd64/proxmox-offline-mirror-docs_0.7.4_all.deb
Sun May 24 07:09:50 2026|Download started, storeHeader for download.proxmox.com/debian/pve/dists/trixie/pve-no-subscription/binary-amd64/proxmox-offline-mirror-docs_0.7.4_all.deb, current status: 1
Sun May 24 07:09:50 2026|Detected incoming connection from the TCP socket
Sun May 24 07:09:50 2026|Client name: 192.168.2.23:34950
Sun May 24 07:09:50 2026|Decoded request URI: http://download.proxmox.com/debian/pve/dists/trixie/pve-no-subscription/binary-amd64/proxmox-offline-mirror-helper_0.7.4_amd64.deb
Sun May 24 07:09:50 2026|Processing new job, http://download.proxmox.com/debian/pve/dists/trixie/pve-no-subscription/binary-amd64/proxmox-offline-mirror-helper_0.7.4_amd64.deb
Sun May 24 07:09:50 2026|Download started, storeHeader for download.proxmox.com/debian/pve/dists/trixie/pve-no-subscription/binary-amd64/proxmox-offline-mirror-helper_0.7.4_amd64.deb, current status: 1

Any Idea on how this can be solved ?

The only Workaround I could do at the moment is to pre-download the Package File and then distribute them using salt to all Client Devices in /var/cache/apt/archives/, but that is really a Hack ... Another Option could be a local partial Mirror for only these Packages combined with higher-priority APT Pinning. That is another Hack that feels unnecessary though.
 
I used apt-cacher-ng for years. I also tried squid-deb-proxy and apt-mirror at various solutions. All in all, these are very unstable solutions. For apt-cacher-ng, I had already written a script that deletes the entire cache and rebuilds it if the cache is corrupted. What you’re describing sounds like that.

A few weeks ago, I finally had enough. By chance, I discovered the “apt-mirror2” package on Ubuntu 26.04. It’s an updated version of the old apt-mirror. Apt-mirror2 works flawlessly here with a wide variety of repositories from different distributions and architectures. With this, I’ve finally found my stable solution. https://gitlab.com/apt-mirror2/apt-mirror2

Give it a try! Maybe it’ll be a solution for you, too.
 
I used apt-cacher-ng for years. I also tried squid-deb-proxy and apt-mirror at various solutions. All in all, these are very unstable solutions. For apt-cacher-ng, I had already written a script that deletes the entire cache and rebuilds it if the cache is corrupted. What you’re describing sounds like that.

A few weeks ago, I finally had enough. By chance, I discovered the “apt-mirror2” package on Ubuntu 26.04. It’s an updated version of the old apt-mirror. Apt-mirror2 works flawlessly here with a wide variety of repositories from different distributions and architectures. With this, I’ve finally found my stable solution. https://gitlab.com/apt-mirror2/apt-mirror2

Give it a try! Maybe it’ll be a solution for you, too.
Thank you for your Reply.

I've also had enough due to these 2 stupid Packages and decided to just mirror the entire pve-no-subscription and pbs-no-subscription Repositories.

I am using a heavily patched Version of debmirror (Perl ... sigh :rolleyes: ) so that I can also selectively exclude Packages if I don't want to waste too much Disk Space. Not needed here but e.g. netdata and hashicorp Repositories can be useful to exclude very old Versions (although --exclude REGEX needs to be manually updated).

https://github.com/luckylinux/debmirror/

If I feel like it, I should probably just ask some AI Agent to convert the entire thing into Python, since that is a Language that I know much better (compared to PERL which I don't know at all).