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

Bug #2008140 reported by timeless
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxd (Ubuntu)
New
Undecided
Unassigned

Bug Description

1. I'm upgrading from bionic to focal
2. I had an lxd/lxc configuration w/ a zfs pool -- the pool has been removed and lxc is not in use

Apparently as part of the upgrade, lxd tried to start and got quite upset that it could not find my pool.

Problems:
1. The upgrade effectively hung w/ no output at this point -- no indication of what to do or even what went wrong
2. `lxc list` doesn't work
3. there's no clear (or even muddy) explanation of how to get out of this state.
4. while there are some sqlite databases that represent the lxc state, they're inaccessible:

```
# lxc list
Error: Both native and snap packages are installed on this system
       Run "lxd.migrate" to complete your migration to the snap package
```

And there's no sqlite.

Expected results:
1. Before trying to do a migration of lxc, confirm that things are healthy
2. if they aren't healthy, walk the user through resolving them *before* upgrading
3. if lxd gets upset that it can't find things, it should explain to users (via something) what went wrong

Information was available in the `journalctl -u lxd`, but I had no idea that this was what I should look to:
```
-- Logs begin at Mon 2021-01-04 13:07:14 UTC, end at Thu 2023-02-23 00:21:01 UTC. --
Feb 23 00:00:46 test-daemons systemd[1]: Starting LXD - main daemon...
Feb 23 00:00:47 test-daemons lxd[30609]: t=2023-02-23T00:00:47+0000 lvl=warn msg="CGroup memory swap accounting is disabled, swap limits will be ignored."
Feb 23 00:00:47 test-daemons lxd[30609]: t=2023-02-23T00:00:47+0000 lvl=warn msg="Incorrectly applied \"storage_api\" patch, skipping storage pool initialization as it might be corrupt"
Feb 23 00:00:47 test-daemons lxd[30609]: t=2023-02-23T00:00:47+0000 lvl=warn msg="Database already contains a valid entry for the storage pool: test-mail"
Feb 23 00:00:47 test-daemons lxd[30609]: t=2023-02-23T00:00:47+0000 lvl=warn msg="Storage volumes database already contains an entry for the container"
Feb 23 00:00:47 test-daemons lxd[30609]: t=2023-02-23T00:00:47+0000 lvl=warn msg="Failed to set new ZFS mountpoint: cannot open 'test-mail/containers/test-mail': dataset does not exist\n"
Feb 23 00:00:47 test-daemons lxd[30609]: t=2023-02-23T00:00:47+0000 lvl=eror msg="Failed to start the daemon: containers/test-mail: Failed to set new zfs mountpoint: Failed to run: zfs set mountpoint=/var/lib/lxd/storage-pools/test-mail test-mail/containers/test-mail: cannot open 'test-mail/containers/test-mail': dataset does not exist"
Feb 23 00:00:48 test-daemons lxd[30609]: Error: containers/test-mail: Failed to set new zfs mountpoint: Failed to run: zfs set mountpoint=/var/lib/lxd/storage-pools/test-mail/containers/test-mail test-mail/containers/test-mail: cannot open 'test-mail/containers/test-mail': dataset does not exist"
Feb 23 00:00:48 test-daemons systemd[1]: lxd.service: Main process exited, code=exited, status=1/FAILURE
```

(I'm not actually sure that's from the right instantiation of lxd, but it was nearby.)

I tried deleting the symlink `/var/lib/lxd/containers/test-mail` but that didn't help much. And i don't have sqlite so attacking the lxd database files seems risky.

I could conceivably have a mix of happy and unhappy lxc instances in which case simply deleting the files would not be a good recovery technique, but in this case, I don't, so I probably could.

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: lxd 3.0.3-0ubuntu1~18.04.2
ProcVersionSignature: Ubuntu 4.15.0-204.215-generic 4.15.18
Uname: Linux 4.15.0-204-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.9-0ubuntu7.28
Architecture: amd64
Date: Thu Feb 23 00:00:48 2023
ErrorMessage: new lxd package pre-installation script subprocess returned error exit status 1
Python3Details: /usr/bin/python3.8, Python 3.8.10, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: /usr/bin/python2.7, Python 2.7.18, python-is-python2, 2.7.17-4
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3.2
 apt 2.0.9
SourcePackage: lxd
Title: package lxd 3.0.3-0ubuntu1~18.04.2 failed to install/upgrade: new lxd package pre-installation script subprocess returned error exit status 1
UpgradeStatus: Upgraded to focal on 2023-02-23 (0 days ago)

Revision history for this message
timeless (timeless) wrote :
tags: removed: need-duplicate-check
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.