'unable to get systemd version' when using systemd cgroup driver
- Dominant language
- Go
- Stars
- 19.3k
- Forks
- 2k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 264
Description
### Description
We've been using the systemd cgroup driver for years, like so:
```rust
Command::new("runc")
.arg("--systemd-cgroup")
```
We're experiencing a consistent but low frequency container startup error that we'd like guidance on how to eliminate or be robust to.
```
running container: creating container: cannot set up cgroup for root: error parsing systemd version: unable to get systemd version
```
This is coming from: https://github.com/google/gvisor/blob/973b2f23e56686780f85560c1ec37fe6a0bc4c9e/runsc/cgroup/systemd.go#L268
```golang
func systemdVersion(conn *systemdDbus.Conn) (int, error) {
vStr, err := conn.GetManagerProperty("Version")
if err != nil {
return -1, errors.New("unable to get systemd version")
}
```
Based on observance of host metrics when this failure happens it seems related to load on the host, but our standard metrics (CPU, RAM, PSI) look fairly normal.
To make progress on this issue, we're considering:
* Logging the actual `err` instead of the hardcoded message.
* Adding a fallback to an environment read, or allowing that as an override
We don't really want to _retry_ the container creation in this situation. We'd prefer a solution which either internally retries, if that's necessary.
### Steps to reproduce
This is a sporadic error so we can't provide a reproduction.
### runsc version
```shell
-version
runsc version fb842aab7730
spec: 1.2.0
```
### docker version (if using docker)
```shell
```
### uname
`Linux ip-10-110-45-137.sa-east-1.compute.internal 5.15.0-309.180.4.el9uek.x86_64 #2 SMP Wed May 21 06:56:22 PDT 2025 x86_64 x86_64 x86_64 GNU/Linux`
### kubectl (if using Kubernetes)
```shell
n/a
```
### repo state (if built from source)
_No response_
### runsc debug logs (if available)
```shell
```
Contributor guide
Assessment
This issue has not been assessed yet.