Doesn't display the correct livepatch service status

Bug #2009808 reported by Sebastien Bacher
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Triaged
Undecided
Nathan Teodosio
ubuntu-advantage-tools (Ubuntu)
Fix Released
Undecided
Grant Orndorff

Bug Description

Starting a focal VM which didn't get updated the livepatch icon in the panel shows an orange warning and the popdown display a string saying it hit an error fetching the status

$ canonical-livepatch status
last check: 58 seconds ago
kernel: 5.15.0-56.62~20.04.1-generic
server check-in: failed: livepatch check failed: unauthorized
patch state: ✗ kernel version not supported

The software-properties tab doesn't give any clue about that though, maybe it should?

Related branches

Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Reassigning to ubuntu-advantage-tools since after chat discussion it seems that the expected behavior would be for the pro client to report that in its status which it doesn't

$ pro status
SERVICE ENTITLED STATUS DESCRIPTION
livepatch yes enabled Canonical Livepatch service

affects: software-properties (Ubuntu) → ubuntu-advantage-tools (Ubuntu)
summary: - Doesn't display the livepatch service status
+ Doesn't display the correct livepatch service status
Revision history for this message
Grant Orndorff (orndorffgrant) wrote :

In the upcoming version of ubuntu-advantage-tools, this will be shown in pro status as
SERVICE ENTITLED STATUS DESCRIPTION
livepatch yes warning Current kernel is not supported

The pro status --format json section for livepatch will look like:
    {
      "available": "yes",
      "blocked_by": [],
      "description": "Canonical Livepatch service",
      "description_override": "Current kernel is not supported",
      "entitled": "yes",
      "name": "livepatch",
      "status": "warning",
      "status_details": "",
      "warning": {
        "code": "livepatch-kernel-not-supported",
        "message": "The current kernel (5.15.0-1028-kvm, x86_64) is not supported by livepatch.\nSupported kernels are listed here: https://ubuntu.com/security/livepatch/docs/kernels\nEither switch to a supported kernel or `pro disable livepatch` to dismiss this warning."
      }
    },

I think this will cover the ubuntu-advantage-tools part of the problem. I'll mark it In Progress to reflect the status that this is implemented but not yet committed or released to any Ubuntu release. We expect it to be released in late March.

I think software-properties looks for "status" == "enabled" to show an "on" switch for livepatch, so after the above u-a-t status change, it will show livepatch as "off" (since "status" == "warning").

softare-properties should probably also display a warning message describing the situation that `pro status` tells it. I'll leave this as affecting ubuntu-advantage-tools, but also add it back to software-properties to represent that portion of the work (propagating the warning from pro status to the GUI).

Changed in ubuntu-advantage-tools (Ubuntu):
status: New → In Progress
assignee: nobody → Grant Orndorff (orndorffgrant)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Nathan, could you check that have the status as 'warning' isn't going to confuse the current version of software-properties, we need to ensure things aren't going to stop working correctly when the new u-a-t lands.

We will need a design for how to display the message in the GUI and then add the feature to the desktop client to parse the new status and display the reason

Changed in software-properties (Ubuntu):
assignee: nobody → Nathan Teodosio (nteodosio)
status: New → Triaged
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Should it display the message as whatever UA gives us in its description field (here, "Current kernel is not supported") or do we want to write our own message? The former would render the solution untranslatable, correct?

Revision history for this message
Grant Orndorff (orndorffgrant) wrote :

Hi Nathan,

I suggest that if you see "status" == "warning" then look at the "warning.code" field. That will be a short string unique to the warning situation that won't change. It will be different for different warnings in the future, though currently the only warning is the one presented in my comment above.

So I suggest you keep a translatable string for each known "warning.code" and look up that string based on the code field.

If you don't have a string for a certain code, then you can fallback to "warning.message" (or "description_override" if it exists) as you see fit. These will always be english but at least will be human readable strings for the situation.

Revision history for this message
Grant Orndorff (orndorffgrant) wrote :

This was released in version 27.14 of ubuntu-advantage-tools but I forgot to include the LP number in the changelog so it didn't get automatically closed. Marking Fix Released now for u-a-t

Changed in ubuntu-advantage-tools (Ubuntu):
status: In Progress → Fix Released
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.