Desktop application should check for service available information before listing it

Bug #1965138 reported by Lucas Albuquerque Medeiros de Moura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-advantage-desktop-daemon (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Currently, it seems that software-properties is incorrectly assuming that both ESM and Livepatch services can be enabled in a Jammy machine. Those services are not yet available in Jammy and we are attaching an image showing that the Desktop message is that we had an error enabling then and that the user should try again.

It seems that software-proporties source `/var/lib/ubuntu-advantage/status.json` and assumes the services is available if it appears on the services list and the `entitled` field has the `yes` value. However, it is perfectly possible for a service to be entitled to an user, but not available in the user's machine.

We are now suggesting that software-properties also looks at the `available` field in the services json output to make that assumption, this will probably solve the issue we are seeing on Jammy.

Another approach would be using the output of `ua status --format json` directly. However, this command will make a request to the contract's server if the user is unattached and maybe it is not wise to use it in that context. However, the output of that command only show services that are available, so we would not need to apply that extra available filter to it.

Revision history for this message
Lucas Albuquerque Medeiros de Moura (lamoura) wrote :
Revision history for this message
Robert Ancell (robert-ancell) wrote :
Changed in software-properties (Ubuntu):
assignee: nobody → Robert Ancell (robert-ancell)
importance: Undecided → High
status: New → In Progress
affects: software-properties (Ubuntu) → ubuntu-advantage-desktop-daemon (Ubuntu)
Changed in ubuntu-advantage-desktop-daemon (Ubuntu):
assignee: Robert Ancell (robert-ancell) → nobody
Revision history for this message
Robert Ancell (robert-ancell) wrote :

We are using `/var/lib/ubuntu-advantage/status.json` directly to avoid the server round trip as we want the current status quickly when starting the UI. The file also allows us to watch it for changes and update the UI accordingly.

It would be more desirable to use `ua status --format=json`, but I think that would require a `--no-check` flag or similar and some other means to watch for changes.

Revision history for this message
Lucas Albuquerque Medeiros de Moura (lamoura) wrote :

Just approved the PR robert-ancell

Also, I understand the need to use status.json directly. In the future we can better discuss on how we can extend `ua status --format json` to the Desktop needs to simplify that process.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-advantage-desktop-daemon - 1.8

---------------
ubuntu-advantage-desktop-daemon (1.8) jammy; urgency=medium

  * Hide unavailable services (LP: #1965138)

 -- Robert Ancell <email address hidden> Fri, 18 Mar 2022 15:02:33 +1300

Changed in ubuntu-advantage-desktop-daemon (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.