Unable to *RE*-install lxd on debian 12

I uninstalled lxd a few weeks ago and I tried re-installing it now but it fails on lxd init with the following message:

$sudo lxd init
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 (dir, lvm) [default=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]: 
Would you like the LXD server to be available over the network? (yes/no) [default=no]: 
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]: 
Error: Failed to create local member network "lxdbr0" in project "default": Failed to setup firewall: Failed adding outbound NAT rules for network "lxdbr0" (inet): Failed apply nftables config: Failed to run: nft -f -: exit status 1 (/dev/stdin:4:7-9: Error: No such file or directory; did you mean chain ‘pstrt.lxdbr0’ in table inet ‘lxd’?
	type nat hook postrouting priority 100; policy accept;
	     ^^^
/dev/stdin:3:7-18: Error: Could not process rule: No such file or directory
chain pstrt.lxdbr0 {
      ^^^^^^^^^^^^
/dev/stdin:3:7-18: Error: Could not process rule: No such file or directory
chain pstrt.lxdbr0 {
      ^^^^^^^^^^^^)

I tried giving a different name to the bridge device (lxdbr1) and the same error happen.

I’m running the current debian 12 lxd package (5.0.2) and I have nftables installed ($ whereis nft nft: /usr/sbin/nft /usr/share/man/man8/nft.8.gz).

Here is the output of lxc warning ls:

+--------------------------------------+------------------------------------------------------+--------+----------+-------+---------+------------------------------+
|                 UUID                 |                         TYPE                         | STATUS | SEVERITY | COUNT | PROJECT |          LAST SEEN           |
+--------------------------------------+------------------------------------------------------+--------+----------+-------+---------+------------------------------+
| 327760d1-87bb-4904-a8ec-8676c94456f3 | Couldn't find the CGroup network priority controller | NEW    | LOW      | 1     |         | May 15, 2023 at 3:41am (UTC) |
+--------------------------------------+------------------------------------------------------+--------+----------+-------+---------+------------------------------+
| feae225a-6e1c-4db4-b17c-e96d8aec2ed1 | Couldn't find the CGroup hugetlb controller          | NEW    | LOW      | 1     |         | May 15, 2023 at 3:41am (UTC) |
+--------------------------------------+------------------------------------------------------+--------+----------+-------+---------+------------------------------+

Any idea how I can get lxd to work again?

Thanks!

What kernel version are you running?

I suspect you are missing the sufficient kernel modules for nftables to work with inet table types.

Or you’re missing the nat support for nftables.

Thanks for the follow up Thomas. The issue is fixed now and my guess is that it was a broken kernel update that interfered with kernel modules.

For anyone that landed here through a search engine, here is what I did:

  • booted using the previous kernel and test lxd (it was working fine)
  • re-installed the most recent kernel, booted again using the re-installed kernel and lxd was working fine
1 Like