[Bug 2058133] Re: update-manager applet does exit successfully
Nathan Teodosio
2058133 at bugs.launchpad.net
Thu Mar 21 11:20:30 UTC 2024
Giacomo or anyone else getting "Unexpected error(s) occurred." from 'ua
security-status --format=json', can you please also attach the output of
python3 -c 'import uaclient.api.u.pro.packages.updates.v1 as
ua;print(ua.updates().updates)'
> The output of `pro security-status --format=json` and the internal
error look correct, so I'm going to mark the ubuntu-advantage-tools bit
as invalid.
I don't understand this bit. I wouldn't say that "Unexpected error(s)
occurred." looks correct, quite on the contrary, so I'm reverting the
task but please let me know if you disagree.
In any case, update-manager is also "to blame" insofar as it doesn't
validate the output of that command and just directly tries to parse it
as a JSON. For it, there are two possible ways forward:
1. If the output of the command is not a JSON, just skip all the Pro logic.
Positive: Keep changes to a minimal for a backport to the LTS series.
Negative: Buries the error and so we will not realize that the Pro logic was disabled, which is unintended behavior.
2. Use the API[1] as shown above.
Positive: No exception is raised by the end point, and possibly it also gives the correct output even when the pro command would fail reported. This looks quite probable by the way, as from the log the command failed because of Livepatch, which update-manager has no interest in, but let's see if the affected users come back with that information.
Negative: Changes are more encompassing as to see in [2].
[1] https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/references/api/#u-pro-packages-updates-v1
[2] https://code.launchpad.net/~nteodosio/update-manager/+git/update-manager/+merge/459172
** Changed in: ubuntu-advantage-tools (Ubuntu)
Status: Invalid => Confirmed
** Changed in: update-manager (Ubuntu)
Status: Confirmed => Triaged
--
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/2058133
Title:
update-manager applet does exit successfully
Status in ubuntu-advantage-tools package in Ubuntu:
Confirmed
Status in update-manager package in Ubuntu:
Triaged
Bug description:
Below is a run in my computer. Please send a mail on what to do
fuga2:~> update-manager -c -d
Unexpected error(s) occurred.
For more details, see the log: /var/log/ubuntu-advantage.log
To file a bug run: ubuntu-bug ubuntu-advantage-tools
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/UpdateManager/backend/InstallBackendAptdaemon.py", line 448, in _on_finished
self._action_done(action,
File "/usr/lib/python3/dist-packages/UpdateManager/backend/__init__.py", line 365, in _action_done
self.window_main.start_available()
File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 241, in start_available
self.refresh_cache()
File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 459, in refresh_cache
self._get_ua_security_status()
File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 285, in _get_ua_security_status
s = json.load(p.stdout)
File "/usr/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
^CTraceback (most recent call last):
File "/usr/bin/update-manager", line 125, in <module>
Gtk.main()
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1687, in main
with register_sigint_fallback(Gtk.main_quit):
File "/usr/lib/python3.10/contextlib.py", line 142, in __exit__
next(self.gen)
File "/usr/lib/python3/dist-packages/gi/_ossighelper.py", line 237, in register_sigint_fallback
signal.default_int_handler(signal.SIGINT, None)
KeyboardInterrupt
fuga2:~> ubuntu-bug ubuntu-advantage-tools
fuga2:~> update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/local/share/doc /usr/local/share/doc none bind,ro 0 0): cannot open directory "/usr/local/share": permission denied
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/xubuntu-docs /usr/share/xubuntu-docs none bind,ro 0 0): cannot open directory "/var/lib": permission denied
Gtk-Message: 11:23:47.656: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
fuga2:~>
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ubuntu-advantage-tools 31.2~22.04
ProcVersionSignature: Ubuntu 5.15.0-100.110-generic 5.15.143
Uname: Linux 5.15.0-100-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Sun Mar 17 11:22:30 2024
PackageArchitecture: all
SourcePackage: ubuntu-advantage-tools
UpgradeStatus: Upgraded to jammy on 2024-03-09 (7 days ago)
apparmor_logs.txt: Mar 17 11:15:18 fuga2 kernel: audit: type=1400 audit(1710666917.933:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ubuntu_pro_apt_news" pid=1057 comm="apparmor_parser"
cloud-id.txt-error: Invalid command specified 'cloud-id'.
livepatch-status.txt-error: Failed running command '/snap/bin/canonical-livepatch status' [exit(1)]. Message: error executing status: open /var/snap/canonical-livepatch/264/livepatchd.err: permission denied
uaclient.conf:
contract_url: https://contracts.canonical.com
log_level: debug
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/2058133/+subscriptions
More information about the foundations-bugs
mailing list