ua attach command fails with:
$ sudo ua attach $TOKEN
Enabling default service esm-infra
Updating package lists
UA Infra: ESM enabled
A reboot is required to complete install.
Enabling default service livepatch
Unable to configure Livepatch: Failed running command '/snap/bin/canonical-livepatch config remote-server=https://livepatch.canonical.com' [exit(1)]. Message: 2021/05/04 02:06:36 error executing config: Livepatchd error: Couldn't setup system logger.
ERROR: Unable to configure Livepatch: Failed running command '/snap/bin/canonical-livepatch config remote-server=https://livepatch.canonical.com' [exit(1)]. Message: 2021/05/04 02:06:36 error executing config: Livepatchd error: Couldn't setup system logger.
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
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
The ubuntu-advantage.log file has this:
2021-05-04 02:06:36,492 - util.py:(414) [DEBUG]: Reading file: /var/lib/cloud/data/result.json
2021-05-04 02:06:36,492 - cli.py:(1035) [ERROR]: Unhandled exception, please file a bug
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 666, in _attach_with_token
cfg, token, allow_enable=allow_enable
File "/usr/lib/python3/dist-packages/uaclient/contract.py", line 387, in request_updated_contract
orig_entitlements, cfg.entitlements, allow_enable
File "/usr/lib/python3/dist-packages/uaclient/contract.py", line 277, in process_entitlements_delta
raise exceptions.UserFacingError(status.MESSAGE_UNEXPECTED_ERROR)
uaclient.exceptions.UserFacingError: 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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 1004, in wrapper
return func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 1062, in main
return args.action(args, cfg)
File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 184, in new_f
return f(args, cfg)
File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 147, in new_f
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 130, in new_f
retval = f(args, cfg, **kwargs)
File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 768, in action_attach
cfg, token=args.token, allow_enable=args.auto_enable
File "/usr/lib/python3/dist-packages/uaclient/cli.py", line 677, in _attach_with_token
cfg.status() # Persist updated status in the event of partial attach
File "/usr/lib/python3/dist-packages/uaclient/config.py", line 575, in status
response = self._attached_status()
File "/usr/lib/python3/dist-packages/uaclient/config.py", line 548, in _attached_status
self._attached_service_status(ent, inapplicable_resources)
File "/usr/lib/python3/dist-packages/uaclient/config.py", line 502, in _attached_service_status
ent_status, details = ent.user_facing_status()
File "/usr/lib/python3/dist-packages/uaclient/entitlements/base.py", line 469, in user_facing_status
applicability, details = self.applicability_status()
File "/usr/lib/python3/dist-packages/uaclient/entitlements/base.py", line 263, in applicability_status
for error_message, functor, expected_result in self.static_affordances:
File "/usr/lib/python3/dist-packages/uaclient/entitlements/fips.py", line 267, in static_affordances
static_affordances = super().static_affordances
File "/usr/lib/python3/dist-packages/uaclient/entitlements/fips.py", line 113, in static_affordances
cloud_id = get_cloud_type() or ""
File "/usr/lib/python3/dist-packages/uaclient/config.py", line 735, in new_f
return f()
File "/usr/lib/python3/dist-packages/uaclient/clouds/identity.py", line 68, in get_cloud_type
return get_cloud_type_from_result_file()
File "/usr/lib/python3/dist-packages/uaclient/clouds/identity.py", line 56, in get_cloud_type_from_result_file
dsname = result["v1"]["datasource"].split()[0].lower()
AttributeError: 'NoneType' object has no attribute 'split'
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ubuntu-advantage-tools 27.0~16.04.1
ProcVersionSignature: Ubuntu 4.4.0-145.171-generic 4.4.176
Uname: Linux 4.4.0-145-generic x86_64
NonfreeKernelModules: falcon_lsm_serviceable falcon_nf_netcontain falcon_kal falcon_lsm_pinned_11611 falcon_lsm_pinned_11312 falcon_lsm_pinned_11110 falcon_lsm_pinned_10807 falcon_lsm_pinned_10703 falcon_lsm_pinned_10404 falcon_lsm_pinned_9918 falcon_lsm_pinned_9808 falcon_lsm_pinned_9804 falcon_lsm_pinned_9705 falcon_lsm_pinned_9607 falcon_lsm_pinned_9510 falcon_lsm_pinned_9403 falcon_lsm_pinned_9402 falcon_lsm_pinned_9205 falcon_lsm_pinned_9101 falcon_lsm_pinned_9003 falcon_lsm_pinned_8706 falcon_lsm_pinned_8705 falcon_lsm_pinned_8703 falcon_lsm_pinned_8701 falcon_lsm_pinned_8406 falcon_lsm_pinned_8404 falcon_lsm_pinned_8402 falcon_lsm_pinned_8202 falcon_lsm_pinned_8101 falcon_lsm_pinned_8002 falcon_lsm_pinned_7901 falcon_lsm_pinned_7803 falcon_lsm_pinned_7603 falcon_lsm_pinned_7602 falcon_lsm_pinned_7503 falcon_lsm_pinned_7403 falcon_lsm_pinned_7304 falcon_lsm_pinned_7303 falcon_lsm_pinned_7203
ApportVersion: 2.20.1-0ubuntu2.30
Architecture: amd64
Date: Tue May 4 02:07:25 2021
Ec2AMI: ami-e1fe2281
Ec2AMIManifest: (unknown)
Ec2AvailabilityZone: us-west-2b
Ec2InstanceType: r3.large
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ubuntu-advantage-tools
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.update-motd.d.88-esm-announce: [deleted]
modified.conffile..etc.update-motd.d.91-contract-ua-esm-status: [deleted]
Hello Alex, thanks for reporting this bug. If you still have that machine running, can you run:
ua enable livepatch
And verify if the command works. I have one hypothesis here, but if that enable fails as well, then it cannot be what I am thinking.