Lxc-attach for unprivileged containers not working after 24/48 hours uptime ubuntu 18.04


#1

I am running multiple unprivileged lxcs and after they’ve been up for roughly 24/48 hours lxc-attach just doesn’t work. There’s no error unless I throw the -o then I get:

lxc-attach: vpn: cgroups/cgfsng.c: cgfsng_attach: 2004 No such file or directory - Failed to attach 29830 to /sys/fs/cgroup/memory/user/lxcuser/0/lxc/vpn/cgroup.procs


#2

March 2019, still happening, any suggestions out there?

lxc-attach: vpn: cgroups/cgfsng.c: cgfsng_attach: 1991 No such file or directory - Failed to attach 24257 to /sys/fs/cgroup/memory/user/lxcuser/0/lxc/vpn/cgroup.procs


(Adam Poldauf) #3

Hello,

I run into same issue, it happens from time to time to my setup, i would say it’s random.

I checked cgroup tree and in my case is missing whole /sys/fs/cgroup/memory/user/<username>/0/lxc.

Any suggestions how to investigate the issue?

Thanks.

$ uname -a Linux r98-u1-web 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

`$ lxc-checkconfig
Kernel configuration not found at /proc/config.gz; searching…
Kernel configuration found at /boot/config-4.15.0-47-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/perf_event
/sys/fs/cgroup/rdma
/sys/fs/cgroup/memory
/sys/fs/cgroup/hugetlb
/sys/fs/cgroup/freezer
/sys/fs/cgroup/net_cls,net_prio
/sys/fs/cgroup/blkio
/sys/fs/cgroup/cpu,cpuacct
/sys/fs/cgroup/cpuset
/sys/fs/cgroup/pids
/sys/fs/cgroup/devices

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, loaded
Macvlan: enabled, not loaded
Vlan: enabled, 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, not loaded
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled, not loaded
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled, 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/bin/lxc-checkconfig`

$ cat /proc/self/cgroup
12:devices:/user.slice
11:pids:/user.slice/user-0.slice/session-37308.scope
10:cpuset:/
9:cpu,cpuacct:/user.slice
8:blkio:/user.slice
7:net_cls,net_prio:/
6:freezer:/user/root/0
5:hugetlb:/
4:memory:/user/root/0
3:rdma:/
2:perf_event:/
1:name=systemd:/user.slice/user-0.slice/session-37308.scope
0::/user.slice/user-0.slice/session-37308.scope