Your message dated Sat, 11 Jan 2025 11:03:09 +0000
with message-id <[email protected]>
and subject line Close 1086879
has caused the Debian Bug report #1086879,
regarding bookworm-pu: package
prometheus-node-exporter-collectors/0.0~git20230203.6f710f8-1+deb12u3
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1086879: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1086879
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: bookworm
X-Debbugs-Cc: [email protected], Debian
Go Packaging Team <[email protected]>, Daniel Swarbrick
<[email protected]>, Martina Ferrari <[email protected]>
Control: affects -1 + src:prometheus-node-exporter-collectors
User: [email protected]
Usertags: pu
[ Reason ]
The version in Debian stable suffers from:
https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/issues/193
which causes upgrades no to appear in apt_upgrades_pending but only in
apt_upgrades_held. This is tracked in debian as #1077694
This was fixed with upstream PR:
https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/pull/207
[ Impact ]
This bug leads to the collector not reporting on pending package upgrades and
can lead to system administrators miss to install critical software updates
[ Tests ]
This change was installed on my (siretart's) homelab cluster and confirmed to
work there.
[ Risks ]
low. The code change is easy to review and understand.
[ Checklist ]
[x] *all* changes are documented in the d/changelog
[x] I reviewed all changes and I approve them
[x] attach debdiff against the package in (old)stable
[x] the issue is verified as fixed in unstable
diff --git a/debian/changelog b/debian/changelog
index 3233700..b514460 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+prometheus-node-exporter-collectors (0.0~git20230203.6f710f8-1+deb12u3)
bookworm; urgency=medium
+
+ * Team upload
+ * apt_info.py: fix apt_upgrades_pending and apt_upgrades_held, Closes:
#1077694
+
+ -- Reinhard Tartler <[email protected]> Wed, 06 Nov 2024 20:15:44 -0500
+
prometheus-node-exporter-collectors (0.0~git20230203.6f710f8-1+deb12u2)
bookworm; urgency=medium
* Team upload
diff --git
a/debian/patches/0001-apt_info.py-fix-apt_upgrades_pending-and-apt_upgrade.patch
b/debian/patches/0001-apt_info.py-fix-apt_upgrades_pending-and-apt_upgrade.patch
new file mode 100644
index 0000000..6af357f
--- /dev/null
+++
b/debian/patches/0001-apt_info.py-fix-apt_upgrades_pending-and-apt_upgrade.patch
@@ -0,0 +1,35 @@
+From: Reinhard Tartler <[email protected]>
+Date: Sat, 2 Nov 2024 08:20:41 -0400
+Subject: apt_info.py: fix apt_upgrades_pending and apt_upgrades_held
+
+Backported from
+https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/pull/207
+---
+ apt_info.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/apt_info.py b/apt_info.py
+index 82ea4e5..804f89c 100755
+--- a/apt_info.py
++++ b/apt_info.py
+@@ -57,7 +57,7 @@ def _write_pending_upgrades(cache):
+ # only one upgrade, not two). See the following issue for more details:
+ #
https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/issues/85
+ candidates = {
+- p.candidate for p in cache.get_changes() if p.is_installed and
p.marked_upgrade
++ p.candidate for p in cache if p.is_upgradable
+ }
+ _write_upgrade_info("apt_upgrades_pending", candidates)
+
+@@ -66,7 +66,10 @@ def _write_held_upgrades(cache):
+ print("# HELP apt_upgrades_held Apt packages pending updates but held
back.")
+ print("# TYPE apt_upgrades_held gauge")
+
+- held_candidates = {p.candidate for p in cache if p.is_upgradable and
p.marked_keep}
++ held_candidates = {
++ p.candidate for p in cache
++ if p.is_upgradable and p._pkg.selected_state == apt_pkg.SELSTATE_HOLD
++ }
+ _write_upgrade_info("apt_upgrades_held", held_candidates)
+
+
diff --git a/debian/patches/series b/debian/patches/series
index f5329fc..8ee1d54 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
0001-do-not-run-apt-update-or-simulate-apt-dist-upgrade.patch
0001-report-the-apt-cache-timestamp.patch
0001-use-a-better-heuristic-for-the-apt-update-last-run-t.patch
+0001-apt_info.py-fix-apt_upgrades_pending-and-apt_upgrade.patch
--- End Message ---
--- Begin Message ---
Version: 12.9
This update has been released as part of 12.9. Thank you for your contribution.
--- End Message ---