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

Bug #2074211 reported by Christian Ehrhardt 
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-advantage-tools (Ubuntu)
In Progress
Undecided
Unassigned

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
systemctl enable bug32939 # trigger https://github.com/systemd/systemd/issues/32959 aka bug 2055239
apt update # see warnings

# Install fixed version and try it show it again
apt update # no warnings
systemctl enable bug32939 # trigger https://github.com/systemd/systemd/issues/32959 aka bug 2055239
apt update # see warnings

# Then run demonstrate that collect-logs will get the warning
pro collect-logs
tar -xvf pro_logs.tar.gz
cat logs/apt-news.service.txt # see the warning

[ 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).

Changed in ubuntu-advantage-tools (Ubuntu):
status: New → Triaged
status: Triaged → In Progress
description: updated
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.