package lxd 3.0.3-0ubuntu1~18.04.1 failed to install/upgrade: new lxd package pre-installation script subprocess returned error exit status 1

Bug #1876979 reported by Roman Plessl
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
lxd (Ubuntu)
Fix Committed
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

Bug Description

running do-release-upgrade from ubuntu 18.04 to 20.04 i got this upgrade error for lxd

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: lxd 3.0.3-0ubuntu1~18.04.1
ProcVersionSignature: Ubuntu 4.15.0-99.100-generic 4.15.18
Uname: Linux 4.15.0-99-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.14
Architecture: amd64
Date: Tue May 5 22:08:32 2020
EcryptfsInUse: Yes
ErrorMessage: new lxd package pre-installation script subprocess returned error exit status 1
Python3Details: /usr/bin/python3.8, Python 3.8.2, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: /usr/bin/python2.7, Python 2.7.18rc1, python-is-python2, 2.7.17-4
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3
 apt 2.0.2
SourcePackage: lxd
Title: package lxd 3.0.3-0ubuntu1~18.04.1 failed to install/upgrade: new lxd package pre-installation script subprocess returned error exit status 1
UpgradeStatus: Upgraded to focal on 2020-05-05 (0 days ago)
modified.conffile..etc.apparmor.d.usr.lib.lxd.lxd-bridge-proxy: [deleted]
modified.conffile..etc.dnsmasq.d-available.lxd: [deleted]
modified.conffile..etc.init.d.lxd: [deleted]
modified.conffile..etc.logrotate.d.lxd: [deleted]
modified.conffile..etc.sysctl.d.10-lxd-inotify.conf: [deleted]

[Impact]
The migration script which transitions users from the deb to the snap completes the migration by deleting the old directory. In cases where we have mountpoints in there the migration fails. With this change, we attempt to unmount those paths (but not fail should they be missing).

[Test plan]
Ideally, get a system which has both /var/lib/lxd/shmounts and /var/lib/lxd/devlxd mounted (should be possible if a container is running) and then upgrade, confirm that no error is shown at the end of the upgrade.

[Where problems could occur]
Can't really think of anything, the two unmounts run with "|| true" so at worst they should behave the same as without.

Revision history for this message
Roman Plessl (roman-plessl) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Roman Plessl (roman-plessl) wrote :

I have chosen the LXD '4.0' realease path

As the 'do-release-upgrade' will break in the middle on the upgrade process I fix the upgrading myself with this steps:

1) sudo apt purge lxd-client lxd

2) sudo apt update && sudo apt dist-upgrade

afterward lxd runs as expected from snap

rplessl@host:/home/rplessl# ps -ef | grep lxd
root 12596 9709 0 22:22 pts/0 00:00:00 grep --color=auto lxd
root 25885 1 0 22:08 ? 00:00:00 /bin/sh /snap/lxd/14890/commands/daemon.start
root 26047 1 0 22:08 ? 00:00:00 lxcfs /var/snap/lxd/common/var/lib/lxcfs -p /var/snap/lxd/common/lxcfs.pid
root 26059 25885 0 22:08 ? 00:00:01 lxd --logfile /var/snap/lxd/common/lxd/logs/lxd.log --group lxd

Revision history for this message
Stéphane Graber (stgraber) wrote :

I've pushed a fix to the packaging branch with logic to unmount potential mounts before deletion, this should avoid this case, though it's unclear why those were left mounted in the first place.

Changed in lxd (Ubuntu):
status: New → Fix Committed
Revision history for this message
kevin wang (nosocks) wrote :

My fix was after do-release-upgrade and reboot, I just ran "apt --fix-broken install" as instructed by apt, and that seems to have fixed it.

also if it matters, I'm running xen, this is a "guest" OS.

description: updated
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Roman, or anyone else affected,

Accepted lxd into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/lxd/1:0.10 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in lxd (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Stéphane Graber (stgraber) wrote :

Just tested this update with a running container and the upgrade went through correctly.
It's hard to tell if this would have normally failed given that based on the output, shmounts and devlxd weren't mounted at the time things got purged but it at least shows that the potentially problematic case upgrades properly and that things didn't regress.

tags: added: verification-done-focal
removed: focal verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxd - 1:0.10

---------------
lxd (1:0.10) focal; urgency=medium

  * Disable the "latest" track as it's no longer a valid upgrade target
    when coming from LXD 3.0. (LP: #1964833)
  * Unmount shmounts/devlxd prior to removal. (LP: #1876979)

 -- Stéphane Graber <email address hidden> Mon, 14 Mar 2022 17:45:36 -0400

Changed in lxd (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Stéphane Graber (stgraber) wrote : Update Released

The verification of the Stable Release Update for lxd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.