"pro attach" tries to enable livepatch on non-amd64 LTSs and fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
`pro attach` fails on non-amd64 systems because it attempts to enable livepatch, which is only built for amd64, and errors.
The fix is to honor the existing "architecture" affordance which specifies which architectures livepatch can be enabled on.
[ Test Plan ]
`pro attach` on an arm64 system.
Before the fix, it will fail while enabling Livepatch.
After the fix, it will not attempt to enable livepatch.
[ Where problems could occur ]
The affordance checking code now runs before enabling livepatch. This is well-tested, but if there is an error, then the bug could reoccur in some situation.
More likely, is that we forget to add a supported architecture to the list of supported architectures in the future - which would prevent livepatch from getting enabled on that future supported architecture.
[ Other Info ]
This bug occurred because we were relaxing our affordance checking before enabling livepatch - in order to allow livepatch client to be the source of truth for whether a certain kernel is supported or not. This is generally good and works for kernel versions and flavors, but interim releases and non-amd64 architectures are not supported at all, so they need to be treated specially.
[ Original Description ]
27.14.3 on jammy arm64:
ubuntu@j-uat:~$ sudo pro attach <redacted>
Enabling default service esm-apps
Updating package lists
Ubuntu Pro: ESM Apps enabled
Enabling default service esm-infra
Updating package lists
Ubuntu Pro: ESM Infra enabled
Enabling default service livepatch
Installing canonical-livepatch snap
Stderr: error: snap "canonical-
tracks exist.
Please be mindful that different tracks may include different features.
Get more information with 'snap info canonical-
Stdout:
Stderr: error: snap "canonical-
tracks exist.
Please be mindful that different tracks may include different features.
Get more information with 'snap info canonical-
Stdout:
Stderr: error: snap "canonical-
tracks exist.
Please be mindful that different tracks may include different features.
Get more information with 'snap info canonical-
Stdout:
Stderr: error: snap "canonical-
tracks exist.
Please be mindful that different tracks may include different features.
Get more information with 'snap info canonical-
Stdout:
Failed to enable default services, check: sudo pro status
Related branches
- Athos Ribeiro (community): Approve
- Canonical Server Core Reviewers: Pending requested
-
Diff: 78 lines (+13/-9)5 files modifieddebian/changelog (+8/-0)
lib/timer.py (+0/-6)
uaclient/entitlements/livepatch.py (+3/-1)
uaclient/tests/test_ua_timer.py (+1/-1)
uaclient/version.py (+1/-1)
Strictly this only affects LTSs, because that's the only place where livepatch can be enabled. But the UA team usually updates to the same version in all stable releases. I'll leave it to them to decide if they will want to update all stable releases for this one, or just LTSs (and come up with a reasonable version numbering to allow for upgrades).