[SRU] update-manager crashes when ua security-status response is an error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Livepatch Client |
New
|
Undecided
|
Unassigned | ||
ubuntu-advantage-tools (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
update-manager (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Committed
|
Critical
|
Nathan Teodosio | ||
Bionic |
Fix Released
|
Critical
|
Nathan Teodosio | ||
Focal |
Fix Released
|
Critical
|
Nathan Teodosio | ||
Jammy |
Fix Released
|
Critical
|
Nathan Teodosio | ||
Noble |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Impact
------
Update Manager fails to launch in the LTS releases if the 'ua security-status' command fails. It tries to parse its output to generate the list of ESM-Apps and ESM-Infra updates that would be available if the system were attached to Ubuntu Pro.
However, if ua finds some problem with unrelated stuff, such as Livepatch (as evidenced by the attached ubuntu-
Although Update Manager could catch the error, it would result in not showing Ubuntu Pro updates, simply because the information is not there.
Better would be to ditch 'ua security-status' in favor of the Ubuntu Pro API. The updates() end point[1] will provide the information Update Manager wants even if the Ubuntu Advantage daemon has issues with other services such as Livepatch (as evidenced by #10), and it does not raise exceptions.
Test Plan
---------
Attach your machine to Ubuntu Pro and make sure Livepatch is enabled in the output of 'ua status'. Then, simulate a failing Livepatch with
--->
mv /snap/bin/
>/snap/
chmod +x /snap/bin/
<----
Launch update-manager, it should open and not crash.
Where problems could occur
-------
In the Ubuntu Pro section of the updates, in form of wrong package data (e.g. package name, version number etc.) in the description pane when selecting a package. The section could not show at all, or the program could crash right away.
Original bug report
-------------------
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/
To file a bug run: ubuntu-bug ubuntu-
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
s = json.load(p.stdout)
File "/usr/lib/
return loads(fp.read(),
File "/usr/lib/
return _default_
File "/usr/lib/
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/
raise JSONDecodeError
json.decoder.
^CTraceback (most recent call last):
File "/usr/bin/
Gtk.main()
File "/usr/lib/
with register_
File "/usr/lib/
next(self.gen)
File "/usr/lib/
signal.
KeyboardInterrupt
fuga2:~> ubuntu-bug ubuntu-
fuga2:~> update.go:85: cannot change mount namespace according to change mount (/var/lib/
update.go:85: cannot change mount namespace according to change mount (/var/lib/
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-
ProcVersionSign
Uname: Linux 5.15.0-100-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Sun Mar 17 11:22:30 2024
PackageArchitec
SourcePackage: ubuntu-
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(171066691
cloud-id.txt-error: Invalid command specified 'cloud-id'.
livepatch-
uaclient.conf:
contract_url: https:/
log_level: debug
Related branches
- Sebastien Bacher: Approve
-
Diff: 105 lines (+41/-25)2 files modifiedUpdateManager/UpdateManager.py (+31/-25)
debian/changelog (+10/-0)
- Sebastien Bacher: Approve
-
Diff: 109 lines (+41/-29)2 files modifiedUpdateManager/UpdateManager.py (+31/-29)
debian/changelog (+10/-0)
- Sebastien Bacher: Approve
-
Diff: 109 lines (+41/-29)2 files modifiedUpdateManager/UpdateManager.py (+31/-29)
debian/changelog (+10/-0)
- Sebastien Bacher: Approve
-
Diff: 109 lines (+41/-29)2 files modifiedUpdateManager/UpdateManager.py (+31/-29)
debian/changelog (+10/-0)
information type: | Private → Public |
tags: | removed: need-amd64-retrace |
Changed in update-manager (Ubuntu): | |
importance: | Undecided → High |
assignee: | nobody → Nathan Teodosio (nteodosio) |
importance: | High → Critical |
no longer affects: | ubuntu-advantage-tools (Ubuntu Xenial) |
no longer affects: | ubuntu-advantage-tools (Ubuntu Bionic) |
no longer affects: | ubuntu-advantage-tools (Ubuntu Focal) |
no longer affects: | ubuntu-advantage-tools (Ubuntu Jammy) |
Changed in update-manager (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in update-manager (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in update-manager (Ubuntu Focal): | |
status: | New → In Progress |
Changed in update-manager (Ubuntu Jammy): | |
status: | New → In Progress |
assignee: | nobody → Nathan Teodosio (nteodosio) |
Changed in update-manager (Ubuntu Focal): | |
assignee: | nobody → Nathan Teodosio (nteodosio) |
Changed in update-manager (Ubuntu Bionic): | |
assignee: | nobody → Nathan Teodosio (nteodosio) |
Changed in update-manager (Ubuntu Xenial): | |
assignee: | nobody → Nathan Teodosio (nteodosio) |
importance: | Undecided → Critical |
Changed in update-manager (Ubuntu Bionic): | |
importance: | Undecided → Critical |
Changed in update-manager (Ubuntu Focal): | |
importance: | Undecided → Critical |
Changed in update-manager (Ubuntu Jammy): | |
importance: | Undecided → Critical |
no longer affects: | ubuntu-advantage-tools (Ubuntu Noble) |
Changed in update-manager (Ubuntu Noble): | |
status: | Triaged → Fix Released |
importance: | Critical → Undecided |
assignee: | Nathan Teodosio (nteodosio) → nobody |
description: | updated |
summary: |
- update-manager crashes when ua security-status response is an error + [SRU] update-manager crashes when ua security-status response is an + error |
Changed in update-manager (Ubuntu Xenial): | |
status: | In Progress → Fix Committed |
Changed in update-manager (Ubuntu Bionic): | |
status: | In Progress → Fix Committed |
Changed in update-manager (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
Changed in update-manager (Ubuntu Jammy): | |
status: | In Progress → Fix Committed |
no longer affects: | ubuntu-advantage-tools (Ubuntu) |
Thanks, Gregorym, for reporting this.
I do not see anything wrong in the attached log files regarding ubuntu-pro-client. The status looks good and there are no error traces.
Per your error traceback, it looks like update-manager is trying to json-decode the output of some, presumably pro, command, and failing. I have attached update-manager to the bug.
Checking into update-manager source code in jammy, I think the command is `pro security-status --format=json`, could you please attach the output of that command?