Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rootless runc exec causes panic: cannot statfs cgroup root (When /sys is not mounted) #2573

Closed
coryb opened this issue Sep 3, 2020 · 9 comments

Comments

@coryb
Copy link
Contributor

coryb commented Sep 3, 2020

Seeing a panic from runc exec when run with rootlesskit.

Here is the full stack, runc built from latest master

panic: cannot statfs cgroup root

goroutine 1 [running, locked to thread]:
github.com/opencontainers/runc/libcontainer/cgroups.IsCgroup2UnifiedMode.func1()
        /go/src/github.com/opencontainers/runc/libcontainer/cgroups/utils.go:45 +0xc5
sync.(*Once).doSlow(0x56030c2f2dd8, 0x56030c00ccc0)
        /usr/lib/go-1.15/src/sync/once.go:66 +0xee
sync.(*Once).Do(...)
        /usr/lib/go-1.15/src/sync/once.go:57
github.com/opencontainers/runc/libcontainer/cgroups.IsCgroup2UnifiedMode(0x20)
        /go/src/github.com/opencontainers/runc/libcontainer/cgroups/utils.go:42 +0x5a
github.com/opencontainers/runc/libcontainer.cgroupfs(0xc0001ae120, 0xc00000f000, 0x56030c021f00, 0x56030c29da60)
        /go/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:121 +0x28
github.com/opencontainers/runc/libcontainer.Cgroupfs(...)
        /go/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:134
github.com/opencontainers/runc/libcontainer.New(0x0, 0x0, 0x0, 0x0, 0x0, 0xc0001aad88, 0x56030c021f60, 0xc000253618, 0x0)
        /go/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:199 +0x165
main.glob..func6(0xc00012e840, 0x0, 0xc000059b60)
        /go/src/github.com/opencontainers/runc/init.go:42 +0x39
github.com/urfave/cli.HandleAction(0x56030bf6e900, 0x56030c00dd18, 0xc00012e840, 0xc00012e840, 0x0)
        /go/src/github.com/opencontainers/runc/vendor/github.com/urfave/cli/app.go:523 +0xfd
github.com/urfave/cli.Command.Run(0x56030bc94f87, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x56030bcb2599, 0x51, 0x0, ...)
        /go/src/github.com/opencontainers/runc/vendor/github.com/urfave/cli/command.go:174 +0x58e
github.com/urfave/cli.(*App).Run(0xc0001208c0, 0xc00000e080, 0x2, 0x2, 0x0, 0x0)
        /go/src/github.com/opencontainers/runc/vendor/github.com/urfave/cli/app.go:276 +0x7d4
main.main()
        /go/src/github.com/opencontainers/runc/main.go:151 +0xc6c
exec failed: container_linux.go:370: starting container process caused: read init-p: connection reset by peer

Currently seeing this via some work I am doing on buildkit, I have not tried to narrow it down outside of buildkit yet.

cc @AkihiroSuda

@AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda changed the title rootless runc exec causes panic: cannot statfs cgroup root rootless runc exec causes panic: cannot statfs cgroup root (When /sys is not mounted) Sep 3, 2020
@cyphar
Copy link
Member

cyphar commented Sep 3, 2020

A panic is less than ideal, but runc cannot work without cgroupfs -- it would be unsafe to create containers without at least the devices cgroup (or the whole eBPF rule setup under cgroupv2).

@AkihiroSuda
Copy link
Member

@cyphar This issue is about rootless mode

@ashwani29

This comment has been minimized.

@cyphar
Copy link
Member

cyphar commented Sep 5, 2020

@AkihiroSuda Ah sorry, I missed the mention of RootlessKit in the description.

@cyphar
Copy link
Member

cyphar commented Sep 5, 2020

@ashwani29 No. A rootless container is a container which is configured and created by an unprivileged user (in contrast to standard Docker-like setups where the whole thing is configured by a daemon that runs as root). The most likely reason why sudo ... isn't working in your container is that most containers don't include a sudo binary (the "sudo" package isn't usually installed for container images because it's a waste of space -- most containers don't need sudo anyway).

@ashwani29

This comment has been minimized.

@cyphar
Copy link
Member

cyphar commented Sep 5, 2020

Your questions aren't related to this issue, and you're basically asking for us to help you with checkpoint-restore/criu#1199. I posted a comment there, but I would really appreciate it if you'd stop commenting on unrelated issues with support questions (I believe this is at least the third time you've done this now).

@cyphar
Copy link
Member

cyphar commented Oct 29, 2020

#2634 was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants