** Description changed:

+ [Impact]
+ 
+ TODO Grant
+ 
+ [Test Plan]
+ 
+ Reproduce the bug by trying to attach ua on a vm with an old version of
+ snap. For example:
+ 
+ ```
+ multipass launch -n test-xenial-old-snap xenial
+ multipass shell test-xenial-old-snap
+ # inside the vm now
+ sudo apt update
+ sudo apt install snapd=2.0.2 ubuntu-core-launcher=1.0.27
+ sudo apt install ubuntu-advantage-tools
+ sudo ua attach YOUR_UA_TOKEN_HERE
+ ```
+ 
+ You should see the error described in this bug below.
+ 
+ To see the fix in action: detach, install the new version of ua from our
+ staging ppa and try again.
+ 
+ ```
+ sudo ua detach
+ sudo add-apt-repository ppa:ua-client/staging
+ sudo apt update
+ sudo apt install ubuntu-advantage-tools
+ sudo ua attach YOUR_UA_TOKEN_HERE
+ ```
+ 
+ Enabling livepatch will still likely fail, but ua will output a
+ suggestion to update snapd, which will resolve the issue.
+ 
+ [Where problems could occur]
+ 
+ TODO Grant
+ 
+ [Other Info]
+  
+ TODO Grant
+ 
+ [Original Description]
+ 
  While trying to reproduce 
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1927029, 
when running `ua attach <token>` on a xenial ec2 instance, I got the following 
error:
  ```
  Enabling default service esm-infra
  Updating package lists
  UA Infra: ESM enabled
  Enabling default service livepatch
  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
  ```
  
  `/var/log/ubuntu-advantage.log` contains the following output (attaching full 
log):
  ```
  2021-05-06 08:31:30,867 - contract.py:(274) [ERROR]: Unexpected error 
processing contract delta for livepatch: {'entitlement': {'affordances': 
{'kernelFlavors': ['generic', 'lowlatency', 'oem', 'aws'], 'series': ['trusty', 
'xenial', 'bionic', 'focal'], 'minKernelVersion': '4.4', 'tier': 'updates', 
'architectures': ['amd64', 'x86_64']}, 'entitled': True, 'obligations': 
{'enableByDefault': True}, 'directives': {'caCerts': '', 'remoteServer': 
'https://livepatch.canonical.com'}, 'type': 'livepatch'}, 'resourceToken': 
'mAgJOEWNBR0pkLVA1NG15WEhwalIxWDd5akREbTNaek1fOU54RGtXSFNDZXFreF9nOmE5NzJkODcwNzA3OTRlNmVhNDMyMDE3YWNkZDRmMzU2AAI4aXMtY29udHJhY3QgY0FHSmQtUDU0bXlYSHBqUjFYN3lqRERtM1p6TV85TnhEa1dIU0NlcWt4X2cAAhVpcy1yZXNvdXJjZSBsaXZlcGF0Y2gAAAYgQSFlXM5eOgCSzpsjCEyAGMxYG_CaoyJ62D8JGCXVoqw'}
  Traceback (most recent call last):
-   File "/usr/lib/python3/dist-packages/uaclient/contract.py", line 260, in 
process_entitlements_delta
-     series_overrides=series_overrides,
-   File "/usr/lib/python3/dist-packages/uaclient/contract.py", line 330, in 
process_entitlement_delta
-     orig_access, deltas, allow_enable=allow_enable
-   File "/usr/lib/python3/dist-packages/uaclient/entitlements/livepatch.py", 
line 231, in process_contract_deltas
-     if super().process_contract_deltas(orig_access, deltas, allow_enable):
-   File "/usr/lib/python3/dist-packages/uaclient/entitlements/base.py", line 
457, in process_contract_deltas
-     self.enable()
-   File "/usr/lib/python3/dist-packages/uaclient/entitlements/livepatch.py", 
line 104, in enable
-     [SNAP_CMD, "wait", "system", "seed.loaded"], capture=True
-   File "/usr/lib/python3/dist-packages/uaclient/util.py", line 608, in subp
-     out, err = _subp(args, rcs, capture, timeout, env=env)
-   File "/usr/lib/python3/dist-packages/uaclient/util.py", line 565, in _subp
-     stderr=err.decode("utf-8"),
+   File "/usr/lib/python3/dist-packages/uaclient/contract.py", line 260, in 
process_entitlements_delta
+     series_overrides=series_overrides,
+   File "/usr/lib/python3/dist-packages/uaclient/contract.py", line 330, in 
process_entitlement_delta
+     orig_access, deltas, allow_enable=allow_enable
+   File "/usr/lib/python3/dist-packages/uaclient/entitlements/livepatch.py", 
line 231, in process_contract_deltas
+     if super().process_contract_deltas(orig_access, deltas, allow_enable):
+   File "/usr/lib/python3/dist-packages/uaclient/entitlements/base.py", line 
457, in process_contract_deltas
+     self.enable()
+   File "/usr/lib/python3/dist-packages/uaclient/entitlements/livepatch.py", 
line 104, in enable
+     [SNAP_CMD, "wait", "system", "seed.loaded"], capture=True
+   File "/usr/lib/python3/dist-packages/uaclient/util.py", line 608, in subp
+     out, err = _subp(args, rcs, capture, timeout, env=env)
+   File "/usr/lib/python3/dist-packages/uaclient/util.py", line 565, in _subp
+     stderr=err.decode("utf-8"),
  uaclient.util.ProcessExecutionError: Failed running command '/usr/bin/snap 
wait system seed.loaded' [exit(1)]. Message: error: Unknown command `wait'. 
Please specify one command of: abort, ack, buy, change, changes, connect, 
create-user, disable, disconnect, download, enable, find, help, install, 
interfaces, known, list, login, logout, refresh, remove, run or try
  ```
  
  Additional information
  ----------------------
  ```
  ubuntu@ip-172-31-29-198:~$ lsb_release -rd
  Description:  Ubuntu 16.04.1 LTS
  Release:      16.04
  ```
  
  ```
  ubuntu@ip-172-31-29-198:~$ apt-cache policy ubuntu-advantage-tools
  ubuntu-advantage-tools:
-   Installed: 27.0~16.04.1
-   Candidate: 27.0~16.04.1
-   Version table:
-  *** 27.0~16.04.1 500
-         500 http://us-west-2.ec2.archive.ubuntu.com/ubuntu 
xenial-updates/main amd64 Packages
-         100 /var/lib/dpkg/status
-      27.0~16.04.1 500
-         500 http://ppa.launchpad.net/ua-client/stable/ubuntu xenial/main 
amd64 Packages
+   Installed: 27.0~16.04.1
+   Candidate: 27.0~16.04.1
+   Version table:
+  *** 27.0~16.04.1 500
+         500 http://us-west-2.ec2.archive.ubuntu.com/ubuntu 
xenial-updates/main amd64 Packages
+         100 /var/lib/dpkg/status
+      27.0~16.04.1 500
+         500 http://ppa.launchpad.net/ua-client/stable/ubuntu xenial/main 
amd64 Packages
  ```
  
  ```
  ubuntu@ip-172-31-29-198:~$ snap --version
  snap    2.14.2~16.04
  snapd   2.14.2~16.04
  series  16
  ubuntu  16.04
  ```

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1927329

Title:
  'snap wait' fails when enabling livepatch

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1927329/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to