← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 2074211] Re: Consider hiding error messages in apt-news.service to avoid being percived as "pro is broken"

 

This bug was fixed in the package ubuntu-advantage-tools - 34~18.04

---------------
ubuntu-advantage-tools (34~18.04) bionic; urgency=medium

  * Backport 34 to bionic (LP: #2075543)

ubuntu-advantage-tools (34) oracular; urgency=medium

  * d/rules: check that version.py is consistent with changelog (GH: #3154)
  * New upstream release 34: (LP: #2075543)
    - apt-hook: redirect errors away from users (LP: #2074211, LP: #2055239)
    - detach: ensure apt bearer tokens are always cleaned up
    - fips-preview: add warnings and prompts similar to fips and fips-updates
    - fips and realtime-kernel: add warning when the new kernel may have
      different hardware support than the current kernel based on the flavor
      (GH: #3115)
    - fix: use more reliable api query param when looking up CVE fixes
    - help:
      + change help output for base pro command
      + remove service descriptions from output (GH: #3126)
      + show help content when run without a subcommand
    - timer: recover from corrupted job status file (LP: #2078737)
    - update manpage

 -- Grant Orndorff <grant.orndorff@xxxxxxxxxxxxx>  Fri, 06 Sep 2024
19:58:19 -0400

** Changed in: ubuntu-advantage-tools (Ubuntu Xenial)
       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/2074211

Title:
  Consider hiding error messages in apt-news.service to avoid being
  percived as "pro is broken"

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 Noble:
  Fix Released
Status in ubuntu-advantage-tools source package in Oracular:
  Fix Released

Bug description:
  [ Impact ]
  When bugs unrelated to ubuntu-pro-client affect the apt-hooks in such a way that they print warning or error messages, ubuntu-pro-client is percieved to be at fault. Usually these warnings and errors cannot be fixed by ubuntu-pro-client and are indicative of an issue somewhere else, so their association with ubuntu-pro-client is not helpful.

  In the case of bug 2055239, there is a bug in systemd which results in
  unnecessary warnings on almost all `systemctl` commands. Those
  appeared in the output of `apt update` (a highly used and visible
  command) becuase of ubuntu-pro-client's apt-hook. This made ubuntu-pro
  look bad even though the issue was in systemd.

  The fix for this bug is to redirect the output of ubuntu-pro-client's
  apt-hooks so that warnings and errors are not shown. We don't want to
  completely lose the ability to notice these errors however, so `pro
  collect-logs` will be modified to collect any warnings or errors that
  may have occurred.

  [ Test Plan ]
  In a noble lxd container

  # Reproduce the issue before upgrading

  apt update                     # no warnings
  sudo apt install systemd=255.4-1ubuntu8  # install affected version of systemd
  systemctl enable bug32939      # trigger https://github.com/systemd/systemd/issues/32959 aka bug 2055239
  apt update                     # see warnings

  # Install fixed version here

  # Show that warnings are no longer shown
  apt update                     # no warnings
  systemctl enable bug32939      # trigger https://github.com/systemd/systemd/issues/32959 aka bug 2055239
  apt update                     # you should NOT see warnings

  # create some logs and rotate them
  sudo pro status
  ls -la /var/log/ubuntu-advantage*.log
  logrotate -f /etc/logrotate.conf

  # Confirm rotation of non-zero logs, and zero logs are not rotated
  ls -la /var/log/ubuntu-advantage*.log

  # Write something to /var/log/ubuntu-advantage-apt-hook.log (the new log file)
  echo hello > /var/log/ubuntu-advantage-apt-hook.log

  # trigger rotation one more time
  logrotate -f /etc/logrotate.conf

  # confirm this time it was rotated
  ls -la /var/log/ubuntu-advantage*.log

  # Then run demonstrate that collect-logs will get the systemd warning
  # and the simulated apt-hook err
  pro collect-logs
  tar -xvf pro_logs.tar.gz
  # confirm rotated logs were collected
  ls logs/
  # see the hidden things were collected
  cat logs/apt-news.service.txt  # see the warning
  cat logs/ubuntu-advantage-apt-hook*.log # see "hello"

  [ Where problems could occur ]
  Since we are hiding potential warnings and errors, we are less likely to notice real issues in the apt-hooks. It also likely would've taken a lot longer to notice bug 2055239 if it wasn't so prominent. If the apt-hooks silently break, then users will go without APT news or up to date ESM package update messages.

  [ Original Description ]
  Back in bug 2055239 users saw messages like

  $ sudo apt update
  Warning: The unit file, source configuration file or drop-ins of apt-news.service changed on disk. Run 'systemctl daemon-reload' to reload units.

  And debugging that identified that snapd on install/update caused the
  whole system to go into that bad state. But users rarely check so deep
  and we might want to avoid false perception of Pro being broken (like
  in this case where we neither caused it, nor can fix it, ...)

  On the other hand we do not just want to hide it, so if we suppress
  them and get STDERR we need to consider if they should go at least to
  the log and if we need another way to flag "there is something wrong
  here on your system" less associated with the pro client.

  So the potential range from "suppress / quiet" to "very complex error redirection is huge".
  While pondering, TBH we probably should go for the simpler method.
  While hoping that the real fix of the root cause (not just hiding the symptom) will also soon be fixed in either in snapd (triggering it) or systemd (https://github.com/systemd/systemd/issues/32959 part of the reason snapd triggers it).

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