[Bug 2081948] Re: import current_news crashes

Nathan Teodosio 2081948 at bugs.launchpad.net
Thu Sep 26 07:05:17 UTC 2024


I believe that an edge case scenario causes this crash
in .21, namely having an old version of the ubuntu-advantage-tools and update-manager installed
and then update the former via update-manager. 

When, after being done installing the update, update-manager recalculates
the view, it tries to import current_news again[3], and I figure that it is
importing a new current_news/v1.py[1] but keeping a reference to the old
data_types.py[2] (both provided by ubuntu-advantage-tools), which does not have the doc keyword argument.

The version .23 in proposed ignores exceptions to the current_news call,
so the solution to this bug is to just wait for it to be released.

[1]https://github.com/canonical/ubuntu-pro-client/blob/main/uaclient/api/u/apt_news/current_news/v1.py
[2]https://github.com/canonical/ubuntu-pro-client/blob/main/uaclient/data_types.py#L213
[3]https://git.launchpad.net/update-manager/tree/UpdateManager/UpdatesAvailable.py?h=ubuntu/focal#n370

** Changed in: ubuntu-advantage-tools (Ubuntu)
       Status: New => Invalid

** Changed in: ubuntu-advantage-tools (Ubuntu Focal)
       Status: New => Invalid

** Changed in: update-manager (Ubuntu Focal)
     Assignee: (unassigned) => Nathan Teodosio (nteodosio)

** Changed in: update-manager (Ubuntu Focal)
       Status: Confirmed => Fix Committed

** Changed in: update-manager (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-manager in Ubuntu.
https://bugs.launchpad.net/bugs/2081948

Title:
  import current_news crashes

Status in ubuntu-advantage-tools package in Ubuntu:
  Invalid
Status in update-manager package in Ubuntu:
  Fix Released
Status in ubuntu-advantage-tools source package in Focal:
  Invalid
Status in update-manager source package in Focal:
  Fix Committed

Bug description:
  Traceback (most recent call last):
    File "/usr/bin/update-manager", line 118, in <module>
      app.start_update()
    File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 223, in start_update
      self.start_available()
    File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 246, in start_available
      pane = self._make_available_pane(self.cache.install_count
    File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 320, in _make_available_pane
      return UpdatesAvailable(self, header, desc, need_reboot)
    File "/usr/lib/python3/dist-packages/UpdateManager/UpdatesAvailable.py", line 371, in __init__
      from uaclient.api.u.apt_news.current_news.v1 import current_news
    File "/usr/lib/python3/dist-packages/uaclient/api/u/apt_news/current_news/v1.py", line 10, in <module>
      class CurrentNewsResult(DataObject, AdditionalInfo):
    File "/usr/lib/python3/dist-packages/uaclient/api/u/apt_news/current_news/v1.py", line 12, in CurrentNewsResult
      Field(
  TypeError: __init__() got an unexpected keyword argument 'doc'

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

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/2081948/+subscriptions




More information about the foundations-bugs mailing list