Lxc-attach fails in lxc 4.0.6

$lxc-attach -n containerB -l trace -o /tmp/b1.txt
$ cat /tmp/b1.txt
lxc-attach containerB 20220112164709.149 INFO utils - utils.c:get_rundir:260 - XDG_RUNTIME_DIR isn’t set in the environment
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_init_pid” received response
lxc-attach containerB 20220112164709.150 DEBUG commands - commands.c:lxc_cmd_rsp_recv:174 - Response data length for command “get_init_pid” is 0
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_init_pid”
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_init_pid” received response
lxc-attach containerB 20220112164709.150 DEBUG commands - commands.c:lxc_cmd_rsp_recv:174 - Response data length for command “get_init_pid” is 0
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_init_pid”
lxc-attach containerB 20220112164709.150 INFO lsm - lsm/lsm.c:lsm_init:40 - Initialized LSM security driver nop
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_config_item” received response
lxc-attach containerB 20220112164709.150 DEBUG commands - commands.c:lxc_cmd_rsp_recv:174 - Response data length for command “get_config_item” is 0
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_config_item”
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_config_item” received response
lxc-attach containerB 20220112164709.150 DEBUG commands - commands.c:lxc_cmd_rsp_recv:174 - Response data length for command “get_config_item” is 0
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_config_item”
lxc-attach containerB 20220112164709.150 INFO attach - attach.c:fetch_seccomp:581 - Failed to retrieve lxc.seccomp.profile
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_config_item” received response
lxc-attach containerB 20220112164709.150 DEBUG commands - commands.c:lxc_cmd_rsp_recv:174 - Response data length for command “get_config_item” is 0
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_config_item”
lxc-attach containerB 20220112164709.150 INFO attach - attach.c:fetch_seccomp:585 - Failed to retrieve lxc.seccomp
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_config_item” received response
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_config_item”
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_clone_flags” received response
lxc-attach containerB 20220112164709.150 DEBUG commands - commands.c:lxc_cmd_rsp_recv:174 - Response data length for command “get_clone_flags” is 0
lxc-attach containerB 20220112164709.150 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_clone_flags”
lxc-attach containerB 20220112164709.151 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_devpts_fd” received response
lxc-attach containerB 20220112164709.151 DEBUG commands - commands.c:lxc_cmd_rsp_recv:174 - Response data length for command “get_devpts_fd” is 0
lxc-attach containerB 20220112164709.151 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 11 for command “get_devpts_fd”
lxc-attach containerB 20220112164709.151 ERROR terminal - terminal.c:lxc_terminal_create_native:924 - Not a directory - Failed to open terminal multiplexer device
lxc-attach containerB 20220112164709.151 DEBUG terminal - terminal.c:lxc_terminal_peer_default:672 - Using terminal “/dev/tty” as proxy
lxc-attach containerB 20220112164709.151 TRACE terminal - terminal.c:lxc_terminal_signal_init:145 - Created signal fd 14
lxc-attach containerB 20220112164709.151 DEBUG terminal - terminal.c:lxc_terminal_winsz:61 - Set window size to 144 columns and 27 rows
lxc-attach containerB 20220112164709.152 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup2_fd” received response
lxc-attach containerB 20220112164709.152 DEBUG commands - commands.c:lxc_cmd_rsp_recv:174 - Response data length for command “get_cgroup2_fd” is 0
lxc-attach containerB 20220112164709.152 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup2_fd”
lxc-attach containerB 20220112164709.152 DEBUG commands - commands.c:lxc_cmd_get_cgroup2_fd:1529 - Invalid argument - Failed to receive cgroup2 fd
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:941 - basecginfo is:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:942 - 12:perf_event:/
11:memory:/user/userA/0
10:cpuset:/
9:freezer:/user/userA/0
8:cpu,cpuacct:/user.slice
7:devices:/user/userA/0
6:pids:/user.slice/user-1001.slice/session-4.scope
5:rdma:/
4:net_cls,net_prio:/
3:hugetlb:/
2:blkio:/user.slice
1:name=systemd:/user/userA/0
0::/user.slice/user-1001.slice/session-4.scope

lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 0: perf_event
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 1: memory
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 2: cpuset
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 3: freezer
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 4: cpu
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 5: cpuacct
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 6: devices
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 7: pids
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 8: rdma
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 9: net_cls
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 10: net_prio
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 11: hugetlb
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 12: blkio
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:945 - kernel subsystem 13: cgroup2
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_basecg_debuginfo:948 - named subsystem 0: name=systemd
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:cg_hybrid_init:3271 - No controllers are enabled for delegation in the unified hierarchy
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:cg_hybrid_init:3289 - Writable cgroup hierarchies:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:922 - Hierarchies:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 0: base_cgroup: /user.slice/user-1001.slice/session-4.scope
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/unified
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 1: base_cgroup: /user/userA/0
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/systemd
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: name=systemd
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 2: base_cgroup: /user.slice
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/blkio
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: blkio
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 3: base_cgroup: /
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/hugetlb
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: hugetlb
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 4: base_cgroup: /
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/net_cls,net_prio
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: net_cls
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 1: net_prio
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 5: base_cgroup: /
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/rdma
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: rdma
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 6: base_cgroup: /user.slice/user-1001.slice/session-4.scope
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/pids
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: pids
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 7: base_cgroup: /user/userA/0
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/devices
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: devices
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 8: base_cgroup: /user.slice
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/cpu,cpuacct
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: cpu
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 1: cpuacct
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 9: base_cgroup: /user/userA/0
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/freezer
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: freezer
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 10: base_cgroup: /
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/cpuset
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: cpuset
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 11: base_cgroup: /user/userA/0
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/memory
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: memory
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:927 - 12: base_cgroup: /
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:928 - mountpoint: /sys/fs/cgroup/perf_event
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:929 - controllers:
lxc-attach containerB 20220112164709.152 TRACE cgfsng - cgroups/cgfsng.c:lxc_cgfsng_print_hierarchies:931 - 0: perf_event
lxc-attach containerB 20220112164709.152 TRACE cgroup - cgroups/cgroup.c:cgroup_init:41 - Initialized cgroup driver cgfsng
lxc-attach containerB 20220112164709.152 TRACE cgroup - cgroups/cgroup.c:cgroup_init:46 - Running with hybrid cgroup layout
lxc-attach containerB 20220112164709.153 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup2_fd” received response
lxc-attach containerB 20220112164709.153 DEBUG commands - commands.c:lxc_cmd_rsp_recv:174 - Response data length for command “get_cgroup2_fd” is 0
lxc-attach containerB 20220112164709.153 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup2_fd”
lxc-attach containerB 20220112164709.153 DEBUG commands - commands.c:lxc_cmd_get_cgroup2_fd:1529 - Invalid argument - Failed to receive cgroup2 fd
lxc-attach containerB 20220112164709.153 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.153 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.153 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.153 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.153 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.153 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.154 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.155 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.155 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.155 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.155 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.155 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.155 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.155 TRACE commands - commands.c:lxc_cmd_rsp_recv:127 - Command “get_cgroup” received response
lxc-attach containerB 20220112164709.155 TRACE commands - commands.c:lxc_cmd:310 - Opened new command socket connection fd 4 for command “get_cgroup”
lxc-attach containerB 20220112164709.155 TRACE attach - attach.c:lxc_attach:1183 - Moved intermediate process 4537 into container’s cgroups
lxc-attach containerB 20220112164709.155 TRACE attach - attach.c:lxc_attach:1205 - Initialized terminal mainloop
lxc-attach containerB 20220112164709.155 TRACE attach - attach.c:lxc_attach:1214 - Told intermediate process to start initializing
lxc-attach containerB 20220112164709.155 TRACE attach - attach.c:lxc_attach:1341 - Intermediate process starting to initialize
lxc-attach containerB 20220112164709.155 DEBUG attach - attach.c:lxc_attach_to_ns:186 - Attached to user namespace of 4314
lxc-attach containerB 20220112164709.155 DEBUG attach - attach.c:lxc_attach_to_ns:186 - Attached to mnt namespace of 4314
lxc-attach containerB 20220112164709.155 DEBUG attach - attach.c:lxc_attach_to_ns:186 - Attached to pid namespace of 4314
lxc-attach containerB 20220112164709.155 DEBUG attach - attach.c:lxc_attach_to_ns:186 - Attached to uts namespace of 4314
lxc-attach containerB 20220112164709.155 DEBUG attach - attach.c:lxc_attach_to_ns:186 - Attached to ipc namespace of 4314
lxc-attach containerB 20220112164709.155 DEBUG attach - attach.c:lxc_attach_to_ns:186 - Attached to net namespace of 4314
lxc-attach containerB 20220112164709.155 DEBUG attach - attach.c:lxc_attach_to_ns:186 - Attached to cgroup namespace of 4314
lxc-attach containerB 20220112164709.155 WARN attach - attach.c:lxc_attach:1365 - Could not change directory to “/var/lib/lxc/containerB”
lxc-attach containerB 20220112164709.155 TRACE process_utils - process_utils.c:lxc_raw_clone:110 - Function not implemented - Falling back to legacy clone
lxc-attach containerB 20220112164709.156 TRACE attach - attach.c:lxc_attach:1418 - Sending pid 4538 of attached process
lxc-attach containerB 20220112164709.156 TRACE attach - attach.c:lxc_attach:1221 - Received pid 4538 of attached process in parent pid namespace
lxc-attach containerB 20220112164709.156 TRACE attach - attach.c:attach_child_main:689 - Set new personality
lxc-attach containerB 20220112164709.156 TRACE attach - attach.c:attach_child_main:698 - Dropped capabilities
lxc-attach containerB 20220112164709.156 TRACE attach - attach.c:lxc_attach:1234 - Intermediate process 4537 exited
lxc-attach containerB 20220112164709.156 TRACE attach - attach.c:attach_child_main:711 - Set up environment
lxc-attach containerB 20220112164709.156 NOTICE utils - utils.c:lxc_setgroups:1420 - Dropped additional groups
lxc-attach containerB 20220112164709.156 ERROR utils - utils.c:get_ns_uid:540 - No such file or directory - Failed to open uid_map
lxc-attach containerB 20220112164709.156 ERROR utils - utils.c:get_ns_gid:562 - No such file or directory - Failed to open gid_map
lxc-attach containerB 20220112164709.156 NOTICE utils - utils.c:lxc_switch_uid_gid:1398 - Switched to gid 0
lxc-attach containerB 20220112164709.156 NOTICE utils - utils.c:lxc_switch_uid_gid:1407 - Switched to uid 0
lxc-attach containerB 20220112164709.156 TRACE attach - attach.c:attach_child_main:869 - Prepared terminal file descriptor 12
lxc-attach containerB 20220112164709.156 ERROR utils - utils.c:open_devnull:1286 - No such file or directory - Can’t open /dev/null
lxc-attach containerB 20220112164709.156 TRACE utils - utils.c:fix_stdio_permissions:1893 - No such file or directory - Failed to open “/dev/null”
lxc-attach containerB 20220112164709.156 INFO attach - attach.c:attach_child_main:882 - Failed to adjust stdio permissions
lxc-attach containerB 20220112164709.156 WARN attach - attach.c:lxc_attach_run_shell:1471 - Failed to get password record - 0
lxc-attach containerB 20220112164709.156 ERROR utils - utils.c:open_devnull:1286 - No such file or directory - Can’t open /dev/null
lxc-attach containerB 20220112164709.157 ERROR attach - attach.c:lxc_attach_run_shell:1494 - No such file or directory - Failed to execute shell
lxc-attach containerB 20220112164709.157 INFO terminal - terminal.c:lxc_terminal_io_cb:340 - Terminal client on fd 11 has exited

$ lxc-attach --version
4.0.6

$lxc-checkconfig
LXC version 4.0.6
Kernel configuration not found at /proc/config.gz; searching…
Kernel configuration found at /boot/config-4.15.0-166-generic
— Namespaces —
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled

— Control groups —
Cgroups: enabled

Cgroup v1 mount points:
/sys/fs/cgroup/systemd
/sys/fs/cgroup/blkio
/sys/fs/cgroup/hugetlb
/sys/fs/cgroup/net_cls,net_prio
/sys/fs/cgroup/rdma
/sys/fs/cgroup/pids
/sys/fs/cgroup/devices
/sys/fs/cgroup/cpu,cpuacct
/sys/fs/cgroup/freezer
/sys/fs/cgroup/cpuset
/sys/fs/cgroup/memory
/sys/fs/cgroup/perf_event

Cgroup v2 mount points:
/sys/fs/cgroup/unified

Cgroup v1 clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

— Misc —
Veth pair device: enabled, not loaded
Macvlan: enabled, not loaded
Vlan: enabled, not loaded
Bridges: enabled, loaded
Advanced netfilter: enabled, not loaded
CONFIG_NF_NAT_IPV4: enabled, loaded
CONFIG_NF_NAT_IPV6: enabled, not loaded
CONFIG_IP_NF_TARGET_MASQUERADE: enabled, loaded
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled, not loaded
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled, not loaded
FUSE (for use with lxcfs): enabled, not loaded

— Checkpoint/Restore —
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities:

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/local/bin/lxc-checkconfig

/dev/null is available on the host

$ cat config
lxc.idmap = u 0 231072 10
lxc.idmap = g 0 231072 10
lxc.idmap = u 1002 1002 1
lxc.idmap = g 1003 1003 1

lxc.console.path = none
lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed

Hi @brauner @stgraber

Any idea on this error?