circleci-cli: Cannot run local job on Mac OSX Intel due to Docker error

Meta:

CircleCI CLI Version: 0.1.16947+263902a (homebrew)

Operating System: OSX Monterrey 12.2.1, Intel chip

Docker Desktop Version: 4.5.0 (74594)


Current behavior:

I cannot run any job in local, while those jobs in Cloud pass. This is probably linked to local Docker, but I have an up-to-date Docker Desktop on my laptop.

I tried to run the build job from here (and plenty of others)

Output:

Docker image digest: sha256:ffe408d1918ee63d412ab5c13e2adbfdbf97cb6117fa5487eff574a00842a599
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Kernel Version: 5.10.76-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64

Starting container cimg/base:2022.03
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image cache not found on this host, downloading cimg/base:2022.03
2022.03: Pulling from cimg/base
08c01a0ec47e: Pull complete 
1d1c3c495166: Pull complete 
1cd1b31a0b06: Pull complete 
e99d0fae9c42: Pull complete 
4ebcb4a2f6ca: Pull complete 
58dd3b8faeae: Pull complete 
Digest: sha256:ef15b3cd73e92cc53407da65863d7b1502e998e554050f6baeebe82137d901ed
Status: Downloaded newer image for cimg/base:2022.03
cimg/base:2022.03:
  using image cimg/base@sha256:ef15b3cd73e92cc53407da65863d7b1502e998e554050f6baeebe82137d901ed
  pull stats: download 333.3MiB in 3m10.408s (1.751MiB/s), extract 333.3MiB in 14.911s (22.35MiB/s)
  time to create container: 803ms
Creating Docker containers in parallel 
Time to upload agent and config: 2.6759242s
Error: 
Unexpected environment preparation error: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:385: applying cgroup configuration for process caused: cannot enter cgroupv2 "/sys/fs/cgroup/docker/fc0799a00885a53e63b75d735b16d8ddfc197209f7277880e9ff076179a40594/75198cc6fcc89554b5831fdbfeb2f9a2fe33bb5df1260f03fb38dc419f34718c" with domain controllers -- it is in an invalid state: unknown

Step failed
Task failed
Error: Unhandled prepare executor error: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:385: applying cgroup configuration for process caused: cannot enter cgroupv2 "/sys/fs/cgroup/docker/fc0799a00885a53e63b75d735b16d8ddfc197209f7277880e9ff076179a40594/75198cc6fcc89554b5831fdbfeb2f9a2fe33bb5df1260f03fb38dc419f34718c" with domain controllers -- it is in an invalid state: unknown

When did this begin / Was this previously working?:

I just installed circleci-cli on my Macbook, and it never worked. It also happened in a relative’s machine.

Additional Information:

I don’t have any issue with Docker in other use cases, I can properly run containers.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 32
  • Comments: 39

Most upvoted comments

There is another workaround in the related Docker Desktop issue that doesn’t require using an old Docker Desktop.

Edit “$HOME/Library/Group Containers/group.com.docker/settings.json” and update deprecatedCgroupv1 to true.

This requires Docker Desktop 4.6.0 or newer.

Can confirm, downgrading Docker Desktop to 4.2.0 solves this issue for now.

Same issue on Docker v4.15.0, on MacOS: 12.6, 2.4 GHz 8-Core Intel Core i9 Worked around with https://github.com/CircleCI-Public/circleci-cli/issues/672#issuecomment-1235768553, which is:

  1. edit ~/Library/Group Containers/group.com.docker/settings.json
  2. update deprecatedCgroupv1 to true
  3. Save changes
  4. Restart Docker

Downgrading Docker Desktop (currently from 4.10) to 4.2 is not a solution. It’s a workaround.

A fix should be implemented so we don’t have to stay on an outdated version. Unfortunately it sounds like that fix may have to be implemented in Docker, and not circleci.

Likewise, I had the same issue, until I downgraded to Docker Desktop 4.2.0, then I was able to run a circleci local execute.

Version numbers for when it wouldn’t run:

circlecli: 0.1.17183+341e493 (homebrew)
Docker Desktop 4.7.1 (77678)
macOS: 12.3.1 (M1 MBP)

Edit: When I downgraded the circleci CLI version and changed the SHA256 in build_agent_settings.json to sha256:008ba7f4223f1e26c11df9575283491b620074fa96da6961e0dcde47fb757014 as described here it worked for me under the current Docker Desktop too.

Reading this issue to see what the status is but seems to be a known issue, I believe https://github.com/CircleCI-Public/circleci-cli/issues/589

Any updates on when it’s going to be solved?

nope, 420 is the answer;) (docker desktop version)

Likewise, I had the same issue, until I downgraded to Docker Desktop 4.2.0, then I was able to run a circleci local execute.

Version numbers for when it wouldn’t run:

circlecli: 0.1.17183+341e493 (homebrew)
Docker Desktop 4.7.1 (77678)
macOS: 12.3.1 (M1 MBP)

Edit: When I downgraded the circleci CLI version and changed the SHA256 in build_agent_settings.json to sha256:008ba7f4223f1e26c11df9575283491b620074fa96da6961e0dcde47fb757014 as described here it worked for me under the current Docker Desktop too.

you saved my day.

I have the same problem with macOS monterey 12.1, Docker Desktop 4.6.0 (75818), circleci 0.1.17554+2b4b295 (homebrew)

There is another workaround in the related Docker Desktop issue that doesn’t require using an old Docker Desktop.

Edit “$HOME/Library/Group Containers/group.com.docker/settings.json” and update deprecatedCgroupv1 to true.

This requires Docker Desktop 4.6.0 or newer.

This works, the only missing step is that you need to restart docker

Yeah, also still seeing this on an Intel Mac with Monterey 12.3.1, Docker Desktop 4.8.1 (78998), and CircleCI v0.1.17554.

I’m getting the same error CircleCi: 0.1.16947+263902a (homebrew) Docker Desktop: 4.5.0 (74594) MacBook Pro: Monterey 12.2.1; M1 Pro

I see the same error on Intel MacOS 12.1 with both Docker 4.4.2 & 4.5, and MacOS 12.2.1 with Docker 4.5