-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
runc v1.2.1 appears to break Rootless BuildKit (cgroup: open /sys/fs/cgroup/snschvixiy3s74w74fjantrdg: no such file or directory
)
#4518
Comments
The current code flow of RemovePath is:
I see that the container's /sys/fs/cgroup is a read-only bind mount from the host's So, the question is
Or, perhaps,
@AkihiroSuda ^^^ PTAL |
The role of Probably EROFS can be always safely ignored? (at least when running in UserNS) |
Found out runc prints the following warning: {
"level": "warning",
"msg": "Creating a rootless container with no cgroup and no private pid namespace. Such configuration is strongly discouraged (as it is impossible to properly kill all container's processes) and will result in an error in a future runc version.",
"time": "2024-11-12T00:25:07Z"
} This happens when this codepath is hit: runc/libcontainer/process_linux.go Lines 564 to 576 in 8ed1850
In turn, runc/libcontainer/cgroups/fs2/fs2.go Lines 65 to 76 in 8ed1850
This means we haven't created the cgroup, and probably should not try to remove it at all; yet we try (and fail. Also, rmdir(2) returns EROFS instead of ENOENT when the cgroup is mounted read-only.
So, we have 3 issues here:
So, I guess, the biggest issue here is runc is not working correctly with cgroup-less containers. What it should do, I guess, if p.manager.Apply fails with ErrRootless, we should basically disable cgroupManager. |
One question, we returned EDIT: the cgroup path |
Oh, I have test it, the cgroup path is not exist.
|
I think it's hard to do, maybe not only |
If cgroup path is not set in any way, it is set to container id (in case of fs cgroup driver). First, cgroup.Name is set to container id here: Line 175 in 8ed1850
and then here: runc/libcontainer/specconv/spec_linux.go Line 749 in 8ed1850
|
Yes, I noted that earlier in #4518 (comment) I think that the most common code flow is when rmdir succeeds, and we should optimize for that. Meaning, try rmdir first, and if we got an error* try checking if the directory exists. This is actually what os.ReadDir could also do. In general, I think, it's better to not even try to remove what we haven't even created. |
Originally posted by @samiam in moby/buildkit#5491
The text was updated successfully, but these errors were encountered: