** Description changed:

+ [Impact]
+ 
+  * Upgrading .deb-packaged lxd to the lxd .deb package that just
+ installs the snap fails when the lxd snap can't be installed.
+ 
+  * This breaks package upgrades and specifically do-release-upgrade in
+ the middle of the release upgrade.
+ 
+  * The fix lets skipping the installation of the lxd snap if lxd has not
+ been activated on the system.
+ 
+ [Test Case]
+ 
+ 1.
+  * Install the Ubuntu 18.04 app from the Microsoft Store on Windows 10
+  * Upgrade the packages to the latest versions in 18.04
+  * Make sure the lxd package is installed
+  * Run sudo do-release-upgrade
+  * Observe the release upgrade failing without the fix and offering skipping 
the snap installation and then succeeding after skipping it.
+  * Observe the lxd package still being installed but the lxc and lxd commands 
asking for installing the lxd snap
+  * Pretend that there is an activated lxd server:
+   # mkdir /var/lib/lxd
+   # touch /var/lib/lxd/server.crt
+  * Reinstall the lxd package
+   # apt-get install --reinstall lxd
+  * Observe the installation not allowing to skip the installation of the lxd 
snap. (By removing the created file skipping can be made allowed again.)
+ 
+ 2.
+  * On a fully upgraded cosmic system install the previous version of the 
package, then upgrade to the fixed version.
+  * Observe the upgrade succeeding
+ 
+ 3.
+  * On a fully upgraded cosmic system install the fixed version of the 
package, then remove the lxd snap.
+  * Observe the lxc and lxd commands asking for installing the lxd snap.
+ 
+ 4.
+  * On a fully upgraded cosmic system purge the lxd packge and remove the lxd 
snap.
+ * Install the fixed package and observe it installing the lxd snap as well.
+ 
+ 
+ [Regression Potential] 
+ 
+  * The fix includes changing the packaged-shipped lxc and lxd commands to 
print an error message if the lxd snap is missing. This is very simple and 
unlikely to cause regressions.
+ * The change to the package's prerm script is more extensive and in case of a 
programming error error it may cause upgrade/installation failures. The 
provided tests excercise the 
+ 
+ [Original Bug Text]
+ 
  Upgrading from Bionic to Cosmic (or later) is not possible in WSL
  (https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) since when
  lxd package upgrade (with the deb -> snap transition) starts it can't be
  completed successfully. The package upgrade can only be aborted if the
  snap command fails, hence the distribution upgrade can't be completed
  either.
  
  As a workaround one can do:
  
   $ sudo mv /usr/bin/snap /usr/bin/snap.real
   $ sudo ln -s /bin/true /usr/bin/snap
  
  in a separate terminal, but this is not a smooth upgrade experience by
  any means.
  
  The upgrade can fail the same way if the snap store is not available
  possibly due to strict firewalling requirements and most likely distro
  upgrades should work in those environments as well.
  
  As a solution when the snap transition does not work during the package
  upgrade please upgrade the package to a state, where new invocations of
  lxd or lxc starts the snap installation later.
  
  A prototype can be found here:
  https://code.launchpad.net/~mwhudson/+git/lxd-installer/+ref/master

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

Title:
  LXD Deb->snap  transition fails in WSL due to snap command not working
  (yet)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1821924/+subscriptions

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

Reply via email to