From d168962f824517f9f38899ca124c94c167d60213 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 18 Jul 2026 14:12:02 +1000 Subject: [PATCH] remote_rpm: stop caching repodata as immutable repodata (repomd.xml and its referenced index files) is a mutable index that upstream RPM repos rotate frequently. Marking it immutable (immutable_ttl: 0) makes artifactapi cache repomd.xml forever: classifier.go checks immutable_patterns before the RPM provider's own rule (which already classifies repodata/ as mutable), and SetTTL with ttl=0 writes a Redis key with no expiry. The result is a stale repomd.xml that keeps pointing at checksum-named metadata files upstream has already deleted -> 404 on dnf metadata refresh. This broke rpmbuilder's almalinux8 builds via the epel remote and would eventually hit any rolling RPM remote. Remove the repodata immutable patterns from every remote_rpm config so repodata falls through to the provider's Mutable classification and is re-fetched every mutable_ttl. RPMs, noarch, GPG keys and .img files stay immutable. - Drop ".*/repodata/.*\.{xml,sqlite,yaml}.*$" from all config/remote_rpm/*.yaml (14 files, 20 lines). After apply, the already-cached stale repodata entries must be evicted (they have no expiry); that is done per-remote as a follow-up. --- config/remote_rpm/almalinux-vault.yaml | 3 --- config/remote_rpm/almalinux.yaml | 3 --- config/remote_rpm/ceph-reef.yaml | 1 - config/remote_rpm/ceph-squid.yaml | 1 - config/remote_rpm/ceph-tentacle.yaml | 1 - config/remote_rpm/claude-code.yaml | 1 - config/remote_rpm/epel.yaml | 3 --- config/remote_rpm/fedora.yaml | 1 - config/remote_rpm/frr.yaml | 1 - config/remote_rpm/mariadb.yaml | 1 - config/remote_rpm/openvox.yaml | 1 - config/remote_rpm/postgresql.yaml | 1 - config/remote_rpm/rke2.yaml | 1 - config/remote_rpm/zfs.yaml | 1 - 14 files changed, 20 deletions(-) diff --git a/config/remote_rpm/almalinux-vault.yaml b/config/remote_rpm/almalinux-vault.yaml index 0f48899..0d6f9b8 100644 --- a/config/remote_rpm/almalinux-vault.yaml +++ b/config/remote_rpm/almalinux-vault.yaml @@ -5,9 +5,6 @@ mutable_ttl: 7200 immutable_patterns: - ".*/x86_64/.*\\.rpm$" - ".*/noarch/.*\\.rpm$" - - ".*/repodata/.*\\.sqlite.*$" - - ".*/repodata/.*\\.xml.*$" - - ".*/repodata/.*\\.yaml.*$" - ".*/install.img" - ".*/squashfs.img" - ".*/updates.img" diff --git a/config/remote_rpm/almalinux.yaml b/config/remote_rpm/almalinux.yaml index 8ee8d1d..b679dfd 100644 --- a/config/remote_rpm/almalinux.yaml +++ b/config/remote_rpm/almalinux.yaml @@ -5,9 +5,6 @@ mutable_ttl: 7200 immutable_patterns: - ".*/x86_64/.*\\.rpm$" - ".*/noarch/.*\\.rpm$" - - ".*/repodata/.*\\.sqlite.*$" - - ".*/repodata/.*\\.xml.*$" - - ".*/repodata/.*\\.yaml.*$" - ".*/install.img" - ".*/squashfs.img" - ".*/updates.img" diff --git a/config/remote_rpm/ceph-reef.yaml b/config/remote_rpm/ceph-reef.yaml index 261ba94..2c9fe42 100644 --- a/config/remote_rpm/ceph-reef.yaml +++ b/config/remote_rpm/ceph-reef.yaml @@ -5,4 +5,3 @@ mutable_ttl: 7200 immutable_patterns: - ".*/x86_64/.*\\.rpm$" - ".*/noarch/.*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" diff --git a/config/remote_rpm/ceph-squid.yaml b/config/remote_rpm/ceph-squid.yaml index 6dfad96..e869b51 100644 --- a/config/remote_rpm/ceph-squid.yaml +++ b/config/remote_rpm/ceph-squid.yaml @@ -5,4 +5,3 @@ mutable_ttl: 7200 immutable_patterns: - ".*/x86_64/.*\\.rpm$" - ".*/noarch/.*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" diff --git a/config/remote_rpm/ceph-tentacle.yaml b/config/remote_rpm/ceph-tentacle.yaml index 35835a2..9c50d38 100644 --- a/config/remote_rpm/ceph-tentacle.yaml +++ b/config/remote_rpm/ceph-tentacle.yaml @@ -5,4 +5,3 @@ mutable_ttl: 7200 immutable_patterns: - ".*/x86_64/.*\\.rpm$" - ".*/noarch/.*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" diff --git a/config/remote_rpm/claude-code.yaml b/config/remote_rpm/claude-code.yaml index a20cde2..e84dfa1 100644 --- a/config/remote_rpm/claude-code.yaml +++ b/config/remote_rpm/claude-code.yaml @@ -3,4 +3,3 @@ description: "Claude Code RPM repository" immutable_patterns: - ".*/x86_64/.*\\.rpm$" - ".*/noarch/.*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" diff --git a/config/remote_rpm/epel.yaml b/config/remote_rpm/epel.yaml index 56578b3..c4c5898 100644 --- a/config/remote_rpm/epel.yaml +++ b/config/remote_rpm/epel.yaml @@ -5,7 +5,4 @@ mutable_ttl: 7200 immutable_patterns: - ".*/Everything/x86_64/.*\\.rpm$" - ".*/noarch/.*\\.rpm$" - - ".*/repodata/.*\\.sqlite.*$" - - ".*/repodata/.*\\.xml.*$" - - ".*/repodata/.*\\.yaml.*$" - "RPM-GPG-KEY-.*$" diff --git a/config/remote_rpm/fedora.yaml b/config/remote_rpm/fedora.yaml index 75d3ba9..34f0006 100644 --- a/config/remote_rpm/fedora.yaml +++ b/config/remote_rpm/fedora.yaml @@ -7,4 +7,3 @@ immutable_patterns: - "updates/.*/Everything/x86_64/.*\\.rpm$" - "development/.*/Everything/x86_64/.*\\.rpm$" - ".*/noarch/.*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" diff --git a/config/remote_rpm/frr.yaml b/config/remote_rpm/frr.yaml index 9c668ac..6f18abf 100644 --- a/config/remote_rpm/frr.yaml +++ b/config/remote_rpm/frr.yaml @@ -4,4 +4,3 @@ immutable_ttl: 0 mutable_ttl: 7200 immutable_patterns: - ".*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" diff --git a/config/remote_rpm/mariadb.yaml b/config/remote_rpm/mariadb.yaml index 8a6eb7b..85778da 100644 --- a/config/remote_rpm/mariadb.yaml +++ b/config/remote_rpm/mariadb.yaml @@ -4,5 +4,4 @@ immutable_ttl: 0 mutable_ttl: 7200 immutable_patterns: - ".*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" - ".*/RPM-GPG-KEY-.*$" diff --git a/config/remote_rpm/openvox.yaml b/config/remote_rpm/openvox.yaml index e19aef3..e8ebb40 100644 --- a/config/remote_rpm/openvox.yaml +++ b/config/remote_rpm/openvox.yaml @@ -4,5 +4,4 @@ immutable_ttl: 0 mutable_ttl: 7200 immutable_patterns: - ".*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" - "GPG-KEY-.*$" diff --git a/config/remote_rpm/postgresql.yaml b/config/remote_rpm/postgresql.yaml index f3c4eac..6c53dab 100644 --- a/config/remote_rpm/postgresql.yaml +++ b/config/remote_rpm/postgresql.yaml @@ -4,6 +4,5 @@ immutable_ttl: 0 mutable_ttl: 7200 immutable_patterns: - ".*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" - ".*/RPM-GPG-KEY-.*$" - ".*/PGDG-RPM-GPG-KEY-.*$" diff --git a/config/remote_rpm/rke2.yaml b/config/remote_rpm/rke2.yaml index 830f24c..1f57e8e 100644 --- a/config/remote_rpm/rke2.yaml +++ b/config/remote_rpm/rke2.yaml @@ -4,5 +4,4 @@ immutable_ttl: 0 mutable_ttl: 7200 immutable_patterns: - ".*\\.rpm$" - - ".*/repodata/.*\\.xml.*$" - "public.key$" diff --git a/config/remote_rpm/zfs.yaml b/config/remote_rpm/zfs.yaml index f7652bc..17feebd 100644 --- a/config/remote_rpm/zfs.yaml +++ b/config/remote_rpm/zfs.yaml @@ -4,4 +4,3 @@ immutable_ttl: 0 mutable_ttl: 7200 immutable_patterns: - ".*\\.rpm$" - - ".*/repodata/.*\\.xml.*$"