Lxc exec not working

I am trying to run the command:
lxc exec bash

Or
lxc exec – run some operation

But it is not working in 2 of my servers. The LXD version is 4.0.7. All other operations like lxc file push/pull, list etc are working.

Please confirm what should I do to get it solved.

@stgraber if you can please take a look.

OS is Debian 10 buster.

Got error getting next reader instance=capricake PID=17434 err=“read unix /var/snap/lxd/common/lxd/unix.socket->@: use of closed network connection”

1 Like

I think I may also have the same or similar issue, although not certain.

I am running Debian 10 with proxmox / pve kernel and when I try lxc exec myContainer bash nothing happens at all?

Are both the container and host OS Debian?

Yes @tomp

Can you show uname -a?

Debian has had a bad kernel, if you’re running that, attach will fail.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990072

1 Like

I’ve not been able to reproduce in LXD 4.0.7:

# Launch Debian 10 VM for testing.
lxc launch images:debian/10 v1 --vm -c security.secureboot=false
lxc shell v1

uname -a
Linux v1 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux

# Install snapd and LXD 4.0.7 in VM.
apt install snapd -y
snap install core
snap install lxd --channel=4.0/stable

# Create Debian 10 container on LXD 4.0.7.
lxd init --auto
lxc launch images:debian/10 c1

# Check lxc exec in container.
lxc exec c1 -- whoami 
root

Linux prod-us-west2-a-003 4.19.0-17-cloud-amd64 #1 SMP Debian 4.19.194-1 (2021-06-10) x86_64 GNU/Linux

Can you try upgrading to 4.19.194-3

i have the same issue, but with kernel 5.11.22-2 - is this affected, too?
i dont see any error except “DBUG[07-23|00:08:42] Got message barrier”

Because of the current critical bug in the older kernel versions a downgrade is not the best solution.