Forkexec - Failed to load config file

Hi everyone,

I have a problem where lxc exec gives the error

Failed to retrieve PID of executing child process

After setting debug
snap set lxd daemon.debug=true
snap set lxd daemon.verbose=true
systemctl reload snap.lxd.daemon

And trying again I see in /var/snap/lxd/common/lxd/logs/forkexec.log

Failed to load config file /var/snap/lxd/common/lxd/logs/ams-ceqsttroh003taa8cu10/lxc.conf for /var/snap/lxd/common/lxd/containers/ams-ceqsttroh003taa8cu10

Indeed it appears that lxd.conf is missing at this location for all the containers on this node and the only file present for the other containers is lxc.log

From snap list:
lxd 4.0.9-a29c6f1 24065 5.0/stable canonical** disabled,in-cohort
lxd 5.0.1-9dcf35b 23545 5.0/stable canonical** in-cohort

Any thoughts on how this came to be?

Thanks.

Sounds like:

Sort of. We aren’t in tmp though.

Does rebooting the host fix it for some time and then it happens again?

Restarting snap.lxd.daemon appears to restore exec (at least the 1 container we exec’d has its files back) but this also restarts containers which isn’t an option for the user.

Is it possible to prompt LXD to recreate those files? It is at least possible with a service and container restart.

See if this helps Lxc unable to connect to running container - #3 by CanuteTheGreat