[Bug 1939732] Re: report availability of Ubuntu Advantage ESM services on unattached machines
Chad Smith
1939732 at bugs.launchpad.net
Thu Nov 18 22:29:26 UTC 2021
# Success testing on Bionic Desktop installer
1. Validate current behavior from bionic-updates
csmith at downtown:~$ IP=`uvt-kvm ip ubuntu18.04`
csmith at downtown:~$ ssh csmith@$IP
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 5.4.0-84-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
8 updates can be applied immediately.
8 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable
New release '20.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Your Hardware Enablement Stack (HWE) is supported until April 2023.
Last login: Thu Nov 18 14:29:55 2021 from 192.168.122.1
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ cat > setup_proposed.sh <<EOF
> #!/bin/bash
> mirror=http://archive.ubuntu.com/ubuntu
> echo deb \$mirror \$(lsb_release -sc)-proposed main | tee /etc/apt/sources.list.d/proposed.list
> apt-get update -q
> apt-get install -qy software-properties-gtk software-properties-common python3-software-properties
> EOF
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ lsb_release -sc
bionic
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ apt policy software-properties-gtk
software-properties-gtk:
Installed: 0.96.24.32.14
Candidate: 0.96.24.32.14
Version table:
*** 0.96.24.32.14 500
500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages
100 /var/lib/dpkg/status
0.96.24.32.1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu bionic/main i386 Packages
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ [ -f /var/lib/ubuntu-advantage-tools/status.json ] && echo "status.json PRESENT" || echo "status.json ABSENT"
status.json ABSENT
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ software-properties-gtk
# no error messages
# Updates tab on Bionic does not currently report any ESM, support expiry info
2. Install -proposed software-properties, click Updates tab show the correct expiry for Bionic on unattached
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ sudo bash ./setup_proposed.sh
deb http://archive.ubuntu.com/ubuntu bionic-proposed main
Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-proposed InRelease [242 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [1,378 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,303 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages [114 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-proposed/main i386 Packages [80.6 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-proposed/main Translation-en [27.8 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 DEP-11 Metadata [6,340 B]
Get:12 http://archive.ubuntu.com/ubuntu bionic-proposed/main DEP-11 48x48 Icons [6,671 B]
Get:13 http://archive.ubuntu.com/ubuntu bionic-proposed/main DEP-11 64x64 Icons [10.2 kB]
Fetched 4,421 kB in 2s (2,845 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be upgraded:
python3-software-properties software-properties-common
software-properties-gtk
3 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.
Need to get 98.7 kB of archives.
After this operation, 14.3 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 software-properties-common all 0.96.24.32.18 [10.1 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 software-properties-gtk all 0.96.24.32.18 [64.9 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 python3-software-properties all 0.96.24.32.18 [23.8 kB]
Fetched 98.7 kB in 1s (152 kB/s)
(Reading database ... 130245 files and directories currently installed.)
Preparing to unpack .../software-properties-common_0.96.24.32.18_all.deb ...
Unpacking software-properties-common (0.96.24.32.18) over (0.96.24.32.14) ...
Preparing to unpack .../software-properties-gtk_0.96.24.32.18_all.deb ...
Unpacking software-properties-gtk (0.96.24.32.18) over (0.96.24.32.14) ...
Preparing to unpack .../python3-software-properties_0.96.24.32.18_all.deb ...
Unpacking python3-software-properties (0.96.24.32.18) over (0.96.24.32.14) ...
Setting up python3-software-properties (0.96.24.32.18) ...
Setting up software-properties-common (0.96.24.32.18) ...
Setting up software-properties-gtk (0.96.24.32.18) ...
Processing triggers for shared-mime-info (1.9-2) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for dbus (1.12.2-1ubuntu1.2) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.8) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
# cicking Updates tab show the correct expiry for Bionic on unattached
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ software-properties-gtk
# no error message
For other packages this system has: Basic Security Maintenance Extend...
Active until 04/26/2023
3. Validate Extend... text launches browser to
https://ubuntu.com/security/esm
4. Close button in dialog
# no errors on software-properties-gtk console
5. Attach and validate
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ sudo ua attach <REDACTED>
[sudo] password for csmith:
Enabling default service esm-apps
Updating package lists
UA Apps: ESM enabled
Enabling default service esm-infra
Updating package lists
UA Infra: ESM enabled
Enabling default service livepatch
Installing canonical-livepatch snap
Canonical livepatch enabled.
This machine is now attached to 'server-team-ua-client-ci-uaa'
SERVICE ENTITLED STATUS DESCRIPTION
cc-eal yes n/a Common Criteria EAL2 Provisioning Packages
cis yes disabled Center for Internet Security Audit Tools
esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM)
esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
fips yes disabled NIST-certified core packages
fips-updates yes disabled NIST-certified core packages with priority security updates
livepatch yes enabled Canonical Livepatch service
NOTICES
Operation in progress: ua attach
Enable services with: ua enable <service>
Account: UA Client Test
Subscription: server-team-ua-client-ci-uaa
Valid until: 9999-12-31 00:00:00+00:00
Technical support level: essential
# check presence of attached status.json file
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ [ -f /var/lib/ubuntu-advantage/status.json ] && echo "status.json PRESENT" || echo "status.json ABSENT"
status.json PRESENT
6. Click Updates tab and validate:
csmith at csmith-Standard-PC-Q35-ICH9-2009:~$ software-properties-gtk
# No errors while opening Updates tab and config contract expiry matches
# custom contract 12/31/1999
For other packages, this system has: Extended Security Maintenance
Active until 12/31/9999
# SUCCESS no Extended... link shown and correct contract date
** Tags removed: verification-needed verification-needed-bionic
** Tags added: verification-done verification-done-bionic
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to software-properties in Ubuntu.
https://bugs.launchpad.net/bugs/1939732
Title:
report availability of Ubuntu Advantage ESM services on unattached
machines
Status in software-properties package in Ubuntu:
Fix Released
Status in software-properties source package in Bionic:
Fix Committed
Status in software-properties source package in Focal:
Fix Released
Status in software-properties source package in Hirsute:
Fix Released
Status in software-properties source package in Impish:
Fix Released
Bug description:
[Impact]
* Error messages emitted to software-properties-gtk console "[Errno 2] No such file or directory: '/var/lib/ubuntu-advantage/status.json'" due to incorrect expectation that status.json file is written when non-root runs `ua status`
* This logic results in multiple `ua status` calls which each result in a network-egress to https://contracts.canonical.com on unattached machines which could result in delays in rendering the GTK dialogs while awaiting a response.
[Test Case]
1. Install latest version of software-properties-gtk from -proposed
cat > setup_proposed.sh <<EOF
#!/bin/bash
mirror=http://archive.ubuntu.com/ubuntu
echo deb \$mirror \$(lsb_release -sc)-proposed main | tee /etc/apt/sources.list.d/proposed.list
apt-get update -q
apt-get install -qy software-properties-gtk software-properties-common python3-software-properties
EOF
IP=`uvt-kvm ip ${DESKTOP_VM}`
scp setup_proposed.sh ubuntu@$IP:.
ssh ubuntu@$IP -- sudo bash ./setup_proposed.sh
2. run software-properties-gtk on the commandline
ssh ubuntu@$IP -- software-properties-gtk
# Validate no error messages on launch
3. Click Updates tab and validate
Basic Security Maintenance "Extend..."
Active until 04/23/2025
(Extend.. is a link that will spawn a browser to
ubuntu.com/security/esm)
4. Click Cancel button
5. Attach to a UA contract and re-run Software and updates UX
ssh ubuntu@$IP -- sudo ua attach $MY_TOKEN
ssh ubuntu@$IP -- software-properties-gtk
# validate no error messages
6. Click Updates tab and validate:
Extended Security Maintenance
Active until 12/31/1999
# Note no "Extend..." text or link
[Where problems could occur]
* invalid parsing of UA contract information or missing /var/lib/ubuntu-advantage/status.json will print messages to the console in the event of errors or warnings.
* failures and tracebacks in this code will result in invalid representation of system defaults in the Updates tab about whether or not a machine is attached to a contract or whether the contract is expired.
* Other than user-facing documentation about the state of the UA subscription this does not prevent the dialogs from functioning.
* limited network environments could have a delay of UX rendering due to `ua status` calls timing out on attempts to reach contracts.canonical.com
[Original Description]
Release: bionic/focal
Version: 0.96.24.32 (bionic)
Issue:
Software & Updates GTK UI doesn't report availability of Ubuntu Advantage ESM Infra or ESM Apps services on unattached machines
Steps to repropduce:
Launch software-properties-gtk from the commandline.
See unexpected errors on the terminal
No ua status file written:
[Errno 2] No such file or directory: '/var/lib/ubuntu-advantage/status.json'
Navigation to the "Updates" tab
See only:
Basic Security Maintenance
04/26/2023
Expected results:
See no error messages on terminal
See a link to the right of Basic Security Maintenance on the "Updates" tab that points to ESM info
Basic Security Maintenance Extend...(links to ubuntu.com/security/esm)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/1939732/+subscriptions
More information about the foundations-bugs
mailing list