Error: Unexpected environment preparation error: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: unable to apply cgroup configuration: cannot enter cgroupv2

After solving this Circleci local execute --job test-android fails because of missing android:2021.10.1 image, is it from docker hub? - #2 by rit1010

Logs…

% circleci local execute --job test-android
Fetching latest build environment...
Docker image digest: sha256:b71a5a7b83a922bf8e5b645b0be34a27e663e719a10cf08a5938f39e1db08004
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Kernel Version: 5.10.104-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64

Starting container cimg/android:2022.07.1-node
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image is cached as cimg/android:2022.07.1-node, but refreshing...
cimg/android:2022.07.1-node:
  using image cimg/android@sha256:d1b3c4bf43632d30c97fdc482395e9650b86bd8f2a50b3b3893b0d780623f016
  pull stats: Image was already available so the image was not pulled
  time to create container: 88ms
Creating Docker containers in parallel 
2022.07.1-node: Pulling from cimg/android
Digest: sha256:d1b3c4bf43632d30c97fdc482395e9650b86bd8f2a50b3b3893b0d780623f016
Status: Image is up to date for cimg/android:2022.07.1-node
Time to upload agent and config: 4.364633502s
Error: 
Unexpected environment preparation error: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: unable to apply cgroup configuration: cannot enter cgroupv2 "/sys/fs/cgroup/docker/37b25bb1f335ca480d623c41e1ac646b1b74c4e26fa013e5243f67a3e2b0b06d/b0f26ee00fa91e1b66a119e82b27538bb981a7e1f4831511d414f732258d9234" with domain controllers -- it is in an invalid state: unknown

Step failed
Task failed
Error: Unhandled prepare executor error: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: unable to apply cgroup configuration: cannot enter cgroupv2 "/sys/fs/cgroup/docker/37b25bb1f335ca480d623c41e1ac646b1b74c4e26fa013e5243f67a3e2b0b06d/b0f26ee00fa91e1b66a119e82b27538bb981a7e1f4831511d414f732258d9234" with domain controllers -- it is in an invalid state: unknown
2 Likes

Hi @riamuapp,
Sometimes restarting Docker fixes that, but you’ve probably done that if you’re posting this.

If you’re on an Intel Mac, this might help: Cannot run local job on Mac OSX Intel due to Docker error · Issue #672 · CircleCI-Public/circleci-cli · GitHub

I am on Mac M1.

2 Likes

@riamuapp, ah, I’m not sure what to say, then.

Has anyone found a solution to this problem? Also experiencing it on an M1 mac when running the job via CLI.

Кто нибудь нашел решение данной проблеме? Тоже на Mac M1

This answer on the related GitHub issue helped me fix this on an intel Mac:

TL;DR
Edit
$HOME/Library/Group Containers/group.com.docker/settings.json and set deprecatedCgroupv1 to true.

1 Like