/usr/lib/update-notifier/list-oem-metapackages:apt_pkg.Error:/usr/lib/update-notifier/list-oem-metapackages@43:__init__:open

Bug #1913726 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
Iain Lane
Focal
Fix Released
Undecided
Iain Lane

Bug Description

[ Description ]

If you have malformed apt lists, list-oem-metapackages, a script which update-notifier runs before it launches update-manager, can crash.

[ Fix ]

Catch failures to construct an apt.Cache object and exit.

[ QA ]

1. Edit a list file in /var/lib/apt/lists which is being used - for example that for the Ubuntu archive's 'main' component.
2. Type some gibberish at the top.
3. Run /usr/lib/update-notifier/list-oem-metapackages as a regular user.
4. When using the current version of update-notifier this should crash. After updating it should print an error and exit 0.
5. Now you can `apt update` or revert what you did in step 2 manually.

[ Where problems could occur ]

We're proceeding to run update-manager now when we know that apt is in a bogus state. This was the status quo for a long time before the recent update which introduced list-oem-metapackages, but we could maybe do something different there.

[ Original 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.38, the problem page at https://errors.ubuntu.com/problem/e8eeed367adc9f2602fec155d19013736a59b99c 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/.

Traceback (most recent call last):
  File "/usr/lib/update-notifier/list-oem-metapackages", line 43, in <module>
    cache = apt.Cache()
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 170, in __init__
    self.open(progress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 232, in open
    self._cache = apt_pkg.Cache(progress)
apt_pkg.Error: E:can not open /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_focal_InRelease - fopen (13: Permission denied), E:The package lists or status file could not be parsed or opened.

Iain Lane (laney)
description: updated
description: updated
Changed in update-notifier (Ubuntu):
status: New → In Progress
assignee: nobody → Iain Lane (laney)
Changed in update-notifier (Ubuntu Focal):
status: New → In Progress
assignee: nobody → Iain Lane (laney)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  * data/list-oem-metapackages:
    + Run black
    + Drop unused logging import
    + Handle bad apt indexes. apt.Cache() can fail if the apt lists can't be
      parsed for whatever reason. Handle that and exit 0 so that
      update-notifier continues. A consequence of being in this state is that
      we can't find any oem metapackages if any are applicable. If the indexes
      become good again then we'll find them next time. (LP: #1913726)

 -- Iain Lane <email address hidden> Fri, 29 Jan 2021 12:41:07 +0000

Changed in update-notifier (Ubuntu):
status: In Progress → Fix Released
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 focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.192.30.6 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: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (update-notifier/3.192.30.6)

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

update-manager/1:20.04.10.5 (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
Iain Lane (laney) wrote :

I just verified following the QA procedure I outlined in the description.

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

Next time also include the version number of the package that has been tested! But otherwise, it's all good.

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.6

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

  * data/list-oem-metapackages:
    + Handle bad apt indexes. apt.Cache() can fail if the apt lists can't be
      parsed for whatever reason. Handle that and exit 0 so that
      update-notifier continues. A consequence of being in this state is that
      we can't find any oem metapackages if any are applicable. If the indexes
      become good again then we'll find them next time. (LP: #1913726)

 -- Iain Lane <email address hidden> Fri, 29 Jan 2021 12:51:36 +0000

Changed in update-notifier (Ubuntu Focal):
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.