Score:2

apt-check / python-apt regression?

aw flag

Since beginning of February I keep seeing error messages of this kind:

E: Unknown Error: '<class 'KeyError'>' ("The cache has no package named 'linux-headers-5.4.0-144-generic:amd64'")

apt, apt-cache, aptitude ... none of them see a problem with the files that apt-check bemoans.

My problem is that we're using apt-check to ascertain figures of machines in need of an upgrade for both regular and security fixes. The monitoring stays broken until I actually run an upgrade, and I can't figure out what's stuck where.

Has anyone experienced similar issues, and, better yet, managed to figure out what's going on and fix them?

egor83 avatar
us flag
I got the same problem earlier today, in the notifications panel of my Ubuntu MATE. No solution yet.
tink avatar
aw flag
@egor83 - does your problem disappear when you run an `apt update && apt upgrade -y`?
egor83 avatar
us flag
I ran `apt update` and saw no errors related to this, but the error notification on the panel didn't go away yet. I plan to reboot soon, let's see whether it'd change anything.
egor83 avatar
us flag
Just noticed, notification is gone on its own - no reboots, or running any new commands.
tink avatar
aw flag
You're lucky then :D ... I emergency patched our monitoring script and rolled it out to all machines via ansible about an hour after posting this ;) @egor83
tink avatar
aw flag
@egor83 https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/2007311
Score:2
aw flag

I haven't found the root cause, but getting about 200 emails from cron every hour telling me that apt-check encountered a problem prompted me to find an alternative, and quickly =}

In the wrapper script that feeds the metrics to prometheus I've replaced the invocation of apt-check with the following:

/usr/bin/unattended-upgrade --dry-run -d 2>/dev/null | /usr/bin/awk 'BEGIN{sec=0;up=0}/^Checking: / {if($0~/archive:[^ ]+-security/){sec++}else{up++}}END{printf "%s;%s",up+sec,sec}'

No, it's not pretty ... but it does the job without making whiney noises.

Score:0
cn flag

Bug for this issue (backed by a customer case I filed as well for good measure): https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/2007311

Inadvertent fix of issue seems to be done via: https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/2008212

It's not pushed to Focal or Jammy yet but I'm pushing for that now in my customer support case since I have been playing wack a mole with this issue on a 300+ server fleet and it's no fun.

tink avatar
aw flag
Thanks for pointing me at the 2nd link (the first one I had already posted in the comments above yesterday) ;) ... can't wait for it to make it out into the wild - not that I need it any longer after my work-around ;) ...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.