Comment 2 for bug 1821924

Revision history for this message
Balint Reczey (rbalint) wrote : Re: [Bug 1821924] Re: LXD Deb->snap transition fails in WSL due to snap command not working (yet)

On Wed, Mar 27, 2019 at 7:25 PM Stéphane Graber <email address hidden> wrote:
>
> I don't believe that dist-upgrading WSL is officially supported as it's
> an Ubuntu installation which does not run a supported Ubuntu kernel. As

Please note that to work towards the possibility of offering "official
support" first we need to fix issues like this.
I'm happy to discuss this in private. WSL is not the only Ubuntu
installation that does not run on Ubuntu-provided kernel.

> you point out, LXD cannot work in such an environment and so it's
> reasonable for its upgrade to similarly fail.

No, package upgrades must not fail in dist-upgrade this way. This is
the exact opposite of great user experience.
Also I removed the lxd package to try that as a workaround but
do-release-upgrade brought it back (which may be a separate issue).

>
> The lxd-installer proposal also isn't suitable because lxd.migrate which
> performs the needed data migration from the deb over to the snap
> requires the previous version of LXD to be functional.
>
> This is why we do the upgrade from preinst and prevent the system from
> upgrading at all unless the upgrade is processed properly. Anything else
> would effectively result to data loss.

It can be easily tested in preinst if there was data to migrate, and
if there is none the proposed switch to lxd-installer mode would just
be enough.

>
> In the event that the store isn't available, we offer the user the
> choice between retrying after they've made sure it's accessible or
> giving up on the upgrade until such a time they can make it available
> (or have manually remove LXD from their system).

This is not enough if the store access can't be fixed, for example
when the company policy prohibits opening this firewall port.
Sticking to not falling back to something and aborting the
dist-upgrade would result a lot of support queries about broken
upgrades to 20.04.

Please consider handling the case when there is not prior lxd data to
migrate gracefully and reopen the bug.

>
> ** Changed in: lxd (Ubuntu)
> Status: New => Won't Fix
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1821924
>
> Title:
> LXD Deb->snap transition fails in WSL due to snap command not working
> (yet)
>
> Status in lxd package in Ubuntu:
> Won't Fix
>
> Bug description:
> Upgrading from Bionic to Cosmic (or later) is not possible in WSL
> (https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) fails
> 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
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1821924/+subscriptions

--
Balint Reczey
Ubuntu & Debian Developer