← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 2007234] Re: /usr/lib/ubuntu-advantage/esm_cache.py:ModuleNotFoundError:/usr/lib/ubuntu-advantage/esm_cache.py@5:/usr/lib/python3/dist-packages/uaclient/apt.py@13:/usr/lib/python3/dist-packages/uaclient/event_logger.py@14

 

This bug was fixed in the package ubuntu-advantage-tools - 27.14.4~20.04

---------------
ubuntu-advantage-tools (27.14.4~20.04) focal; urgency=medium

  * Backport new upstream release: (LP: #2011477) to focal

ubuntu-advantage-tools (27.14.4) lunar; urgency=medium

  * timer: disable update_contract_info job (LP: #2015302)
  * livepatch: prevent livepatch from auto-enabling and subsequently failing
    on non-amd64 systems (LP: #2015241)

ubuntu-advantage-tools (27.14.3) lunar; urgency=medium

  * livepatch: prevent livepatch from auto-enabling and subsequently failing
    on interim releases (LP: #2013409)

ubuntu-advantage-tools (27.14.2~23.04.1) lunar; urgency=medium

  * status:
    - always use dpkg instead of lscpu for fetching architecture
      information (LP: #2012735)

ubuntu-advantage-tools (27.14.1~23.04.1) lunar; urgency=medium

  * New upstream release 27.14.1
    - apt: fix a configuration leak in the apt.get_pkg_candidate_version
      function (LP: #2012642)

ubuntu-advantage-tools (27.14~23.04.1) lunar; urgency=medium

  * d/ubuntu-advantage-tools.{postinst,postrm,preinst}:
    - migrate certain settings out of uaclient.conf to a new file managed by
      the pro config subcommand (LP: #2004280)
  * d/ubuntu-advantage-tools.postinst:
    - refactor PREVIOUS_PKG_VER as a global variable
    - simplify how we add notices
  * New upstream release 27.14 (LP: #2011477)
    - api: new u.unattended_upgrades.status.v1 endpoint for querying status of
      unattended upgrades
    - apt:
      + remove legacy apt-hook
      + deliver json apt-hook for interim releases
      + fix cloud identification logic in json apt-hook
      + make all calls to esm-cache isolated from system configuration
        (LP: #2008280)
      + only set up the esm cache on supported systems (LP: #2004018)
    - fix:
      + format the output to be more readable (LP: #1926182)
      + add option to attach during a fix without a token
      + verify if fixed version can be installed before trying (LP: #2006705)
    - livepatch: show warning if current kernel is not supported
    - locks: alert user about corrupted lock files (LP: #1996931)
    - logging: logs are now formatted as jsonlines
    - motd: remove esm-apps announcement
    - notices: new representation on disk as separate files (LP: #1987738)
    - realtime: remove ubuntu-realtime package on disablement
    - status:
      + removed contract info update check network call
      + no longer includes warnings about notices when non-root (LP: #2006138)
      + unattached status sends virt type to contract server for better
        resource availability calculation
    - timer jobs: add daily job to check for contract updates
    - yaml: always import distro-provided pyyaml (LP: #2007234, LP: #2007241)

 -- Renan Rodrigo <renanrodrigo@xxxxxxxxxxxxx>  Thu, 06 Apr 2023
10:48:25 -0300

** Changed in: ubuntu-advantage-tools (Ubuntu Jammy)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/2007234

Title:
  /usr/lib/ubuntu-
  advantage/esm_cache.py:ModuleNotFoundError:/usr/lib/ubuntu-
  advantage/esm_cache.py@5:/usr/lib/python3/dist-
  packages/uaclient/apt.py@13:/usr/lib/python3/dist-
  packages/uaclient/event_logger.py@14

Status in ubuntu-advantage-tools package in Ubuntu:
  Fix Released
Status in ubuntu-advantage-tools source package in Xenial:
  Fix Released
Status in ubuntu-advantage-tools source package in Bionic:
  Fix Released
Status in ubuntu-advantage-tools source package in Focal:
  Fix Released
Status in ubuntu-advantage-tools source package in Jammy:
  Fix Released
Status in ubuntu-advantage-tools source package in Kinetic:
  Fix Released

Bug description:
  [Impact]
  If python3 was able to import uaclient but unable to import yaml for some reason, pro client processes would crash.

  ubuntu-advantage-tools depends on python3-yaml, so we consider the
  case where python3-yaml is not installed or corrupted to be
  unsupportable by u-a-t (though it may be indicative of a bug or error
  somewhere else).

  In the case where python3-yaml is installed properly, but the user's
  python environment is set up in such a way that it isn't seen by a
  normal `import yaml`, then we can mitigate the issue. We will log an
  error and exit when yaml is not found, avoiding a crash and autoamatic
  error reports.

  [Test Case]
  In a container, set up a contrived python environment where it can see uaclient and apt but not yaml:
  ```
  apt update
  apt install python3-venv
  python3 -m venv env
  source ./env/bin/activate
  ln -s /usr/lib/python3/dist-packages/uaclient ./env/lib/python3.10/site-packages/uaclient
  ln -s /usr/lib/python3/dist-packages/apt ./env/lib/python3.10/site-packages/apt
  ln -s /usr/lib/python3/dist-packages/apt_pkg.cpython-310-x86_64-linux-gnu.so ./env/lib/python3.10/site-packages/apt_pkg.cpython-310-x86_64-linux-gnu.so
  python3 /usr/lib/ubuntu-advantage/esm_cache.py
  systemctl start esm-cache.service
  ```
  (Note that the python version will be different on different Ubuntu releases)
  Before the fix, that last commands will fail because u-a-t cannot import yaml.
  After the fix, it will log an error, return 1, and no crash will be present in /var/crash related to this.

  [Regression Potential]
  The fix relies on importing yaml functionality from uaclient.yaml - if in any code we import directly from yaml, it will bypass this fix and fail in the same scenario as this bug does. We need to pay attention to not import yaml directly in any other module.

  The fix involves re-exporting the yaml functions, if we missed an
  export that another piece of code relies on, then that would cause an
  unhandled exception.

  [Discussion]
  Until recently our position had been: non-standard python install -> unsupported. This fix is deals with the error in a best-effort implementation to avoid crashes and automatic reports from errors.ubuntu.com, which can block phasing for no reason.

  [Original Description]

  The Ubuntu Error Tracker has been receiving reports about a problem regarding ubuntu-advantage-tools.  This problem was most recently seen with package version 27.13.5~20.04.1, the problem page at https://errors.ubuntu.com/problem/3861dcce5f1d6eda3eb34e1e201e2e517c6a8c37 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/2007234/+subscriptions