You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using podman & buildah on our self-hosted GitHub runners to run and build containers. Since we started this >1 year ago, we always had lingering enabled to have correctly working user sessions for pull secrets and other stuff.
At some point in the past weeks, there must have been a change regarding systemd and cgroups, since we suddenly started to get warnings about a missing user session, remarkably the output always appears multiple times.
It looks like this:
$ /bin/buildah version
time="2024-04-08T15:05:09+02:00" level=warning msg="The cgroupv2 manager is set to systemd but there is no systemd user session available"
time="2024-04-08T15:05:09+02:00" level=warning msg="For using systemd, you may need to log in using a user session"
time="2024-04-08T15:05:09+02:00" level=warning msg="Alternatively, you can enable lingering with: `loginctl enable-linger 1001` (possibly as root)"
time="2024-04-08T15:05:09+02:00" level=warning msg="Falling back to --cgroup-manager=cgroupfs"
Version: 1.35.1
Go Version: go1.21.7 (Red Hat 1.21.7-1.el9)
Image Spec: 1.1.0
Runtime Spec: 1.1.0
CNI Spec: 1.0.0
libcni Version: v1.1.2
image Version: 5.30.0
Git Commit:
Built: Tue Mar 19 13:37:29 2024
OS/Arch: linux/amd64
BuildPlatform: linux/amd64
$ /bin/buildah bud -f /home/github/runner_0/_work/project/Dockerfile --format docker --tls-verify=true --layers=false --ulimit=nofile=262144:262144 -v=/home/github/cache/go:/go/pkg/mod:shared,rw -t registry/image:main /home/github/runner_0/_work/project
time="2024-04-08T15:05:09+02:00" level=warning msg="The cgroupv2 manager is set to systemd but there is no systemd user session available"
time="2024-04-08T15:05:09+02:00" level=warning msg="For using systemd, you may need to log in using a user session"
time="2024-04-08T15:05:09+02:00" level=warning msg="Alternatively, you can enable lingering with: `loginctl enable-linger 1001` (possibly as root)"
time="2024-04-08T15:05:09+02:00" level=warning msg="Falling back to --cgroup-manager=cgroupfs"
time="2024-04-08T15:05:09+02:00" level=warning msg="The cgroupv2 manager is set to systemd but there is no systemd user session available"
time="2024-04-08T15:05:09+02:00" level=warning msg="For using systemd, you may need to log in using a user session"
time="2024-04-08T15:05:09+02:00" level=warning msg="Alternatively, you can enable lingering with: `loginctl enable-linger 1001` (possibly as root)"
time="2024-04-08T15:05:09+02:00" level=warning msg="Falling back to --cgroup-manager=cgroupfs"
[1/2] STEP 1/6: FROM golang:1.22-alpine AS builder
...
The builds are done via a separate non-root user, that doesn't have a user session, only a systemd service for the GitHub agent. But we enabled lingering, I can also confirm this when connecting via SSH and checking as root:
sudo -u test buildah version => warnings still appear
Describe the results you received:
Multiple messages like these - two for buildah build, one for buildah version:
time="2024-04-08T15:05:09+02:00" level=warning msg="The cgroupv2 manager is set to systemd but there is no systemd user session available"
time="2024-04-08T15:05:09+02:00" level=warning msg="For using systemd, you may need to log in using a user session"
time="2024-04-08T15:05:09+02:00" level=warning msg="Alternatively, you can enable lingering with: `loginctl enable-linger 1001` (possibly as root)"
time="2024-04-08T15:05:09+02:00" level=warning msg="Falling back to --cgroup-manager=cgroupfs"
After diving into the code a bit, it seems to be caused by the detection of the systemd user session. In config.go, the env var DBUS_SESSION_BUS_ADDRESS is used to determine if there is a systemd user session.
In our case, we have self-hosted GitHub Action runners, that are started by a user without an active session, but with lingering enabled. When I execute printenv in a GitHub Actions workflow on our runners, there are a lot of GitHub-related env vars, but no DBUS_SESSION_BUS_ADDRESS, causing the above mentioned warning message. Now I wonder if we should just export this env var everywhere, or if there is a better way to detect a systemd user session.
Regarding my reproduction steps, I guess these aren't valid. If I execute this
$ sudo -u test echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/run/user/1000/bus
I get the path for the user who is executing the command, not the test user.
BUG REPORT INFORMATION
Description
We are using podman & buildah on our self-hosted GitHub runners to run and build containers. Since we started this >1 year ago, we always had lingering enabled to have correctly working user sessions for pull secrets and other stuff.
At some point in the past weeks, there must have been a change regarding systemd and cgroups, since we suddenly started to get warnings about a missing user session, remarkably the output always appears multiple times.
It looks like this:
The builds are done via a separate non-root user, that doesn't have a user session, only a systemd service for the GitHub agent. But we enabled lingering, I can also confirm this when connecting via SSH and checking as root:
I could also reproduce the issue on my local Fedora 39 setup.
Steps to reproduce the issue:
On Fedora/RHEL-based systems:
sudo useradd test
sudo -u test buildah version
=> creates warningsudo loginctl enable-linger 1001 && sudo loginctl user-status 1001
=> lingering enabledsudo -u test buildah version
=> warnings still appearDescribe the results you received:
Multiple messages like these - two for
buildah build
, one forbuildah version
:Describe the results you expected:
None of the warnings
Output of
rpm -q buildah
orapt list buildah
:Output of
buildah version
:Output of
podman version
if reporting apodman build
issue:Output of
cat /etc/*release
:Output of
uname -a
:Output of
cat /etc/containers/storage.conf
:The text was updated successfully, but these errors were encountered: