← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 2004130] Re: esm-cache.service throw apt.cache.FetchFailedException when connecting to https://esm.ubuntu.com fails

 

This bug was fixed in the package ubuntu-advantage-tools -
27.13.3~23.04.1

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

  * d/ubuntu-advantage-tools.preinst: (LP: #2004279)
    - correct second set of md5sums to continue avoiding a dpkg conf prompt
      if the only change to the original config file was to the apt_news flag
    - restore correct default uaclient.conf when upgrading from 27.13.X and
      the only conf change is apt_news
  * esm-cache.service:
    - Catch errors when esm.ubuntu.com is unreachable to avoid causing crash
      reports and degraded systemd status from this non-critical service
      (LP: #2004130)

 -- Grant Orndorff <grant.orndorff@xxxxxxxxxxxxx>  Mon, 30 Jan 2023
09:34:43 -0500

** Changed in: ubuntu-advantage-tools (Ubuntu Lunar)
       Status: In Progress => 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/2004130

Title:
  esm-cache.service throw apt.cache.FetchFailedException when connecting
  to https://esm.ubuntu.com fails

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

Bug description:
  [Impact]
  Users who have systems that cannot reach esm.ubuntu.com for any reason will get crash reports and degraded systemd status from a failed esm-cache.service.

  This could result in alerts from monitoring setups on servers as well
  as crash report pop-ups on desktops.

  The service itself is non-critical so its okay for esm.ubuntu.com to
  be unreachable, but the alerts and pop-ups are concerning nonetheless.

  [Test Case]
  On a machine with ubuntu-advantage-tools 27.13.1 or 27.13.2
  make esm.ubuntu.com unreachable
  then
  ```
  apt update
  systemctl --failed
  ll /var/crash
  ```
  You'll see that esm-cache.service failed and that it created a crash file in /var/crash.

  To test the fix:
  Install 27.13.3
  ```
  apt update
  systemctl --failed
  ll /var/crash
  ```
  esm-cache.service should succeed and there should be no new crash reports

  We are creating an automated test for this scenario, which will run on
  all future SRUs of ubuntu-advantage-tools. This test will be used for
  verification of this SRU.

  GH PR that introduces the fix and automated test:
  https://github.com/canonical/ubuntu-advantage-client/pull/2404

  [Regression Potential]
  If we made a mistake in editing esm-cache.service, we could catch this error but introduce a new one in the same service, which would result in the same symptoms.

  [Discussion]
  After this change, failures in esm-cache.service will not be as visible so machines may not receive messages about potential esm updates and they won't receive any noticeable indication that they are missing out on these messages.

  This is deemed acceptable since the messages are not critical to a
  functioning system and if esm.ubuntu.com is blocked, then the system
  won't be able to download the updates themselves anyway.

  [Original Description]
  Since u-a-t version 27.13.1~22.04.1, if something prevents successful connection to https://esm.ubuntu.com, the esm-cache.service will throw an exception:

  $ journalctl -o cat -u esm-cache.service
  Starting Update the local ESM caches...
  Traceback (most recent call last):
    File "/usr/lib/ubuntu-advantage/esm_cache.py", line 22, in <module>
      main(cfg)
    File "/usr/lib/ubuntu-advantage/esm_cache.py", line 11, in main
      update_esm_caches(cfg)
    File "/usr/lib/python3/dist-packages/uaclient/apt.py", line 636, in update_esm_caches
      cache.update()
    File "/usr/lib/python3/dist-packages/apt/cache.py", line 575, in update
      raise FetchFailedException()
  apt.cache.FetchFailedException
  esm-cache.service: Main process exited, code=exited, status=1/FAILURE
  esm-cache.service: Failed with result 'exit-code'.
  Failed to start Update the local ESM caches.

  This also shows as a failed unit:

  $ systemctl --failed
    UNIT              LOAD   ACTIVE SUB    DESCRIPTION
  ● esm-cache.service loaded failed failed Update the local ESM caches

  LOAD   = Reflects whether the unit definition was properly loaded.
  ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
  SUB    = The low-level unit activation state, values depend on unit type.
  1 loaded units listed.

  Additional information:

  In my case, the communication failure is because I use a HTTPS proxy
  that doesn't allow outbound connections to https://esm.ubuntu.com.

  $ apt-cache policy ubuntu-advantage-tools
  ubuntu-advantage-tools:
    Installed: 27.13.2~22.04.1
    Candidate: 27.13.2~22.04.1
    Version table:
   *** 27.13.2~22.04.1 500 (phased 0%)
          500 https://apt.sdeziel.info/archive/ubuntu jammy-updates/main amd64 Packages
          100 /var/lib/dpkg/status
       27.7~22.04.1 500
          500 https://apt.sdeziel.info/archive/ubuntu jammy/main amd64 Packages

  $ lsb_release -rd
  Description:	Ubuntu 22.04.1 LTS
  Release:	22.04

  $ uname -a
  Linux sdeziel-lemur 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

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