Hello,
I am posting in this thread as after the upgrade to 5.21.1 I am experiencing a weird bug.
I have an unprivileged container which can’t start if 2 specific devices are added in the config when the container is stopped, but if I add those devices while the container is running they work as expected.
The 2 devices are 2 folders under /mnt on the lxd host, which in turn are mount points for 2 CIFS folders.
This config is working since about 2019 and I’m tracking lxd latest/stable in snap with this container in there since the beginning, first on ubuntu 18.04 LTS, then 20.04 LTS and now on 22.04 LTS.
lxd-host $ ls -l /mnt/
total 0
drwxrwxr-x 2 1065534 1065534 0 Feb 3 00:47 dati_for_internal
drwxrwxr-x 2 1065534 1065534 0 Feb 12 2023 monitoring_for_internal
lxd-host $ mount | grep internal
systemd-1 on /mnt/dati_for_internal type autofs (rw,relatime,fd=54,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=581)
systemd-1 on /mnt/monitoring_for_internal type autofs (rw,relatime,fd=55,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=584)
//10.10.70.20/Dati on /mnt/dati_for_internal type cifs (rw,nosuid,nodev,noexec,relatime,vers=3.0,cache=strict,username=nucleo,uid=1065534,noforceuid,gid=1065534,noforcegid,addr=10.10.70.20,file_mode=0775,dir_mode=0775,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=1,x-systemd.automount)
//10.10.70.20/Monitoring on /mnt/monitoring_for_internal type cifs (rw,nosuid,nodev,noexec,relatime,vers=3.0,cache=strict,username=monitoring,uid=1065534,noforceuid,gid=1065534,noforcegid,addr=10.10.70.20,file_mode=0775,dir_mode=0775,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=1,x-systemd.automount)
This is the container config snip
lxd-host $ lxc config edit internal-lxd
<...>
devices:
monitoring:
path: /mnt/monitoring
source: /mnt/monitoring_for_internal
type: disk
dati:
path: /mnt/dati
source: /mnt/dati_for_internal
type: disk
<...>
When the config is present before starting the container I get
lxd-host $ sudo lxc info --show-log internal-lxd
Name: internal-lxd
Status: STOPPED
Type: container
Architecture: x86_64
Created: 2019/05/11 15:59 CEST
Last Used: 2024/04/10 19:22 CEST
Log:
lxc internal-lxd 20240410172253.865 WARN idmap_utils - ../src/src/lxc/idmap_utils.c:lxc_map_ids:165 - newuidmap binary is missing
lxc internal-lxd 20240410172253.865 WARN idmap_utils - ../src/src/lxc/idmap_utils.c:lxc_map_ids:171 - newgidmap binary is missing
lxc internal-lxd 20240410172253.866 WARN idmap_utils - ../src/src/lxc/idmap_utils.c:lxc_map_ids:165 - newuidmap binary is missing
lxc internal-lxd 20240410172253.866 WARN idmap_utils - ../src/src/lxc/idmap_utils.c:lxc_map_ids:171 - newgidmap binary is missing
lxc internal-lxd 20240410172253.930 ERROR conf - ../src/src/lxc/conf.c:mount_entry:2262 - Operation not permitted - Failed to mount "/var/snap/lxd/common/lxd/devices/internal-lxd/disk.dati.mnt-dati" on "/var/snap/lxd/common/lxc//mnt/dati"
lxc internal-lxd 20240410172253.930 ERROR conf - ../src/src/lxc/conf.c:lxc_setup:3915 - Failed to setup mount entries
lxc internal-lxd 20240410172253.930 ERROR start - ../src/src/lxc/start.c:do_start:1273 - Failed to setup container "internal-lxd"
lxc internal-lxd 20240410172253.932 ERROR sync - ../src/src/lxc/sync.c:sync_wait:34 - An error occurred in another process (expected sequence number 3)
lxc internal-lxd 20240410172253.946 WARN network - ../src/src/lxc/network.c:lxc_delete_network_priv:3671 - Failed to rename interface with index 0 from "eth0" to its initial name "veth5244401e"
lxc internal-lxd 20240410172253.946 ERROR lxccontainer - ../src/src/lxc/lxccontainer.c:wait_on_daemonized_start:837 - Received container state "ABORTING" instead of "RUNNING"
lxc internal-lxd 20240410172253.946 ERROR start - ../src/src/lxc/start.c:__lxc_start:2114 - Failed to spawn container "internal-lxd"
lxc internal-lxd 20240410172253.946 WARN start - ../src/src/lxc/start.c:lxc_abort:1037 - No such process - Failed to send SIGKILL via pidfd 17 for process 9795
lxc 20240410172254.415 ERROR af_unix - ../src/src/lxc/af_unix.c:lxc_abstract_unix_recv_fds_iov:218 - Connection reset by peer - Failed to receive response
lxc 20240410172254.416 ERROR commands - ../src/src/lxc/commands.c:lxc_cmd_rsp_recv_fds:128 - Failed to receive file descriptors for command "get_init_pid"
But if I remove the config, start the container, wait for it to boot, put the config back the 2 folders are correctly mounted in the container and all works as expected.
Can someone shed some light? At the next system update/reboot this container is going to fail and I’ll be without DNS once again
Thanks in advance