shuveb / containers-the-hard-way

Learning about containers and how they work by creating them the hard way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal error Unable to write to cgroup notification file

pathcl opened this issue · comments

Hello there!

Thanks for making this project open source. I was trying to run it but stumble upon this issue:

#  ./gocker run alpine ls
2021/05/15 17:37:25 Cmd args: [./gocker run alpine /bin/sh
2021/05/15 17:37:25 New container ID: 52597f3d1b2d
2021/05/15 17:37:25 Image already exists. Not downloading.
2021/05/15 17:37:25 Image to overlay mount: 6dbb9cc54074
2021/05/15 17:37:25 Cmd args: [/proc/self/exe setup-netns 52597f3d1b2d]
2021/05/15 17:37:25 Cmd args: [/proc/self/exe setup-veth 52597f3d1b2d]
2021/05/15 17:37:25 Cmd args: [/proc/self/exe child-mode --img=6dbb9cc54074 52597f3d1b2d ls]
2021/05/15 17:37:25 Fatal error: Unable to write to cgroup notification file: open /sys/fs/cgroup/memory/gocker/52597f3d1b2d/notify_on_release: permission denied
2021/05/15 17:37:25 Fatal error: exit status 1

Any ideas?

Whether or not root is not being used to cause a permission issue?

I think theres something problematic with debian sid since I made it work under ubuntu 20

I've experienced the same issue on my Arch Linux distribution.

$ uname -a
Linux yokohama 5.16.2-arch1-1 #1 SMP PREEMPT Thu, 20 Jan 2022 16:18:29 +0000 x86_64 GNU/Linux

Not sure of the cause though.

I learnt that release_agent and notify_on_release features in CGroup v1 have been removed. Instead, CGroup v2 offers a more versatile mechanism called cgroup.events, which requires administrators to actively monitor the file to achieve the desired functionality.