LXD 5.21.1 LTS has been released

So this particular “not an error” error is coming from dqlite and has been reported to the dqlite team via @colemiller to investigate.

We’ve not seen this one in our own testing, so seems to be related to support for direct I/O on the hosts root filesystem.

What filesystem are you using for your host?
So far we’ve only seen reports of it occurring on btrfs on the bionic 4.15 kernel. But now we know its affecting bionic hwe 5.4 too.

See also https://github.com/canonical/lxd/issues/13326

As it doesn’t appear that the schema changes have been applied you could try switching to the 5.20/stable channel using:

sudo snap refresh lxd --channel=5.20/stable

Alternatively you could also try the steps here LXD 5.21.1 LTS has been released - #24 by lbueno

1 Like

Thanks for your reply.

What filesystem are you using for your host?
BTRFS

As it doesn’t appear that the schema changes have been applied you could try switching to the 5.20/stable channel using:

sudo snap refresh lxd --channel=5.20/stable

You are a life saver, Sir. All containers are back online again.
Thank you so much

1 Like

Ah great good to hear. Keep in mind that channel is frozen so doesn’t get updates. I would recommend looking into switching to a newer Ubuntu version asap.

We are going to work with dqlite team to try and figure out what’s going on here though.

Do you use btrfs on the host?

Yes, its btrfs

Ah great good to hear. Keep in mind that channel is frozen so doesn’t get updates. I would recommend looking into switching to a newer Ubuntu version asap.

I’ll upgrade to 20.04 LTE as soon as possible. Thanks again

1 Like

Hi, for anyone who’s seeing this:

Error: Failed to initialize global database: failed to ensure schema: Failed to ensure schema: not an error

you can help me figure out what’s going on by doing the following:

  • make a copy of /snap/lxd/current/commands/daemon.start that you can edit
  • edit your copy to add export LIBDQLITE_TRACE=1 in the indicated place:
# Spawn LXD
(
    read -r sbpid _ < /proc/self/stat
    export LISTEN_PID="${sbpid}"
    export LIBDQLITE_TRACE=1 # right here

    # shellcheck disable=SC2086
    exec ${CMD}
)&
  • $ sudo mount -o ro,bind daemon.start /snap/lxd/current/commands/daemon.start && sudo snap restart lxd

Hopefully LXD fails to start with the same error message, but there should be a lot of lines with LIBDQLITE around it now in the journalctl log – sharing that log should give me more context for what’s going on. Thanks!

1 Like

Interestingly it seems lxd 5.20 isn’t affected, and so far its only bionic on btrfs affected with lxd 5.21.1

So seems something in a recent version of dqlite has introduced this issue perhaps.

Looks like it could be this change https://github.com/canonical/lxd-pkg-snap/commit/72cd1305eeab6fc2be568f78d83e640854dae5b8

Or something after this version that lxd 5.20 shipped with

https://github.com/canonical/lxd-pkg-snap/blob/aa17879447f6bffe99af0c80867aa3d3705a5b17/snapcraft.yaml#L271

Hi @mechanix would you mind trying to refresh to 5.21/edge channel, this has a reverted dqlite version in it (Revert tolerance for EAGAIN when probing async I/O by cole-miller · Pull Request #641 · canonical/dqlite · GitHub) and we would like to see if this fixes the issue for you. We’ve not been able to reproduce the issue locally, even using Bionic on BTRFS.

If that works you can remain on 5.21/edge until we have fixed 5.21/stable (we will let you know).

The snap revision you want is git-d15f111.

sudo snap refresh lxd --channel=5.21/edge

I tried the fixed as you pointed to me but nothing works, I try this: https://askubuntu.com/questions/1388997/zsys-commit-service-fails-with-couldnt-promote-dataset-not-a-cloned-filesy

# upgrade everything and cleanup before dealing with 3rd party content
sudo apt upgrade --yes
sudo apt autoremove --yes

# add 3rd party PPA for zfstools
sudo add-apt-repository ppa:jonathonf/zfs && \
    sudo apt update && \
    sudo apt upgrade --yes

# you may get the following message in apt's output:
#   the following packages have been kept back:                                                                                                                                                                                                                   
#      zfs-initramfs zfs-zed zfsutils-linux

# if that is the case explicitly update zfsutils-linux by running:
sudo apt install zfs-initramfs zfs-zed zfsutils-linux

Everything build but I got this when starting my vm

probleme_cevmcorrelator_zfs

So I tried to update-initramfs without any success.

I will start again.
I have the same project with Ubuntu 20.04 and 22.04

@yguerin I’ve never tried with a non-Ubuntu provided ZFS kernel module but the import error you get make it sound as if the pool was created with a newer ZFS version than the one you try to import with.

If you were to use the Ubuntu provided ZFS kernel module, you could get a newer one by using the HWE kernel for 22.04 for example.

I got error when run lxd init

$ lxd init
Error: Failed to connect to local LXD: Get "http://unix.socket/1.0": dial unix /var/snap/lxd/common/lxd/unix.socket: connect: permission denied

my system is a fresh installed ubuntu 24.04 desktop

$ snap version
snap    2.62+24.04build1
snapd   2.62+24.04build1
series  16
ubuntu  24.04
kernel  6.8.0-31-generic

lxd version

$ lxd version
5.21.1 LTS

Please help, thanks.

What does sudo ls -la /var/snap/lxd/common/lxd/unix.socket show?

Are you running lxd init as root?

$ sudo ls -la /var/snap/lxd/common/lxd/unix.socket
srw-rw---- 1 root lxd 0 Apr 29 14:31 /var/snap/lxd/common/lxd/unix.socket

no, normal user.

You need to run lxd init as root user. E.g. sudo lxd init.

https://documentation.ubuntu.com/lxd/en/latest/tutorial/first_steps/
I followed this tutorial, didn’t mention need sudo.

Anyway, sudo lxd init is successed.

$ sudo lxd init
[sudo] password for me: 
Would you like to use LXD clustering? (yes/no) [default=no]: 
Do you want to configure a new storage pool? (yes/no) [default=yes]: 
Name of the new storage pool [default=default]: 
Name of the storage backend to use (btrfs, ceph, dir, lvm, powerflex, zfs) [default=zfs]: dir
Would you like to connect to a MAAS server? (yes/no) [default=no]: 
Would you like to create a new local network bridge? (yes/no) [default=yes]: 
What should the new bridge be called? [default=lxdbr0]: 
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: 
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like the LXD server to be available over the network? (yes/no) [default=no]: yes
Address to bind LXD to (not including port) [default=all]: 
Port to bind LXD to [default=8443]: 
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]: no
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:

But i got new error when run lxc launch ubuntu:22.04
Fixed after plus sudo, it works well.

Sorry i am new to lxd, here is the question, do i need to plus sudo to all lxc command?

1 Like

No, only lxd init.

But i got new error when run lxc launch ubuntu:22.04

What error did you get?

Are you on Ubuntu host?

If not then you should check that your non-root user is in the lxd group:

See https://documentation.ubuntu.com/lxd/en/latest/explanation/security/#local-access-to-the-lxd-daemon

Same error as init.

$ lxc launch ubuntu:22.04
Error: LXD unix socket "/var/snap/lxd/common/lxd/unix.socket" not accessible: permission denied

That make sense. Problem solved, Thank you !

1 Like

Last thursday (2024-04-25) everything working as before: zfs from Ubuntu, lxd 5.21/stable and snapd 2.62 but the next friday morning same error ?

You need to have a kernel with ZFS 0.8 support or higher to run LXD 5.21 from 5.21/stable.

What kernel ZFS version are you running currently?