[SRU] /usr/bin/update-manager:TypeError:_on_finished:_action_done:get_deb2snap_dups:_on_finished:_action_done:get_deb2snap_dups

Bug #1880987 reported by errors.ubuntu.com bug bridge
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Fix Released
High
Marcus Tomlinson
Focal
Fix Released
High
Marcus Tomlinson

Bug Description

[Impact]

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

[Test Case]

This is reproducable by raising an AssertionError during the initialization of MyCache in "UpdateManager/backend/__init__.py" whereby the cache is then assigned to None:

        except Exception as e:
            logging.debug("error reading cache (%s)" % e)
            cache = None

[Regression Potential]

Instead of assigning the cache to None and attempting to continue the duplicates check, we now just return an empty array. It's perfectly safe to postpone this duplicates check to a later update, so there's little regression potential as far as I can see.

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

Here's the Traceback:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/InstallBackendAptdaemon.py", line 236, in _on_finished
    self._action_done(action,
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/__init__.py", line 319, in _action_done
    self.window_main.duplicate_packages = self.get_deb2snap_dups()
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/__init__.py", line 125, in get_deb2snap_dups
    if (deb in cache and cache[deb].is_installed):
TypeError: argument of type 'NoneType' is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/InstallBackendAptdaemon.py", line 244, in _on_finished
    self._action_done(action,
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/__init__.py", line 319, in _action_done
    self.window_main.duplicate_packages = self.get_deb2snap_dups()
  File "/usr/lib/python3/dist-packages/UpdateManager/backend/__init__.py", line 125, in get_deb2snap_dups
    if (deb in cache and cache[deb].is_installed):
TypeError: argument of type 'NoneType' is not iterable

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

This is reproducable by raising an AssertionError in the initialization of MyCache and looks like a problem with "UpdateManager/backend/__init__.py" carrying on when cache is set to None. Here are the lines of code I'm looking at:

        except Exception as e:
            logging.debug("error reading cache (%s)" % e)
            cache = None

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Thanks for the info Brian. I’ll try prep a fix for this tomorrow.

Changed in update-manager (Ubuntu):
assignee: nobody → Marcus Tomlinson (marcustomlinson)
importance: Undecided → High
status: New → Triaged
Changed in update-manager (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
update-manager (1:20.04.12) groovy; urgency=medium

  * Fix hang in apturl-gtk. (LP: #1874591)
  * Fix crash in snap updates when refreshing the cache fails. (LP: #1880987)

 -- Marcus Tomlinson <email address hidden> Thu, 28 May 2020 10:11:51 +0100

Changed in update-manager (Ubuntu):
status: In Progress → Fix Released
description: updated
summary: - /usr/bin/update-
+ [SRU] /usr/bin/update-
manager:TypeError:_on_finished:_action_done:get_deb2snap_dups:_on_finished:_action_done:get_deb2snap_dups
description: updated
Changed in update-manager (Ubuntu Focal):
assignee: nobody → Marcus Tomlinson (marcustomlinson)
importance: Undecided → High
status: New → In Progress
description: updated
description: updated
Changed in update-manager (Ubuntu Bionic):
status: New → Confirmed
Changed in update-manager (Ubuntu Eoan):
status: New → Confirmed
Changed in update-manager (Ubuntu Eoan):
status: Confirmed → Invalid
Changed in update-manager (Ubuntu Bionic):
status: Confirmed → Invalid
no longer affects: update-manager (Ubuntu Eoan)
no longer affects: update-manager (Ubuntu Bionic)
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

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

Accepted update-manager into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-manager/1:20.04.10.1 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-manager (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Brian Murray (brian-murray) wrote :

Looking at the bucket for this crash at errors.ubuntu.com I only see a couple of instances of this crash with the version of the package from -proposed and those are likely noise. So I'm setting this to verification-done.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
update-manager (1:20.04.10.1) focal; urgency=medium

  * UpdateManager/UpdateManager.py: when refreshing the cache and encountering
    an error return rather than trying to use the undefined cache which causes
    crashes. Additionally, don't present the dialog with a "Try Again" button
    which won't do anything. (LP: #1826213)
  * Fix hang in apturl-gtk. (LP: #1874591)
  * Fix crash in snap updates when refreshing the cache fails. (LP: #1880987)

 -- Brian Murray <email address hidden> Wed, 03 Jun 2020 10:18:00 -0700

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

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.