/usr/lib/update-notifier/apt_check.py:subprocess.CalledProcessError:get_distro:_get_info_from_os_release:/usr/lib/update-notifier/apt_check.py@63:get_distro:_get_output_from_lsb_release:check_output:run

Bug #1931621 reported by errors.ubuntu.com bug bridge
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
New
Undecided
Unassigned

Bug Description

The Ubuntu Error Tracker has been receiving reports about a problem regarding update-notifier. This problem was most recently seen with package version 3.192.30.8, the problem page at https://errors.ubuntu.com/problem/4a420fb0aa23173e53e718729b33e8944f6f6ef0 contains more details, including versions of packages affected, stacktrace or traceback, and individual crash reports.
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://forms.canonical.com/reports/.

Tags: focal
Revision history for this message
Brian Murray (brian-murray) wrote :

Here's the Traceback:

Traceback (most recent call last):
  File "/usr/lib/update-notifier/apt-check", line 55, in get_distro
    return _get_info_from_os_release(key="UBUNTU_CODENAME")
  File "/usr/lib/update-notifier/apt-check", line 32, in _get_info_from_os_release
    raise Exception(
Exception: Could not find UBUNTU_CODENAME in /etc/os-release

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/update-notifier/apt-check", line 63, in <module>
    DISTRO = get_distro()
  File "/usr/lib/update-notifier/apt-check", line 60, in get_distro
    return _get_output_from_lsb_release("-c")
  File "/usr/lib/update-notifier/apt-check", line 47, in _get_output_from_lsb_release
    return subprocess.check_output(
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['lsb_release', '-c', '-s']' returned non-zero exit status 1.

Revision history for this message
Lucas Albuquerque Medeiros de Moura (lamoura) wrote :

Hi Brian, do you have any suggestions about what could be done here ? It seems that the problem occurred on both the /etc/os-release file and the lsb_release command.

I don't think there is anything else we can do on that situation right ?

Revision history for this message
Brian Murray (brian-murray) wrote :

Looking at the code I guess raising an Exception here could be useful but it ends up preventing a flavor from using apt-check and that doesn't seem great. What would the negative consequences be of not raising and exception and having DISTRO be empty?

Revision history for this message
Lucas Albuquerque Medeiros de Moura (lamoura) wrote :

We use the distro information all over the code, for example, to perform the check if a package is from a security pocket or if it is an ESM package.

We also use the distro to correctly select the ESM messages we will deliver to the user

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.