Show reason of TransactionFailed and let the user try again instead of crashing

Bug #1317164 reported by Brian Murray on 2014-05-07
This bug affects 134 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
High
Unassigned
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 shows the reason of the transaction failure then asks offers the user to try again.

[Test Case ]
 (with Bionic's package names)

 * Revert the patch for LP: #1791931 since it shadows the issue by filtering the package operations in advance.

 * 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 but showing the reason of the update failing and offering trying it again.

[Regression Potential]

 * Inaccurate exception handling could shadow other problems.

[Original bug text]

On errors.ubuntu.com there are multiple crashes reported about update-manager that end in a Traceback like the following:

aptdaemon.errors.TransactionFailed: Transaction failed: The package system is broken
 The following packages have unmet dependencies:

rhythmbox-plugin-magnatune: Depends: rhythmbox (= 3.0.2-0ubuntu2) but 3.0.2-0ubuntu1 is installed

Naturally, the package name varies. I don't believe these are actually crashes about update-manager or aptdaemon. Rather there is something wrong with the users package system. Subsequently, it'd be better if these were not reported to the error tracker and clogging up the bug lists.

Related branches

tags: added: trusty utopic
Changed in update-manager (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-14.10
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in update-manager (Ubuntu):
status: New → Confirmed

The bug report being referred to is bug #1097946 software-center crashed with TransactionFailed in _run_transaction(): <unprintable TransactionFailed object>

Changed in update-manager (Ubuntu):
milestone: ubuntu-14.10 → ubuntu-15.04
tags: added: rls-v-incoming
tags: added: rls-v-notfixing
removed: rls-v-incoming
Martin Pitt (pitti) on 2015-04-20
Changed in update-manager (Ubuntu):
milestone: ubuntu-15.04 → vivid-updates
Brian Murray (brian-murray) wrote :

Thinking about this some more I think there is actually something wrong here, possibly people trying to install updates who have an outdated package list, and that we should not mask these issue by not reporting them.

Changed in update-manager (Ubuntu):
milestone: vivid-updates → none
peterstan (stasnel) on 2015-08-22
Changed in update-manager (Ubuntu):
status: Confirmed → Fix Released
Changed in update-manager (Ubuntu):
status: Fix Released → Confirmed
tags: added: id-5b97ab08c18adb87fe7517e3
Balint Reczey (rbalint) on 2018-09-12
Changed in update-manager (Ubuntu):
status: Confirmed → In Progress
summary: - update-manager / aptdaemon TransactionFailed crashes are not problems
- with update-manager
+ Show reason of TransactionFailed and let the user try again instead of
+ crashing
Balint Reczey (rbalint) on 2018-09-12
description: updated
Balint Reczey (rbalint) on 2018-09-13
Changed in update-manager (Ubuntu):
status: In Progress → Fix Committed
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: Fix Committed → Fix Released
Download full text (3.2 KiB)

Thanks for the update. IT was my error / I never believe, i would get a
reply.

On Thu, Sep 13, 2018 at 11:25 AM Balint Reczey <email address hidden>
wrote:

> ** Changed in: update-manager (Ubuntu)
> Status: In Progress => Fix Committed
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1764746).
> https://bugs.launchpad.net/bugs/1317164
>
> Title:
> Show reason of TransactionFailed and let the user try again instead of
> crashing
>
> Status in update-manager package in Ubuntu:
> Fix Committed
>
> 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 shows the reason of the transaction failure then asks
> offers the user to try again.
>
> [Test Case ]
> (with Bionic's package names)
>
> * Revert the patch for LP: #1791931 since it shadows the issue by
> filtering the package operations in advance.
>
> * 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 but showing the reason of the update
> failing and offering trying it again.
>
> [Regression Potential]
>
> * Inaccurate exception handling could shadow other problems.
>
> [Original bug text]
>
> On errors.ubuntu.com there are multiple crashes reported about update-
> manager that end in a Traceback like the following:
>
> aptdaemon.errors.TransactionFailed: Transaction failed: The package
> system is broken
> The following packages have unmet dependencies:
>
> rhythmbox-plugin-magnatune: Depends: rhythmbox (= 3.0.2-0ubuntu2) but
> 3.0.2-0ubuntu1 is installed
>
> Naturally, the package name varies. I don't believe these are actually
> crashes about update-manager or aptdaemon. Rather there is something
> wrong with the users package system. Subsequently, it'd be better if
> these were not reported to the error tracker and clogging up the bug
> lists.
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1317164/+subscriptions
>

--
*GOD BLESS AMERICA**! ...

Read more...

Hello Brian, 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 Brian, 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) wrote :

I verified the fix with 1:18.04.11.5.

tags: added: verification-done-bionic
removed: verification-needed-bionic
Balint Reczey (rbalint) wrote :

I verified the fix on Xenial with update-manager (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.