[Bug 1943638] Re: apt_check.py crashes with exception "AttributeError"

No Spam 1943638 at bugs.launchpad.net
Wed Sep 15 17:59:31 UTC 2021


As a simple solution, I added a "try ... except" block around line 150.
This solved the issue.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-notifier in Ubuntu.
https://bugs.launchpad.net/bugs/1943638

Title:
  apt_check.py crashes with exception "AttributeError"

Status in update-notifier package in Ubuntu:
  New

Bug description:
  On my Ubuntu server, I received the message for quite some time (> 1 year): 
  "The list of available updates is more than a week old"

  I regularly run "apt update", so the message simply isn't true.
  After some research, I manage to identify the script "/usr/lib/update-notifier/apt-check" as the root cause.
  When executed with parameter "--human-readable", the following exception is thrown.
  Without "--human-readable", no exception is thrown.

  Traceback (most recent call last):
    File "/usr/lib/python3.8/pdb.py", line 1705, in main
      pdb._runscript(mainpyfile)
    File "/usr/lib/python3.8/pdb.py", line 1573, in _runscript
      self.run(statement)
    File "/usr/lib/python3.8/bdb.py", line 580, in run
      exec(cmd, globals, locals)
    File "<string>", line 1, in <module>
    File "/usr/lib/update-notifier/apt_check.py", line 6, in <module>
      import apt
    File "/usr/lib/update-notifier/apt_check.py", line 477, in run
      write_human_readable_summary(sys.stdout, upgrades, security_updates,
    File "/usr/lib/update-notifier/apt_check.py", line 249, in write_human_readable_summary
      esm_distro = is_esm_distro()
    File "/usr/lib/update-notifier/apt_check.py", line 150, in is_esm_distro
      DISTRO in ubuntu_distro.supported_esm()
  AttributeError: 'UbuntuDistroInfo' object has no attribute 'supported_esm'
  Uncaught exception. Entering post mortem debugging

  
  Ubuntu version: 

  # cat /etc/os-release
  NAME="Ubuntu"
  VERSION="20.04.3 LTS (Focal Fossa)"
  ID=ubuntu
  ID_LIKE=debian
  PRETTY_NAME="Ubuntu 20.04.3 LTS"
  VERSION_ID="20.04"
  HOME_URL="https://www.ubuntu.com/"
  SUPPORT_URL="https://help.ubuntu.com/"
  BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
  PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
  VERSION_CODENAME=focal
  UBUNTU_CODENAME=focal

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1943638/+subscriptions




More information about the foundations-bugs mailing list