Update-manager crashes in _show_transaction due to packages being already removed

Bug #1791931 reported by errors.ubuntu.com bug bridge on 2018-09-11
274
This bug affects 32 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
High
Balint Reczey
Xenial
Undecided
Unassigned
Bionic
Undecided
Unassigned

Bug Description

[Impact]

 * Update-manager crashes when it tries to remove a package that was already removed since update-manager refreshed its cache. A typical scenario is when the list of available packages is updated, then update-manager pops up to notify the user about the updates. The user is not in front of the screen and unattended-upgrades installs the security updates and removes unused kernels making the list of updates shown to the user outdated. User clicks "Install now" and update-manager crashes.

 * The fix obtains a fresh cache and skips package operations that would be obsolete and result an exception.

[Test Case ]

 (with Bionic's package names)
 * Install older kernel packages, downgrade a few packages and mark the kernels autoremovable:
   $ sudo eatmydata apt install -y --allow-downgrades linux-headers-4.15.0-32 linux-headers-4.15.0-32-generic libpoppler73=0.62.0-2ubuntu2 poppler-utils=0.62.0-2ubuntu2 ; sudo /etc/kernel/postinst.d/apt-auto-removal ; sudo apt-mark auto linux-headers-4.15.0-32 linux-headers-4.15.0-32-generic

 * Start update-manager in a different terminal and _don't_ start the upgrade

 * Remove kernel packages behind u-m's back:
   $ sudo eatmydata apt remove -y linux-headers-4.15.0-32

 * Start the update on update-manager's GUI and observe it not crashing with the fixed version

[Regression Potential]

 * Too eager filtering could let packages not updated/not removed, but the next run of update-manager would retry updating/removing them.
 * Obtaining a fresh cache takes a ~100 milliseconds and the GUI may freeze for that time. For this short time u-m could show itself busy but IMO it would be more disturbing than the potentially not noticeable freeze.

[Original bug text]

The Ubuntu Error Tracker has been receiving reports about a problem regarding update-manager. This problem was most recently seen with package version 1:18.04.11.4, the problem page at https://errors.ubuntu.com/problem/c4f194c0df19fca32a25eff8c633ad69fe9b5abb 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/.

Related branches

Balint Reczey (rbalint) on 2018-09-11
description: updated
Changed in update-manager (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Balint Reczey (rbalint)
summary: - /usr/bin/update-manager: Package linux-headers-4.15.0-30 isn't
- installed(org.debian.apt.TransactionFailed):_inline_callbacks:commit:_inline_callbacks:_show_transaction
+ Update-manager crashes in _show_transaction due to packages being
+ already removed
Balint Reczey (rbalint) on 2018-09-12
description: updated
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:18.10.8

---------------
update-manager (1:18.10.8) cosmic; urgency=medium

  * Print transaction error and let the user try again applying updates
    (LP: #1317164)
  * Don't ask backend to do package operations aready done.
    Aptdaemon cancels the transaction when asked to remove packages already
    removed which results the failure being shown to the user. This
    is unnecessary as update-manager can just filter the package operations to
    be done using a fresh cache and decrease the likelyhood of hitting
    a race condition where packages to be removed are already removed.
    (LP: #1791931)

 -- Balint Reczey <email address hidden> Tue, 11 Sep 2018 13:40:57 +0200

Changed in update-manager (Ubuntu):
status: In Progress → Fix Released
Download full text (3.8 KiB)

Thank You

On Thu, Sep 13, 2018 at 7:20 PM Launchpad Bug Tracker <
<email address hidden>> wrote:

> This bug was fixed in the package update-manager - 1:18.10.8
>
> ---------------
> update-manager (1:18.10.8) cosmic; urgency=medium
>
> * Print transaction error and let the user try again applying updates
> (LP: #1317164)
> * Don't ask backend to do package operations aready done.
> Aptdaemon cancels the transaction when asked to remove packages already
> removed which results the failure being shown to the user. This
> is unnecessary as update-manager can just filter the package
> operations to
> be done using a fresh cache and decrease the likelyhood of hitting
> a race condition where packages to be removed are already removed.
> (LP: #1791931)
>
> -- Balint Reczey <email address hidden> Tue, 11 Sep 2018 13:40:57 +0200
>
> ** Changed in: update-manager (Ubuntu)
> Status: In Progress => Fix Released
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1763927).
> https://bugs.launchpad.net/bugs/1791931
>
> Title:
> Update-manager crashes in _show_transaction due to packages being
> already removed
>
> Status in update-manager package in Ubuntu:
> Fix Released
>
> Bug description:
> [Impact]
>
> * Update-manager crashes when it tries to remove a package that was
> already removed since update-manager refreshed its cache. A typical
> scenario is when the list of available packages is updated, then
> update-manager pops up to notify the user about the updates. The user
> is not in front of the screen and unattended-upgrades installs the
> security updates and removes unused kernels making the list of updates
> shown to the user outdated. User clicks "Install now" and update-
> manager crashes.
>
> * The fix obtains a fresh cache and skips package operations that
> would be obsolete and result an exception.
>
> [Test Case ]
>
> (with Bionic's package names)
> * Install older kernel packages, downgrade a few packages and mark the
> kernels autoremovable:
> $ sudo eatmydata apt install -y --allow-downgrades
> linux-headers-4.15.0-32 linux-headers-4.15.0-32-generic
> libpoppler73=0.62.0-2ubuntu2 poppler-utils=0.62.0-2ubuntu2 ; sudo
> /etc/kernel/postinst.d/apt-auto-removal ; sudo apt-mark auto
> linux-headers-4.15.0-32 linux-headers-4.15.0-32-generic
>
> * Start update-manager in a different terminal and _don't_ start the
> upgrade
>
> * Remove kernel packages behind u-m's back:
> $ sudo eatmydata apt remove -y linux-headers-4.15.0-32
>
> * Start the update on update-manager's GUI and observe it not
> crashing with the fixed version
>
> [Regression Potential]
>
> * Too eager filtering could let packages not updated/not removed, but
> the next run of update-manager would retry updating/removing them.
> * Obtaining a fresh cache takes a ~100 milliseconds and the GUI may
> freeze for that time. For this short time u-m could show itself busy but
> IMO it would be more disturbing than the potentially not noticeable freeze.
>
> [Original bug text]
>
> The Ubuntu Error Tracker has been receiv...

Read more...

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

Accepted update-manager into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-manager/1:18.04.11.5 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 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-manager (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
Łukasz Zemczak (sil2100) wrote :

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

Accepted update-manager into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-manager/1:16.04.14 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 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.

Changed in update-manager (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
Balint Reczey (rbalint) on 2018-09-27
tags: added: verification-done-bionic
removed: verification-needed-bionic
Balint Reczey (rbalint) wrote :

I verified the fix with 1:18.04.11.5 and 1:16.04.14.

tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial

The verification of the Stable Release Update for update-manager has completed successfully and the package has now been 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.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:18.04.11.5

---------------
update-manager (1:18.04.11.5) bionic; urgency=medium

  * Print transaction error and let the user try again applying updates
    (LP: #1317164)
  * Don't ask backend to do package operations aready done.
    Aptdaemon cancels the transaction when asked to remove packages already
    removed which results the failure being shown to the user. This
    is unnecessary as update-manager can just filter the package operations to
    be done using a fresh cache and decrease the likelyhood of hitting
    a race condition where packages to be removed are already removed.
    (LP: #1791931)

 -- Balint Reczey <email address hidden> Mon, 17 Sep 2018 17:16:38 +0200

Changed in update-manager (Ubuntu Bionic):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:16.04.14

---------------
update-manager (1:16.04.14) xenial; urgency=medium

  * Print transaction error and let the user try again applying updates
    (LP: #1317164)
  * Don't ask backend to do package operations aready done.
    Aptdaemon cancels the transaction when asked to remove packages already
    removed which results the failure being shown to the user. This
    is unnecessary as update-manager can just filter the package operations to
    be done using a fresh cache and decrease the likelyhood of hitting
    a race condition where packages to be removed are already removed.
    (LP: #1791931)

 -- Balint Reczey <email address hidden> Wed, 19 Sep 2018 09:18:52 +0200

Changed in update-manager (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers