Containers fail to restart

Apr 26, 2018
111
8
23
With the recent Debian packages updates, we experienced containers failing to restart. We've seen this before. The solution is mentioned at the end of this thread:

Code:
find /sys/fs/cgroup/*/lxc/$CTID* -type d -print -delete
pct start $CTID

Does anybody know why this happens sporadically?
 
hi,

Does anybody know why this happens sporadically?

these directories are left behind when a container fails to start and doesn't clean up properly afterwards.

With the recent Debian packages updates

did you upgrade from old debian like wheezy? because newer debian versions use systemd instead of init, and upgrading from such versions seem to cause inconsistencies w.r.t. handling of services (which might be the cause of the restart problems).
 
After updating libexpat1=2.2.0-2+deb9u3 and libpve-common-perl=5.0-55, we again got nailed by this problem. :(

I ran the following to try to restart one container:

lxc-start -n 160 -F -l DEBUG -o /tmp/lxc-160.log

The results:
Code:
lxc-start: 160: network.c: instantiate_veth: 106 Operation not permitted - Failed to create veth pair "veth160i0" and "veth4LU2F2"
lxc-start: 160: network.c: lxc_create_network_priv: 2462 Failed to create network device
lxc-start: 160: start.c: lxc_spawn: 1646 Failed to create the network
lxc-start: 160: start.c: __lxc_start: 1989 Failed to spawn container "160"
lxc-start: 160: tools/lxc_start.c: main: 330 The container failed to start
lxc-start: 160: tools/lxc_start.c: main: 336 Additional information can be obtained by setting the --logfile and --logpriority options

In the end I rebooted the host. Not a palatable solution.

What would have been a better solution?
 
At the moment, seems like the best route is manually shutdown containers before updating any pve package.

Code:
pct list; for ct in $(pct list | awk '{print $1}' | grep -v VMID); do echo $ct; pct shutdown $ct; done; pct list
 
hi,

I ran the following to try to restart one container:

lxc-start -n 160 -F -l DEBUG -o /tmp/lxc-160.log

The results:

this is not the complete result. the command you used writes the full log in /tmp/lxc-160.log. please run it again and send the contents of the file.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!