** Description changed: - Description: Ubuntu 16.04.7 LTS - Release: 16.04 + [Impact] + This bug impacts users which are running on environments where '/usr/bin/cloud-id' is present, but returns any error (even for valid reasons, like cloud-init being installed on the system, but disabled, for example). UA client will raise this error while trying to use this tool to detect the cloud. + + The solution to this problem is to rely only on cloud-id when trying to determine the cloud type, and assuming not on cloud when the command is not present or if it fails. + https://github.com/canonical/ubuntu-advantage-client/commit/f968c46a686a8128af1ead85a4b86b9a1a84643f + and + https://github.com/canonical/ubuntu-advantage-client/commit/f6fbcee792cf42cc67e3ced02815b7d552dee19f + + [Test Case] + To reproduce: + With ubuntu-advantage-tools 27.2 installed, in an Ubuntu machine: + + - Make sure the '/run/cloud-init/instance-data.json' does not exist, so cloud-id fails: + `$ mv /run/cloud-init/instance-data.json /run/cloud-init/instance-data.json.old` + - Run `$ sudo ua status` + - Verify that it fails + + To verify the fix: + Repeat the above process using ubuntu-advantage tools 27.3, and verify that the operation succeeds and the status is shown on screen. + + [Regression Potential] + When running on a non-cloud system, this fix brings no impact, as we expect cloud-id to be absent and we are not running on cloud. + + When running on a specific cloud, this fix brings the scenario where we + should detect the cloud and are unable to, due to problems with cloud-id + itself. This is not a problem though: considering no-cloud when not in + aws/azure/gcp has no impact on UA at all, and those three providers have + images with cloud-id working properly. + + [Original Description] + Description: Ubuntu 16.04.7 LTS + Release: 16.04 ubuntu-advantage-tools: - Installiert: 27.2.2~16.04.1 + Installiert: 27.2.2~16.04.1 Installationskandidat: 27.2.2~16.04.1 Versionstabelle: *** 27.2.2~16.04.1 500 500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 100 /var/lib/dpkg/status sudo ua status Unexpected error(s) occurred. For more details, see the log: /var/log/ubuntu-advantage.log To file a bug run: ubuntu-bug ubuntu-advantage-tools 2021-09-23 07:55:53,550 - cli.py:(1297) [ERROR]: Unhandled exception, please file a bug Traceback (most recent call last): File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 1256, in wrapper return func(*args, **kwargs) File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 1342, in main return args.action(args, cfg) File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 1120, in action_status status = cfg.status(show_beta=show_beta) File "/usr/lib/python3/dist-packages/uaclient/config.py", line 681, in status response = self._attached_status() File "/usr/lib/python3/dist-packages/uaclient/config.py", line 654, in _attached_status self._attached_service_status(ent, inapplicable_resources) File "/usr/lib/python3/dist-packages/uaclient/config.py", line 589, in _attached_service_status ent_status, details = ent.user_facing_status() File "/usr/lib/python3/dist-packages/uaclient/entitlements/base.py", line 589, in user_facing_status applicability, details = self.applicability_status() File "/usr/lib/python3/dist-packages/uaclient/entitlements/base.py", line 379, in applicability_status for error_message, functor, expected_result in self.static_affordances: File "/usr/lib/python3/dist-packages/uaclient/entitlements/fips.py", line 331, in static_affordances static_affordances = super().static_affordances File "/usr/lib/python3/dist-packages/uaclient/entitlements/fips.py", line 176, in static_affordances cloud_id = get_cloud_type() or "" File "/usr/lib/python3/dist-packages/uaclient/config.py", line 940, in new_f return f() File "/usr/lib/python3/dist-packages/uaclient/clouds/identity.py", line 65, in get_cloud_type out, _err = util.subp(["cloud-id"]) File "/usr/lib/python3/dist-packages/uaclient/util.py", line 638, in subp out, err = _subp(args, rcs, capture, timeout, env=env) File "/usr/lib/python3/dist-packages/uaclient/util.py", line 595, in _subp stderr=err.decode("utf-8"), uaclient.util.ProcessExecutionError: Failed running command 'cloud-id' [exit(1)]. Message: ERROR: File not found '/run/cloud-init/instance-data.json'. Provide a path to instance data json file using --instance-data ProblemType: Bug DistroRelease: Ubuntu 16.04 Package: ubuntu-advantage-tools 27.2.2~16.04.1 ProcVersionSignature: Microsoft 4.4.0-19041.1237-Microsoft 4.4.35 Uname: Linux 4.4.0-19041-Microsoft x86_64 ApportVersion: 2.20.1-0ubuntu2.30 Architecture: amd64 Date: Thu Sep 23 07:56:47 2021 ProcEnviron: TERM=xterm-256color PATH=(custom, no user) LANG=de_DE.UTF-8 SHELL=/bin/bash SourcePackage: ubuntu-advantage-tools UpgradeStatus: No upgrade log present (probably fresh install)
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1944676 Title: Ubuntu ESM not working in WSL To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1944676/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs