/usr/lib/update-notifier/apt_check.py:FileNotFoundError:/usr/lib/update-notifier/apt_check.py@16:check_output:run:__init__:_execute_child

Bug #1927996 reported by errors.ubuntu.com bug bridge
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
Fix Released
Undecided
Brian Murray
Xenial
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Hirsute
Fix Released
Undecided
Unassigned

Bug Description

update-notifier-common does not depend on lsb-release and both apt_check.py and apt-cdrom-check both utilize lsb_release.

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.40.1, the problem page at https://errors.ubuntu.com/problem/b26aeaa1e162c894747c195ce1b13a70c981e3eb 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/.

--------------------------------------------------------------------------

[Impact]
Because update-notifier does not explicit have the `lsb-release` package as a dependency, users may install the package and rely on `apt-cdrom-check` to work, but it will fail, since it runs
the `lsb_release -sr` command on it.

[Test case]

To reproduce the issue:

1. Launch a xenial container
2. Install update-notifier on it
3. Run apt-cache depends update-notifier-common
4. Verify that lsb-release does not appear

To verify that the error is fixed:

1. Install the new update-notifier from this ppa:
https://launchpad.net/~lamoura/+archive/ubuntu/update-notifier-test-ppa/
2. Run apt-cache depends update-notifier-common
3. Verify that lsb-release will now appear as a dependency

[Where problems could occur]

We are only adding a missing dependency to the package. I cannot think of a problem that this might cause to the users of this package.

[Discussion]

We can verify that `apt-cdrom-check` does make use of the `lsb_release` command. Since we don't have that dependency on the package control file, errors can appear when users are executing/relying on that script.

Related branches

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 16, in <module>
    DISTRO = subprocess.check_output(
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'lsb_release'

description: updated
description: updated
Changed in update-notifier (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.192.44

---------------
update-notifier (3.192.44) impish; urgency=medium

  [ Lucas Moura ]
  * data/apt_check.py
    - Show esm-apps status header when running on LTS distro that
      has not yet entered Extended Security Maintenance

 -- Brian Murray <email address hidden> Thu, 13 May 2021 14:47:01 -0700

Changed in update-notifier (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Lucas Albuquerque Medeiros de Moura (lamoura) wrote :

[Impact]
Because update-notifier does not explicit have the `lsb-release` package as a dependency, users may install the package and rely on `apt-cdrom-check` to work, but it will fail, since it runs
the `lsb_release -sr` command on it.

[Test case]

To reproduce the issue:

1. Launch a xenial container
2. Install update-notifier on it
3. Run apt-cache depends update-notifier-common
4. Verify that lsb-release does not appear

To verify that the error is fixed:

1. Install the new update-notifier from this ppa:
https://launchpad.net/~lamoura/+archive/ubuntu/update-notifier-test-ppa/
2. Run apt-cache depends update-notifier-common
3. Verify that lsb-release will now appear as a dependency

[Where problems could occur]

We are only adding a missing dependency to the package. I cannot think of a problem that this might cause to the users of this package.

[Discussion]

We can verify that `apt-cdrom-check` does make use of the `lsb_release` command. Since we don't have that dependency on the package control file, errors can appear when users are executing/relying on that script.

description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello errors.ubuntu.com, or anyone else affected,

Accepted update-notifier into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.192.40.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in update-notifier (Ubuntu Hirsute):
status: New → Fix Committed
tags: added: verification-needed verification-needed-hirsute
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello errors.ubuntu.com, or anyone else affected,

Accepted update-notifier into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.192.30.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in update-notifier (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello errors.ubuntu.com, or anyone else affected,

Accepted update-notifier into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.192.1.11 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in update-notifier (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed-bionic
Changed in update-notifier (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello errors.ubuntu.com, or anyone else affected,

Accepted update-notifier into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.168.15 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (update-notifier/3.192.40.3)

All autopkgtests for the newly accepted update-notifier (3.192.40.3) for hirsute have finished running.
The following regressions have been reported in tests triggered by the package:

update-manager/1:21.04.10 (amd64, s390x, armhf, arm64, ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/hirsute/update_excuses.html#update-notifier

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (update-notifier/3.192.30.8)

All autopkgtests for the newly accepted update-notifier (3.192.30.8) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

update-manager/1:20.04.10.7 (s390x, amd64, ppc64el, armhf, arm64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#update-notifier

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (update-notifier/3.192.1.11)

All autopkgtests for the newly accepted update-notifier (3.192.1.11) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

update-manager/1:18.04.11.13 (i386, s390x, arm64, armhf, ppc64el, amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#update-notifier

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Lucas Albuquerque Medeiros de Moura (lamoura) wrote :
Download full text (4.7 KiB)

I can confirm that the xenial, bionic, focal and hirsute packages are working as expected.

To perform the verification I have used the following script:

--------------------------------------
#!/bin/sh
set -x

series=xenial
name=$series-dev

function generate_motd_message() {
    message=$1
    echo "-----------------------------------------------------------"
    echo $message
    lxc exec $name -- /usr/lib/update-notifier/update-motd-updates-available --force
    lxc exec $name -- update-motd
    echo "-----------------------------------------------------------"
}

function turn_distro_into_esm_mode() {
    # guarantee that xenial distro is on ESM mode
    lxc exec $name -- sed -i 's/is_esm_supported and is_not_currently_supported/True #comment/' /usr/lib/update-notifier/apt-check
}

function turn_distro_into_non_esm_mode() {
    # guarantee that xenial distro is on ESM mode
    lxc exec $name -- sed -i 's/True #comment/False/' /usr/lib/update-notifier/apt-check
}

function setup_update_notifier() {
    lxc exec $name -- sh -c "cat <<EOF >/etc/apt/sources.list.d/ubuntu-$series-proposed.list
    deb http://archive.ubuntu.com/ubuntu/ $series-proposed restricted main multiverse universe"
    lxc exec $name -- apt update
    lxc exec $name -- sh -c "apt install update-notifier -yq > /dev/null"
}

function install_ua_from_branch() {
    lxc exec $name --cwd /var/tmp/uac -- apt-get update
    lxc exec $name --cwd /var/tmp/uac -- apt-get install make
    lxc exec $name -- git clone https://github.com/canonical/ubuntu-advantage-client.git /var/tmp/uac
    lxc exec $name --cwd /var/tmp/uac -- sh -c "make deps > /dev/null"
    lxc exec $name --cwd /var/tmp/uac -- sh -c "DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc > /dev/null"
    lxc exec $name -- apt-get remove ubuntu-advantage-tools --assume-yes
    lxc exec $name --cwd /var/tmp/uac -- dpkg -i /var/tmp/ubuntu-advantage-tools_27.0_amd64.deb
    lxc exec $name -- ua version
}

function install_ua() {
    lxc exec $name -- add-apt-repository ppa:ua-client/daily -y
    lxc exec $name -- sudo apt-get update
    lxc exec $name -- sudo apt-get install ubuntu-advantage-tools -y
    lxc exec $name -- ua version
    lxc exec $name -- sudo apt-get update
}

function ua_disable_esm_apps() {
    lxc exec $name -- sudo ua disable esm-apps
}

function install_all_upgrades() {
    lxc exec $name -- sudo sh -c "apt update > /dev/null"
    lxc exec $name -- sudo sh -c "apt upgrade -y > /dev/null"
}

function ua_attach() {
    lxc exec $name -- sed -i 's/contracts.can/contracts.staging.can/' /etc/ubuntu-advantage/uaclient.conf
    lxc exec $name -- ua attach $UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING
}

function ua_detach() {
    lxc exec $name -- ua detach --assume-yes
}

function generate_ua_motd_messages() {
    lxc exec $name -- python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py
}

function install_update_motd() {
    lxc exec $name -- apt install update-motd -yq
}

function turn_esm_apps_into_non_beta() {
    lxc exec $name -- sh -c "echo 'features:\n allow_beta: true' >> /etc/ubuntu-advantage/uaclient.conf"
}

function update_contract_effectiveto() {
    operation=$1
    num_days=$2
    replace_d...

Read more...

tags: added: verification-done verification-done-bionic verification-done-focal verification-done-hirsute verification-done-xenial
removed: verification-needed verification-needed-bionic verification-needed-focal verification-needed-hirsute verification-needed-xenial
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hey Lucas! What package versions did you use? Were those from the ubuntu archives? Since I see the instructions still mention using the PPA while for testing we need to use the archive packages.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.192.40.3

---------------
update-notifier (3.192.40.3) hirsute; urgency=medium

  * debian/control: add lsb-release to the update-notifier-common depends as
    it is used by apt-cdrom-check. (LP: #1927996)
  * data/apt_check.py
    - Only show esm-apps alerts on lts and non-esm distros (LP: #1926990)
    - Update esm-infra alert for distros on ESM mode
    - Show message with number of upgradable packages even if that
      number is zero (LP: #1926819)
    - Get distro name and version directly from /etc/os-release
    - Fallback to lsb_release command if there are any problems using
      /etc/os-release as source of information
    - Show esm-apps status header when running on LTS distro that
      has not yet entered Extended Security Maintenance

 -- Lucas Moura <email address hidden> Fri, 14 May 2021 16:41:27 -0300

Changed in update-notifier (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for update-notifier has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.192.30.8

---------------
update-notifier (3.192.30.8) focal; urgency=medium

  * debian/control: add lsb-release to the update-notifier-common depends as
    it is used by apt-cdrom-check. (LP: #1927996)
  * data/apt_check.py
    - Only show esm-apps alerts on lts and non-esm distros (LP: #1926990)
    - Update esm-infra alert for distros on ESM mode
    - Show message with number of upgradable packages even if that
      number is zero (LP: #1926819)
    - Get distro name and version directly from /etc/os-release
    - Fallback to lsb_release command if there are any problems using
      /etc/os-release as source of information
    - Show esm-apps status header when running on LTS distro that
      has not yet entered Extended Security Maintenance

 -- Lucas Moura <email address hidden> Fri, 14 May 2021 16:02:18 -0300

Changed in update-notifier (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.192.1.11

---------------
update-notifier (3.192.1.11) bionic; urgency=medium

  * debian/control: add lsb-release to the update-notifier-common depends as
    it is used by apt-cdrom-check. (LP: #1927996)
  * data/apt_check.py
    - Only show esm-apps alerts on lts and non-esm distros (LP: #1926990)
    - Update esm-infra alert for distros on ESM mode
    - Show message with number of upgradable packages even if that
      number is zero (LP: #1926819)
    - Get distro name and version directly from /etc/os-release
    - Fallback to lsb_release command if there are any problems using
      /etc/os-release as source of information
    - Show esm-apps status header when running on LTS distro that
      has not yet entered Extended Security Maintenance

 -- Lucas Moura <email address hidden> Fri, 14 May 2021 15:43:17 -0300

Changed in update-notifier (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.168.15

---------------
update-notifier (3.168.15) xenial; urgency=medium

  * debian/control: add lsb-release to the update-notifier-common depends as
    it is used by apt-cdrom-check. (LP: #1927996)
  * data/apt_check.py
    - Only show esm-apps alerts on lts and non-esm distros (LP: #1926990)
    - Update esm-infra alert for distros on ESM mode
    - Show message with number of upgradable packages even if that
      number is zero (LP: #1926819)
    - Get distro name and version directly from /etc/os-release
    - Fallback to lsb_release command if there are any problems using
      /etc/os-release as source of information
    - Show esm-apps status header when running on LTS distro that
      has not yet entered Extended Security Maintenance

 -- Lucas Moura <email address hidden> Fri, 14 May 2021 15:00:04 -0300

Changed in update-notifier (Ubuntu Xenial):
status: Fix Committed → Fix Released
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.