-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 podman with systemd doesn't work in jenkins #9410
Comments
I think you got to make sure dbus is running. |
In the container? I would assume that's the responsibility of systemd to start? |
Can you do a |
Or did you perhaps mean for the user on the host? You seem to be on to something there. If I switch to the jenkins user using And to be clear, things start working for the jenkins service, not just for the shell I got from So on that note, Besides things working, I also see the output from
So it seems I have a fix. :) However is it possible to make this less surprising? And perhaps automatic? I.e. could podman trigger systemd to set up what it is podman needs? |
No change as far as I can tell. And no output from
|
Can you try running the systemd container attached, instead of detached, and see if there's any output? Podman itself seems to be working fine here, so without getting error messages out of systemd in the container it will be very difficult to debug this. |
The systemd flags are not needed. Podman will figure this out itself. Podman really knows nothing about what is hapening inside of the continer other then it's entrypoint is |
@rhatdan I strongly suspect that the issue here is that systemd is not starting correctly in the container, and not anything directly related to dbus. |
Even if this is the case, there is nothing that can be done to make systemd start correctly from a POdman point of view, that we know about. But most likely there is something that can be done in the image, to ensure that the dbus gets started or reports an error why it did not start. |
I don't seem to be getting any output when I do that. Perhaps some flags are needed to get logging on stdout/stderr from systemd?
I see the same issue with a centos8 image, but that might be almost identical to the ubi8 one. Given the change in output of |
After a reboot I'm instead getting this for some reason:
So definitely not a problem with the image here as I don't get as far as starting it. I have not had time to debug things further. Should I open a new issue for this? |
This looks like the pids cgroup is not enabled? |
I'm afraid I'm not familiar enough with cgroups to know what that means. :/ Is it a bug? Misconfiguration? If so, where? podman? systemd? kernel? I'll try to debug this during the day, but any hints are much welcome. |
Systemd setup, I think. @giuseppe WDYT? |
I think the issue is that we are setting the default pids limit even with cgroupfs and the rootless user has no way to configure cgroupfs |
The output from I also got it worked randomly again, but I'm failing to pinpoint exactly exactly what gets things going. Perhaps it's some background job and that's why I can't make sense of it... |
I also seem to see some difference in @@ -837,844 +878,1744 @@
/sys/fs/cgroup/user.slice/cgroup.threads
/sys/fs/cgroup/user.slice/user-984.slice
/sys/fs/cgroup/user.slice/user-984.slice/cgroup.events
+/sys/fs/cgroup/user.slice/user-984.slice/memory.events
/sys/fs/cgroup/user.slice/user-984.slice/io.pressure
/sys/fs/cgroup/user.slice/user-984.slice/cgroup.procs
+/sys/fs/cgroup/user.slice/user-984.slice/memory.swap.current
+/sys/fs/cgroup/user.slice/user-984.slice/memory.swap.max
+/sys/fs/cgroup/user.slice/user-984.slice/memory.swap.events
/sys/fs/cgroup/user.slice/user-984.slice/cgroup.max.descendants
/sys/fs/cgroup/user.slice/user-984.slice/cpu.stat
/sys/fs/cgroup/user.slice/user-984.slice/memory.pressure
+/sys/fs/cgroup/user.slice/user-984.slice/memory.current
+/sys/fs/cgroup/user.slice/user-984.slice/pids.current
+/sys/fs/cgroup/user.slice/user-984.slice/memory.stat
+/sys/fs/cgroup/user.slice/user-984.slice/pids.events
+/sys/fs/cgroup/user.slice/user-984.slice/memory.low
/sys/fs/cgroup/user.slice/user-984.slice/cpu.pressure
/sys/fs/cgroup/user.slice/user-984.slice/cgroup.type
/sys/fs/cgroup/user.slice/user-984.slice/cgroup.stat
/sys/fs/cgroup/user.slice/user-984.slice/cgroup.threads
/sys/fs/cgroup/user.slice/user-984.slice/cgroup.freeze
+/sys/fs/cgroup/user.slice/user-984.slice/memory.min
|
I am also running into this situation in a rootless mode on RHEL 8.3. I haven't been on my desktop since Dec 1, and I just upgraded it to the latest 8.3 packages and I can no longer run any container on my system via rootless. I had tried renaming my user's libpod.conf to containers.conf after getting a deprecation notice, and then ultimately replaced it with /usr/share/containers/containers.conf, setting the default runtime to "crun". I have CGroupsV2 enabled on my workstation with
podman version
podman info --debug
~/.config/containers/storage.conf
|
@CendioOssman I think we may need to file a bug against RHEL in Bugzilla. I just reverted to CGroupsV1 on my workstation and rootless containers work just fine again, at least in basic testing. There's this[0], but I'm not sure if it's exactly related. Podman 3.x will be in RHEL 8.4 due out around Summit, so maybe holding back on cgv2 unti then is the best choice. |
there is currently a systemd issue on RHEL 8.3 when running on cgroup v2 that prevents controllers to be delegated to unprivileged users. This is being worked on as we speak. In the meanwhile you can try to workaround the issue by removing the pids limit in the containers.conf file. It won't make the containers less safe than when running on cgroup v1 (since cgroups are never used there for rootless users). |
But it is less safe when running cgroup v2? Or the workaround won't work? |
having a pids limit is surely better as it avoids that a container can create too many processes, so at the moment it is either using cgroup v1 or cgroup v2 without the pids cgroup configured |
Great, thanks! So with that I seem to have the workarounds needed. To summarize, for those finding this issue later, what you need to do is:
|
@CendioOssman that's a good point, I wasn't thinking about systemd in a container. As for the ticket, there were a few regarding rootless but they seemed to be reporting different errors. I may have just missed that one pointing out what was going on. I'll link mine to that one and close it. And I can confirm on my side that workaround works just fine, back to cgroupsv2 we go! Thanks @giuseppe |
Once you go cgroups V2, you never go back. |
@CendioOssman as I do not have a containers.conf in I need to try adding the |
I was able to use the containers.conf and copy the commented pids_limit config line into |
/kind bug
Description
We're trying to to get a container running under Jenkins in rootless mode and are failing miserably. This container needs to have systemd running, but it fails to start properly for unknown reasons. This is a simple test build that fails (based on #8965):
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
This is on a RHEL 8 system. It's been reconfigured to use cgroups v2 and we've made sure that subuid/subgid are configured for the jenkins user. Jenkins is also configured to run as
unconfined_t
to avoid SELinux issues.Running those same commands as a root works fine. As does running them as a different user. Both accessed using ssh.
Using
sudo podman
in jenkins solves the issue, but we'd rather avoid that if we don't need root privileges.#7417 might be related, but I don't understand the details enough to say for sure.
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
We have not tested with a newer version, no. The troubleshooting guide didn't seem to have anything relevant to our case.
Additional environment details (AWS, VirtualBox, physical, etc.):
Virtual machine on a vSphere environment.
The text was updated successfully, but these errors were encountered: