GetCpuLoad Failed on cgroup v2 environment - Ubuntu 24.04.2 LTS
- Dominant language
- Go
- Stars
- 19.4k
- Forks
- 2.5k
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 1
Description
Description:
I am encountering a "Failed to create a Container Manager: mountpoint for cpu not found" error when trying to run the cAdvisor container on an Ubuntu 24.04.2 LTS system that uses cgroup v2.
Environment:
Operating System: Ubuntu 24.04.2 LTS
Kernel Version: $(uname -r) (which is 6.8.0-59-generic)
Docker Version:
Version: 26.1.3
API version: 1.45
Go version: go1.22.2
Git commit: 26.1.3-0ubuntu1~24.04.1
Built: Mon Oct 14 14:29:26 2024
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 26.1.3
API version: 1.45 (minimum version 1.24)
Go version: go1.22.2
Git commit: 26.1.3-0ubuntu1~24.04.1
Built: Mon Oct 14 14:29:26 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.24
GitCommit:
runc:
Version: 1.1.12-0ubuntu3.1
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
cgroup Version: cgroup v2 (confirmed by mount | grep cgroup output: cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0)
Steps to Reproduce:
Attempt to run the cAdvisor container using the following docker run command:
Bash
docker run \
--volume=/var/run:/var/run:ro \
--volume=/:/rootfs:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--volume=/sys:/sys:ro \
--volume=/dev/disk/:/dev/disk:ro \
--volume=/sys/fs/cgroup:/sys/fs/cgroup:ro \
--publish=8080:8080 \
--detach=true \
--name=cadvisor \
gcr.io/google-containers/cadvisor:latest
Check the container logs:
Bash
docker logs cadvisor
Expected Behavior:
cAdvisor container should start without errors and begin collecting metrics from the Docker host and containers.
Actual Behavior:
The cAdvisor container exits with the following error in the logs:
F[timestamp] 1 cadvisor.go:158] Failed to create a Container Manager: mountpoint for cpu not found
Attempts Made (and Failed):
I have tried the following variations of the docker run command:
Mounting specific cgroup v1 subdirectories (e.g., /sys/fs/cgroup/cpu:/sys/fs/cgroup/cpu:ro) - (if you tried this)
Setting environment variable CGROUP_ROOT=/sys/fs/cgroup
Setting environment variables CONTAINER_RUNTIME=docker and RKT_CONTAINER_RUNTIME=docker
Setting environment variable CADVISOR_CGROUP_VERSION=2
Using --cgroupns=host
Trying older versions of the cAdvisor image (e.g., gcr.io/google-containers/cadvisor:v0.47.0, gcr.io/google-containers/cadvisor:v0.43.0) - (if you tried specific versions that failed)
None of these attempts have resolved the "mountpoint for cpu not found" error.
Additional Information:
Output of mount | grep cgroup:
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
Output of cat /proc/cmdline:
BOOT_IMAGE=/vmlinuz-6.8.0-59-generic root=UUID=a191e346-9ec3-4394-b034-b1545dbf4eaf ro console=tty0 console=ttyS0,115200 earlyprintk=ttyS0,115200 consoleblank=0 memhp_default_state=online console=tty1 console=ttyS0
Contributor guide
Assessment
This issue has not been assessed yet.