Closed paulo-erichsen closed 3 years ago
Do you know whether this is specific to ARM?
I wonder if the issue is that cgroupv2 bpf rules aren't supported with the Arch Linux ARM kernel builds? Their kernel is missing cgroup.freeze
which means it's either quite old or has a bunch of features disabled.
EDIT: Nope, their kernel config has CONFIG_CGROUP_BPF=y
. But I'm then quite confused why cgroup.freeze
is missing -- their config also has CONFIG_CGROUP_FREEZER=y
...
EDIT: Oh, your kernel version is 4.9.x not the latest one. @paulohefagundes are you using a custom config or custom kernel?
Yeah we don't do hybrid mode cgroups -- so we require having all the necessary features for cgroupv2 or just use cgroupv1.
thank you guys for helping out. Thanks for your info I figured I could workaround and downgrade to cgroup v1 by adding systemd.unified_cgroup_hierarchy=0
to the kernel parameters and that got me to get docker working again
I am having the same issue, except running on a newer kernel (5.16.0) and setting systemd.unified_cgroup_hierarchy=0
does not seem to work.
$ sudo docker run --rm -it hello-world
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: bpf_prog_query(BPF_CGROUP_DEVICE) failed: function not implemented: unknown.
$ ls /sys/fs/cgroup/cgroup.controllers -la
-r--r--r-- 1 root root 0 Dec 8 03:10 /sys/fs/cgroup/cgroup.controllers
Dec 08 03:13:17 localhost dockerd[3434]: time="2021-12-08T03:13:17.010539224Z" level=info msg="starting signal loop" namespace=moby path=/run/docker/containerd/daemon/io.containerd.runtime.v2.task/moby/d3a22a23f42955c04dd1c3ae271a2d5bbf22bf787747976c20f059d620c93bbe pid=5798
Dec 08 03:13:17 localhost dockerd[3434]: time="2021-12-08T03:13:17.226684801Z" level=info msg="shim disconnected" id=d3a22a23f42955c04dd1c3ae271a2d5bbf22bf787747976c20f059d620c93bbe
Dec 08 03:13:17 localhost dockerd[3434]: time="2021-12-08T03:13:17.226990407Z" level=warning msg="cleaning up after shim disconnected" id=d3a22a23f42955c04dd1c3ae271a2d5bbf22bf787747976c20f059d620c93bbe namespace=moby
Dec 08 03:13:17 localhost dockerd[3434]: time="2021-12-08T03:13:17.227068693Z" level=info msg="cleaning up dead shim"
Dec 08 03:13:17 localhost dockerd[3434]: time="2021-12-08T03:13:17.282291867Z" level=warning msg="cleanup warnings time=\"2021-12-08T03:13:17Z\" level=info msg=\"starting signal loop\" namespace=moby pid=5827\n"
Dec 08 03:13:17 localhost dockerd[3434]: time="2021-12-08T03:13:17.283880641Z" level=error msg="copy shim log" error="read /proc/self/fd/13: file already closed"
Dec 08 03:13:17 localhost dockerd[3306]: time="2021-12-08T03:13:17.288216367Z" level=error msg="stream copy error: reading from a closed fifo"
Dec 08 03:13:17 localhost dockerd[3306]: time="2021-12-08T03:13:17.601330810Z" level=error msg="d3a22a23f42955c04dd1c3ae271a2d5bbf22bf787747976c20f059d620c93bbe cleanup: failed to delete container from containerd: no such container"
Dec 08 03:13:18 localhost dockerd[3306]: time="2021-12-08T03:13:18.130567189Z" level=error msg="Handler for POST /v1.41/containers/d3a22a23f42955c04dd1c3ae271a2d5bbf22bf787747976c20f059d620c93bbe/start returned error: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: bpf_prog_query(BPF_CGROUP_DEVICE) failed: function not implemented: unknown"
Client:
Version: 20.10.11
API version: 1.41
Go version: go1.17.3
Git commit: dea9396e18
Built: Sat Nov 20 14:08:33 2021
OS/Arch: linux/arm64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.11
API version: 1.41 (minimum version 1.12)
Go version: go1.17.3
Git commit: 847da184ad
Built: Sat Nov 20 14:08:02 2021
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: v1.5.8
GitCommit: 1e5ef943eb76627a6d3b6de8cd1ef6537f393a71.m
runc:
Version: 1.0.3
GitCommit: v1.0.3-0-gf46b6ba2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Client: [22/71]
Context: default
Debug Mode: false
Plugins:
buildx: Build with BuildKit (Docker Inc., v0.6.1-docker)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 4
Server Version: 20.10.11
Storage Driver: devicemapper
Backing Filesystem: ext4
Udev Sync Supported: true
Data file: /dev/loop0
Metadata file: /dev/loop1
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Deferred Removal Enabled: true
Deferred Deletion Enabled: true
Deferred Deleted Device Count: 0
Library Version: 1.02.181 (2021-10-20)
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
Default Runtime: runc
Init Binary: docker-init
containerd version: 1e5ef943eb76627a6d3b6de8cd1ef6537f393a71.m
runc version: v1.0.3-0-gf46b6ba2
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.16.0-rc2-1
Operating System: Arch Linux ARM
OSType: linux
Architecture: aarch64
$ sudo runc --debug --systemd-cgroup run test
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec[10891]: => nsexec container setup
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: ~> nsexec stage-0
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: spawn stage-1
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: -> stage-1 synchronisation loop
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-1[10893]: ~> nsexec stage-1
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-1[10893]: unshare remaining namespace (except cgroupns)
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-1[10893]: spawn stage-2
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-1[10893]: request stage-0 to forward stage-2 pid (10896)
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: stage-1 requested pid to be forwarded
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-2[1]: ~> nsexec stage-2
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: forward stage-1 (10893) and stage-2 (10896) pids to runc
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-1[10893]: signal completion to stage-0
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-1[10893]: <~ nsexec stage-1
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: stage-1 complete
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: <- stage-1 synchronisation loop
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: -> stage-2 synchronisation loop
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: signalling stage-2 to run
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-2[1]: unshare cgroup namespace
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-2[1]: signal completion to stage-0
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-2[1]: <= nsexec container setup
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-2[1]: booting up go runtime ...
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: stage-2 complete
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: <- stage-2 synchronisation loop
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() nsexec-0[10891]: <~ nsexec stage-0
DEBU[0000]github.com/opencontainers/runc/libcontainer/logs/logs.go:69 github.com/opencontainers/runc/libcontainer/logs.processEntry() child process in init()
ERRO[0000]github.com/opencontainers/runc/utils.go:57 main.fatal() container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: bpf_prog_query(BPF_CGROUP_DEVICE) failed: function not implemented
DEBU[0000]github.com/opencontainers/runc/utils.go:59 main.fatal() container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: bpf_prog_query(BPF_CGROUP_DEVICE) failed: function not implemented
@3nprob
bpf_prog_query(BPF_CGROUP_DEVICE) failed: function not implemented: unknown"
This error is different from the OP. Please make sure your kernel is built with CGROUP_BPF
.
https://github.com/torvalds/linux/blob/8ab774587903771821b59471cc723bba6d893942/init/Kconfig#L1140
@AkihiroSuda The odd thing is, it is:
$ zcat /proc/config.gz | grep -E 'CONFIG_BPF|CONFIG_FREEZER'
CONFIG_BPF=y
# CONFIG_BPF_SYSCALL is not set
CONFIG_BPF_JIT=y
CONFIG_BPF_JIT_DEFAULT_ON=y
CONFIG_FREEZER=y
# CONFIG_BPFILTER is not set
You need CONFIG_BPF_SYSCALL=y.
You need CONFIG_BPF_SYSCALL=y.
Aha! Thanks, will try that
Hello, I just upgraded Arch Linux ARM yesterday and after rebooting I can no longer run docker containers and I'm wondering if anyone can help
error
journalctl logs for docker.service when the above command is run
docker version
docker info
runc --debug
I also posted this question on the Arch Linux ARM forums