Lxc list showing containers in error state

I’m running two Ubuntu 16.04 servers and have several containers on each. I’m also using ZFS for the storage backend and I followed Stephane’s LXD 2.0 series as well as this page for setting up the servers.

The problem I’m having on both boxes is that yesterday I performed my usual apt update and apt upgrade routines and didn’t have any problems with the upgrades. However, after rebooting both machines my lxc container states are showing ‘ERROR’ after I issues the lxc list command. When I try to start a container I get the message: “error: Failed to set LXC config: lxc.pts=1024”.

I’ve looked around trying to find this issue discussed but I haven’t had any luck doing so. If I look at /var/log/lxd/lxd.log I also see an error for each container showing:

err=“Failed to set LXC config: lxc.pts=1024” lvl=eror msg=“balance: Unable to set cpuset” name= value=0,1,2,3,4,5,6,7

Any help would be greatly appreciated!

Thanks.

Hi!

I think you are affected by this, https://github.com/lxc/lxd/issues/4400

What’s the output of the following?

apt policy lxd
apt policy liblxc1
apt policy lxd
lxd:
  Installed: 2.0.11-0ubuntu1~16.04.4
  Candidate: 2.0.11-0ubuntu1~16.04.4
  Version table:
     2.21-0ubuntu3~16.04.2 100
        100 http://us.archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages
 *** 2.0.11-0ubuntu1~16.04.4 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.0.2-0ubuntu1~16.04.1 500
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     2.0.0-0ubuntu4 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
		
apt policy liblxc1
liblxc1:
  Installed: 3.0.0-0ubuntu2~ubuntu16.04.1~ppa1
  Candidate: 3.0.0-0ubuntu2~ubuntu16.04.1~ppa1
  Version table:
 *** 3.0.0-0ubuntu2~ubuntu16.04.1~ppa1 500
        500 http://ppa.launchpad.net/ubuntu-lxc/stable/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status
     2.0.8-0ubuntu1~16.04.2 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     2.0.7-0ubuntu1~16.04.2 500
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     2.0.0-0ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

You’re going to have to downgrade from liblxc 3.0.0 to liblxc 2.0.8 as only that is supported with LXD 2.0.11.

The error you’re getting is because LXD 2.0.11 doesn’t know how to interact with the liblxc 3.0.0 you installed from the PPA.

(You’d need LXD 3.0 or higher to work with liblxc 3.0)

Thank you for the information Stephane (and Simos!).

Although I’ve worked with Ubuntu for a while I’ve never had to specifically downgrade a package. Would the best way be to apt remove liblxc (and it’s dependencies) and then apt install liblxc1=2.0.8-0ubuntu1~16.04.2? Or is there a better/preferred way to do it to keep from messing anything up?

Right, so you’ll need to:

  • Remove the PPA from /etc/apt/sources.list.d
  • Run apt update
  • Run apt install liblxc1=2.0.8-0ubuntu1~16.04.2

Hopefully that last one will figure out the right downgrade sequence, if not, you may have to expand it with lxc-common=2.0.8-0ubuntu1~16.04.2 and possibly some more of the packages depending on exactly what you have installed on your system.

You guys are the best! Everything is working fine now.

Thank you and have a great day!

Respected all,
I also got the same error
err=“Failed to set LXC config: lxc.pts=1024” lvl=eror msg=“balance: Unable to set cpuset” name= value=0,1,2,3,4,5,6,7

And followed the solution

Remove the PPA from /etc/apt/sources.list.d
Run apt update
Run apt install liblxc1=2.0.8-0ubuntu1~16.04.2

But after running last command getting error as:
liblxc1 : Depends: lxc-common (= 2.0.8-0ubuntu1~16.04.2)

Any help would be greatly appreciated!

Can also mail me the solution at: adityaform@gmail.com

i’m facing an issue,
“lxc list” is not showing the containers
the output is:

±-----±------±-----±-----±-----±----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
±-----±------±-----±-----±-----±----------+

but the containers are not listed in it.
what should i do?

[quote=“Munir_Awan, post:10, topic:1685, full:true”]
i’m facing an issue,
“lxc list” is not showing the containers
the output is:

±-----±------±-----±-----±-----±----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
±-----±------±-----±-----±-----±----------+

but the containers are not listed in it.
what should i do?