Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[circleci local execute] error looking up cgroup: not implemented for cgroup v2 unified hierarchy #589

Closed
ldorau opened this issue Apr 16, 2021 · 68 comments
Labels
bug Something isn't working

Comments

@ldorau
Copy link

ldorau commented Apr 16, 2021

Meta:

CircleCI CLI Version:
0.1.15195+595cc9e (release)

Operating System:
Arch Linux (latest)

CircleCI CLI Diagnostic:

---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /home/ldorau/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
OK, got a token.
Trying an introspection query on API... 
Ok.
Hello, Lukasz Dorau.

Current behavior:

$ circleci local execute
Docker image digest: sha256:fc6b14595a231dd8417c97fad26f5f5f294f64b6f58443d93dfba17186f9f738
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: systemd
 Cgroup Version: 2
 Kernel Version: 5.9.14-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64

Error: 
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Step failed
Task failed
Error: Unhandled prepare executor error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Expected behavior:

"circleci local execute" works

When did this begin?

Now

Was this previously working?:

No, never.

@ldorau ldorau added the bug Something isn't working label Apr 16, 2021
@mshang816
Copy link

got the same issue. I have docker installed and working properly.

@drownbes
Copy link

drownbes commented Jun 7, 2021

Same for me

circleci version 
0.1.15224+605a617 (release)

Build-agent version  ()
System information:
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: systemd
 Cgroup Version: 2
 Kernel Version: 5.12.9-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64

@Draiken
Copy link

Draiken commented Jun 16, 2021

Same issue

➜  hub-core-rb 82c60b9c:luiz/ch85328/e2e-docker  circleci local execute
Downloading latest CircleCI build agent...
Docker image digest: sha256:e35e2f2d58aed45b54bdf31dd5dd933626e28b10152d92b6b41c01029c8e9b82
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: systemd
 Cgroup Version: 2
 Kernel Version: 5.12.10-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64

Error: 
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

I'm fairly certain this will only work if the kernel parameter systemd.unified_cgroup_hierarchy=false is set.
This is not a runtime parameter so it has to be set on kernel compilation or at the bootloader

@dreamsmasher
Copy link

dreamsmasher commented Jun 24, 2021

Same here, guess everybody's on Arch.

> circleci version
0.1.15384+149d854 (release)

Build-agent version  ()
System information:
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: systemd
 Cgroup Version: 2
 Kernel Version: 5.12.12-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64

@fanninpm
Copy link

I get the same error, on Manjaro (an Arch derivative).

Docker image digest: sha256:9524aa2e013fc3b8fe0244034a59af8d71d9f32c77b33d41a008b3a533f2cc77
�[36m====>> Spin up environment�[0m
Build-agent version  ()
System information:
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: systemd
 Cgroup Version: 2
 Kernel Version: 5.12.9-1-MANJARO
 Operating System: Manjaro Linux
 OSType: linux
 Architecture: x86_64

�[31mError: 
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy
�[0m
�[31mStep failed�[0m
�[31mTask failed�[0m
Error: Unhandled prepare executor error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

@mike-hearn
Copy link

I updated my Arch packages, annnnnnd here we are.

====>> Spin up environment
Build-agent version  ()
Docker Engine Version: 20.10.7
Kernel Version: Linux b20d89cca69a 5.11.22-2-MANJARO #1 SMP PREEMPT Fri May 21 17:45:54 UTC 2021 x86_64 Linux
Error: 
Unexpected environment preparation error: error looking up cgroup: mountpoint for cpu not found

Step failed
Task failed
Error: Unhandled prepare executor error: error looking up cgroup: mountpoint for cpu not found

@dgoffredo
Copy link

dgoffredo commented Jul 1, 2021

Looks like this error from this library.

These docs say that with a recent version of the library and with a recent Linux kernel, the kernel parameter systemd.unified_cgroup_hierarchy=1 will cause cgroups v2 to be used by the library. However, I have this parameter on my system (as part of GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub), but I still get the error mentioned in this issue.

It looks like circleci-cli needs to update its version of runc [edit: I did some digging around, and it seems more likely that the non-public circleci/picard Docker image is what needs to update runc.]. See, for example, a similar error message in another issue:

docker: Error response from daemon: OCI runtime create failed: this version of runc doesn't work on cgroups v2: unknown.

Edit: Update

I pulled circleci/picard and poked around inside:


$ docker run --rm --interactive --tty --entrypoint=/bin/sh circleci/picard

/ #

/ # cd /opt/circleci

/opt/circleci # grep 'runc@' ./linux/arm64/circleci-agent
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/user/lookup.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/user/user.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/configs/namespaces_linux.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/configs/namespaces_syscall.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/cgroups/utils.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/cgroups/v1_utils.go

It looks like the latest circleci/picard is using [email protected]. In that release, cgroupv2 support was still considered experimental per the previous release (rc91), and wasn't considered "fully ready for production" until the following release (rc93).

@DominikWolek
Copy link

Same issue on Arch Linux:

Docker image digest: sha256:151ec092e49f9a333d76e111818289af750d1b31d3a0ee2f22e24214e2724d49
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: systemd
 Cgroup Version: 2
 Kernel Version: 5.12.14-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64

Error: 
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Step failed
Task failed
Error: Unhandled prepare executor error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

@fanninpm
Copy link

I have more information about this problem that the CircleCI folks are conveniently ignoring. (Yes, I'm still using the AUR package, not the snap.)

Downloading latest CircleCI build agent...
Docker image digest: sha256:26c7e7103a6e2e20816ab4fb2529700910db617b2da3a642021d25cf0be36ba0
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: systemd
 Cgroup Version: 2
 Kernel Version: 5.13.4-1-MANJARO
 Operating System: Manjaro Linux
 OSType: linux
 Architecture: x86_64

Error: 
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Step failed
Task failed
process panic
goroutine 1 [running]:
runtime/debug.Stack(0x1476a36, 0x8, 0x0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x9f
github.com/circleci/build-agent/cmd/internal/setup.PanicHandler()
        /mnt/ramdisk/circleci/project/cmd/internal/setup/handlers.go:23 +0xce
panic(0x12b2b20, 0x1ea31d0)
        /usr/local/go/src/runtime/panic.go:965 +0x1b9
github.com/circleci/build-agent/outer/docker.(*DockerExecutor).Cleanup(0xc000120000, 0x16dc7a8, 0xc000519560, 0x0, 0x0)
        /mnt/ramdisk/circleci/project/outer/docker/cleanup.go:35 +0x223
github.com/circleci/build-agent/outer.ConfigureAndRun.func4(0x16e0618, 0xc000120000)
        /mnt/ramdisk/circleci/project/outer/run.go:228 +0x14d
github.com/circleci/build-agent/outer.ConfigureAndRun(0x16dc7e0, 0xc00003c100, 0xc0000d6c78, 0x15, 0x0, 0x0, 0xc000040120, 0x16, 0x0, 0x0, ...)
        /mnt/ramdisk/circleci/project/outer/run.go:260 +0x22c0
github.com/circleci/build-agent/cmd/internal/outer/local.runExecuteJob(0xc00048c700, 0x5fec00, 0x169c2d0, 0x12, 0x0, 0x0)
        /mnt/ramdisk/circleci/project/cmd/internal/outer/local/execute.go:123 +0x295
github.com/circleci/build-agent/cmd/internal/outer/local.NewExecuteJobCmd.func1(0xc000480280, 0xc0004edd20, 0x0, 0x2, 0x0, 0x0)
        /mnt/ramdisk/circleci/project/cmd/internal/outer/local/execute.go:65 +0x45
github.com/spf13/cobra.(*Command).execute(0xc000480280, 0xc0004edd00, 0x2, 0x2, 0xc000480280, 0xc0004edd00)
        /home/circleci/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc000480000, 0xc00003d190, 0x3, 0xc00009a070)
        /home/circleci/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /home/circleci/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/circleci/build-agent/cmd.Execute()
        /mnt/ramdisk/circleci/project/cmd/root.go:64 +0x194
main.main()
        /mnt/ramdisk/circleci/project/main.go:14 +0xdb

I wonder if this will become a bigger problem when Debian Bullseye gets released as stable.

@patrickclery
Copy link

I can confirm that the fix mentioned by @dgoffredo works for Manjaro.


How to fix

sudo vim /etc/defaults/grub 

Change this line:

GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=1"

Update Grub:

sudo update-grub

Reboot.

@dgoffredo
Copy link

I still get the following error when trying to locally run a CI job from a repository I work on:

$ circleci local execute
Docker image digest: sha256:5bc33117a2ea3be8ed7cc8aab995fc69906a1112249e814fa8e7476b570a03a0
====>> Spin up environment
Build-agent version  ()
System information:
Error determining system info
Error: 
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Step failed
Task failed
Error: Unhandled prepare executor error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

I see that the most recent circleci/picard image has a newer runc version:

$ docker pull circleci/picard
Using default tag: latest
latest: Pulling from circleci/picard
29291e31a76a: Pull complete 
8afb3f12a298: Pull complete 
f150479d1511: Pull complete 
2e647f59c548: Pull complete 
da193f18bce6: Pull complete 
7c602d616b9c: Pull complete 
c402e98532e9: Pull complete 
Digest: sha256:5bc33117a2ea3be8ed7cc8aab995fc69906a1112249e814fa8e7476b570a03a0
Status: Downloaded newer image for circleci/picard:latest
docker.io/circleci/picard:latest

$ docker run --rm --interactive --tty --entrypoint=/bin/sh circleci/picard
/ # cd /opt/circleci/linux/amd64
/opt/circleci/linux/amd64 # ls
circleci-agent
/opt/circleci/linux/amd64 # grep 'runc@' circleci-agent 
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/user/user.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/devices/device_unix.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/configs/namespaces_linux.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/configs/namespaces_syscall.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/userns/userns_linux.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/user/lookup_unix.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/cgroups/utils.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/cgroups/v1_utils.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/cgroups/file.go
/opt/circleci/linux/amd64 # 

$

I tried running all of sudo circleci update, circleci update build-agent, and reinstalling circleci from source based off of the current master branch. None of those prevent the error message above on my system.

cgroup v2 is enabled already:

$ grep 'cgroup' /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="systemd.unified_cgroup_hierarchy=1"
# Enable cgroup v2.  See <https://kind.sigs.k8s.io/docs/user/rootless/>.
GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=1"

$

@DavidS-cloud
Copy link

FWIW, I think systemd.unified_cgroup_hierarchy needs to be set to 0 (zero) to enable cgroup v1 behaviour. At least it worked for me when setting it to 1 did not.

@snowinferno
Copy link

I'm experiencing this same issue on OSX Big Sur.
Happens whether I use brew install circlecli or use the provided curl command for Mac/Linux

$ circleci diagnostic

---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /Users/greg.wilburn/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
OK, got a token.
Trying an introspection query on API...
Ok.
Hello, Greg Wilburn.
$ circleci local execute

Docker image digest: sha256:130f2f80984be6c2336ae57c48cd2b666061a82660740e027ac63e96eed8c0ad
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.11
 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

Error:
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Step failed
Task failed
Error: Unhandled prepare executor error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

@umihico
Copy link

umihico commented Dec 8, 2021

My macbook is facing same error. circleci/picard version can be specified by modifing ~/.circleci/build_agent_settings.json JFYI. I tried some but couldn't get fixed yet. Could be not related.

@miketheman
Copy link

Hitting this today on MacOS Monterey.

$ circleci local execute --job build
Docker image digest: sha256:e025cba3f5236a7e3ed9b97dfadce44c824ea0cc1ae1427823ff4c1dd2f420c3
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.11
 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

Error:
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Step failed
Task failed
Error: Unhandled prepare executor error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

This is using the latest circleci/picard - released ~an hour ago - https://hub.docker.com/layers/circleci/picard/1.0.95690-99ec9ada/images/sha256-e025cba3f5236a7e3ed9b97dfadce44c824ea0cc1ae1427823ff4c1dd2f420c3?context=explore

We can also see that runc is up to 1.0.3:

docker run --rm --interactive --tty --entrypoint=/bin/sh circleci/picard
/ # cd /opt/circleci
/opt/circleci # grep 'runc@' ./linux/arm64/circleci-agent
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/user/user.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/devices/device_unix.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/configs/namespaces_linux.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/configs/namespaces_syscall.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/userns/userns_linux.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/user/lookup_unix.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/cgroups/utils.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/cgroups/v1_utils.go
/home/circleci/go/pkg/mod/github.com/opencontainers/[email protected]/libcontainer/cgroups/file.go

This is bothersome, since I can no longer test out circleci changes and have to use remote resources to debug.

@mjsteinbaugh
Copy link

mjsteinbaugh commented Dec 14, 2021

I'm seeing this also when attempting to test bioconda builds on a MacBook locally.

@podplatnikm
Copy link

podplatnikm commented Dec 20, 2021

Any update on this?

circleci local execute --job test
Docker image digest: sha256:eb0c4688f843e6987c29f72c9fdf8c910d59b2a72c7e1559d46a3b1837038cdb
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.11
 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: aarch64

Error: 
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Step failed
Task failed
Error: Unhandled prepare executor error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy
circleci version
0.1.16535+5010eb7 (homebrew)

@kienstra
Copy link

kienstra commented Dec 20, 2021

Also seeing this with Docker Desktop 4.3.1 (72247) and a 2019 MacBook Pro running macOS 12.0.1 (21A559). It was fine with Docker Desktop 4.2.0.

====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.11
 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

Error: 
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Step failed
Task failed
Error: Unhandled prepare executor error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Running the latest CircleCI CLI (v0.1.16535).

@vingov
Copy link

vingov commented Dec 20, 2021

Running into the same issue with the latest CircleCI CLI (v0.1.16535) after upgrading the local docker desktop to the latest version 4.3.1 (72247) on Mac.

====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.11
 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

Error:
Unexpected environment preparation error: error looking up cgroup: not implemented for cgroup v2 unified hierarchy

Step failed
Task failed

@sebastian-lerner
Copy link

Hey folks, I'm a product manager here at CircleCI. Thank you for making us aware of the problem and apologies for this loss of functionality. Our engineering team is investigating a fix. I unfortunately do not have an estimate at this time on when we'll get this fixed but as soon as I have more information I'll update this thread.

We'll be updating the local CLI docs page to call out this limitation in the time being.

Thanks all for your patience.

@kienstra
Copy link

Hi Sebastian, thanks a lot for working on this, I really appreciate it!

@pete-woods
Copy link
Contributor

pete-woods commented Jan 5, 2022

We believe we have a fix for this issue in the CircleCI build-agent (Docker image circleci/picard) now.

To accelerate your rollout of the agent, you can run: rm ~/.circleci/build_agent_settings.json to get the latest version.

@mike-hearn
Copy link

After deleting the build agent file and re-running, I'm now getting a different error on Manjaro:

Error:   error starting container circleci/python:3.7: Error response from daemon: cgroup-parent for systemd cgroup should be a valid slice named as "xxx.slice"

Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image is cached as circleci/python:3.7, but refreshing...
3.7: Pulling from circleci/python
Digest: sha256:3de62879e0b899d3de2a836957c736e6711c5a3faabd0ea2ce28bb49cf5e4ae2
Status: Image is up to date for circleci/python:3.7
Error: 
Unexpected environment preparation error: Error response from daemon: cgroup-parent for systemd cgroup should be a valid slice named as "xxx.slice"
Step failed
Task failed
Error: Unhandled prepare executor error: Error response from daemon: cgroup-parent for systemd cgroup should be a valid slice named as "xxx.slice"```

@pete-woods
Copy link
Contributor

Seems like we have further debugging work to do on Linux. This was tested primarily on Docker Desktop for Mac.

@pete-woods
Copy link
Contributor

@mike-hearn could you post your version of:

====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.11
 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

for comparison?

@pete-woods
Copy link
Contributor

(I'm interested in which Cgroup Driver you have)

@mike-hearn
Copy link

Sure:

====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
 Cgroup Driver: systemd
 Cgroup Version: 2
 Kernel Version: 5.11.22-2-MANJARO
 Operating System: Manjaro Linux
 OSType: linux
 Architecture: x86_64

@mike-hearn
Copy link

I was specifically asked for feedback by Pete. Apologies if it's cluttering your inbox.

@sebastian-lerner
Copy link

Hey folks, thank you for letting us know that you're experiencing issues. We believe we have identified the root cause and are working on pushing a fix. Will update when we have more. cc @bjohnso5 @pete-woods

@sebastian-lerner
Copy link

We believe we have rolled out a fix for this recently reported issue.

To accelerate your rollout of the agent, you can run: rm ~/.circleci/build_agent_settings.json to get the latest version.

Please let us know if this still does not fix the issue for you.

@jtarchie
Copy link

jtarchie commented Feb 1, 2022

Can confirm, resolved for me. Thank you @sebastian-lerner.

To make sure everyone is one the same page of instructions:

$ rm ~/.circleci/build_agent_settings.json # this is important
$ circleci local execute --job "node/test"

Docker image digest: sha256:008ba7f4223f1e26c11df9575283491b620074fa96da6961e0dcde47fb757014
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.11
 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/node:16.13.2
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image is cached as cimg/node:16.13.2, but refreshing...
cimg/node:16.13.2:
  using image cimg/node@sha256:0704990b98acbe821fafda00cd605a625598ac737e9b52df41713e2829cc5f78
  pull stats: Image was already available so the image was not pulled
  time to create container: 41ms
Creating Docker containers in parallel 
16.13.2: Pulling from cimg/node
Digest: sha256:0704990b98acbe821fafda00cd605a625598ac737e9b52df41713e2829cc5f78
Status: Image is up to date for cimg/node:16.13.2
Time to upload agent and config: 2.026862226s
Time to start containers: 371.585657ms

@jmstone617
Copy link

I've tried removing the build agent file already but am still getting the following error:

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: aarch64

Starting container hashicorp/terraform:1.0.0
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image is cached as hashicorp/terraform:1.0.0, but refreshing...
hashicorp/terraform:1.0.0:
  using image hashicorp/terraform@sha256:6dafbe34b7c18d189ff18e3dfb7cd5fc4144a2714eb2bc7b6dd9352455e8848a
  pull stats: Image was already available so the image was not pulled
  time to create container: 41ms
Creating Docker containers in parallel
1.0.0: Pulling from hashicorp/terraform
Digest: sha256:6dafbe34b7c18d189ff18e3dfb7cd5fc4144a2714eb2bc7b6dd9352455e8848a
Status: Image is up to date for hashicorp/terraform:1.0.0
Time to upload agent and config: 4.498269919s
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/b73bc306f5f0b63dbbf7e3ca471cb09d1693082ed24b022c18044c13949b87c5/abe49607cf6cebfc32f940ef1e58d1244b0c4cdc7aecb0a2f62cccfb9b394b56" with domain controllers -- it is in an invalid state: unknown

@steven-dicristofaro
Copy link

+1 on issue: Running Catalina 10.15.7 and seeing the same error as @jmstone617 . I thought at first it was per my specific config.yml (I was still testing with my original file), but I duplicated the simple config file from @jtarchie, ran the identical commands to remove the build settings file and execute the job locally and still seeing the following error:

rm ~/.circleci/build_agent_settings.json
circleci local execute --job "node/test"

Downloading latest CircleCI build agent...
Docker image digest: sha256:6b954f968479e94b5a5a687b467540d9df7359c7e03230052596f0c41c07b3d8
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.11
 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/node:16.13.2
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image cache not found on this host, downloading cimg/node:16.13.2
16.13.2: Pulling from cimg/node
f3ef4ff62e0d: Pull complete 
2c322a662952: Pull complete 
fb8baef6d8e7: Pull complete 
805b7ba0a256: Pull complete 
63833a96b952: Pull complete 
5d1ffe5f9ba5: Pull complete 
6dbfea31d6de: Pull complete 
44f09c08a855: Pull complete 
Digest: sha256:0704990b98acbe821fafda00cd605a625598ac737e9b52df41713e2829cc5f78
Status: Downloaded newer image for cimg/node:16.13.2
cimg/node:16.13.2:
  using image cimg/node@sha256:0704990b98acbe821fafda00cd605a625598ac737e9b52df41713e2829cc5f78
  pull stats: download 343.3MiB in 43.33s (7.923MiB/s), extract 358.7MiB in 24.413s (14.69MiB/s)
  time to create container: 273ms
Creating Docker containers in parallel 
Time to upload agent and config: 2.0054758s
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/3026c5aac7c67fe6af86320edf46e0730deccb4f3e88c2631e3240b976f7b706/e264c13293b89594dc31b307a5b8cc5e183efb2704ce2ac28184e3852a2c7ef0" 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/3026c5aac7c67fe6af86320edf46e0730deccb4f3e88c2631e3240b976f7b706/e264c13293b89594dc31b307a5b8cc5e183efb2704ce2ac28184e3852a2c7ef0" with domain controllers -- it is in an invalid state: unknown


@ucals
Copy link

ucals commented Mar 16, 2022

Exactly same error here. Running macOS Monterrey 12.2.1, installed CLI manually (v0.1.16947).

rm ~/.circleci/build_agent_settings.json
circleci local execute --job "node/test"

Trace:

Downloading latest CircleCI build agent...
Docker image digest: sha256:ea206e01751a9d4acc6dc21fb8184bdf67b0c2a524c156e526bdb991b1bd2e23
====>> 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/node:16.13.2
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image cache not found on this host, downloading cimg/node:16.13.2
16.13.2: Pulling from cimg/node
f3ef4ff62e0d: Pull complete
2c322a662952: Pull complete
fb8baef6d8e7: Pull complete
805b7ba0a256: Pull complete
63833a96b952: Pull complete
5d1ffe5f9ba5: Pull complete
6dbfea31d6de: Pull complete
44f09c08a855: Pull complete
Digest: sha256:0704990b98acbe821fafda00cd605a625598ac737e9b52df41713e2829cc5f78
Status: Downloaded newer image for cimg/node:16.13.2
cimg/node:16.13.2:
  using image cimg/node@sha256:0704990b98acbe821fafda00cd605a625598ac737e9b52df41713e2829cc5f78
  pull stats: download 358.9MiB in 44.413s (8.08MiB/s), extract 358.7MiB in 44.774s (8.012MiB/s)
  time to create container: 275ms
Creating Docker containers in parallel
Time to upload agent and config: 7.0508151s
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/f4e94be5ff47d02ebd9b580db37a9af1b9f222c692da90e0c266d6c03bdc3f6e/80d3b87d51ab7db04d27d38021b19568f05769e045c23541dc2fea62fa92838c" 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/f4e94be5ff47d02ebd9b580db37a9af1b9f222c692da90e0c266d6c03bdc3f6e/80d3b87d51ab7db04d27d38021b19568f05769e045c23541dc2fea62fa92838c" with domain controllers -- it is in an invalid state: unknown

@matschaffer
Copy link

matschaffer commented Mar 18, 2022

The older circleci/picard image seems to work, but the latest fails.

I opened #676 since it seems to be a recurrence of a similar issue on a new image.

@deokseong-kim-toss
Copy link

How to change circleci/picard to previous one? I'm facing this issue too.

====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.13
 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: x86_64

Starting container cimg/node:16.10
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image is cached as cimg/node:16.10, but refreshing...
cimg/node:16.10:
  using image cimg/node@sha256:4647574f341189fdb7d85cfb10ac70d464f6ccb5c7c38731c8e3e28c2bd80941
  pull stats: Image was already available so the image was not pulled
  time to create container: 34ms
Creating Docker containers in parallel 
16.10: Pulling from cimg/node
Digest: sha256:4647574f341189fdb7d85cfb10ac70d464f6ccb5c7c38731c8e3e28c2bd80941
Status: Image is up to date for cimg/node:16.10
Time to upload agent and config: 1.596606679s
Error: 
Unexpected environment preparation error: Error response from daemon: failed to create shim: 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/2aada119a145313e1719519731b3844c3efe245d94620972f3bce7857c69a90c/3e89c8ff0b0861b6285f5cd6d5ab5fa88c03d3352cd686dce8650d69227ea82e" with domain controllers -- it is in an invalid state: unknown

Step failed
Task failed

@deokseong-kim-toss
Copy link

Okay. In my case, I changed LastestSha256 to sha256:6c640d1c0aed49afd1c6a426bfb8f5f40fbb7de439a154b73d53184977b9c1f6 and It works. there seems to be a problem with the latest circleci/picardimage

@matschaffer
Copy link

@deokseong-kim-toss nice :) Yeah I put my steps on #676 - maybe it'd be good for you to +1 that issue.

@sebastian-lerner
Copy link

Hi folks, thank you for the detailed reports of what you are seeing. My team is actively investigating and we hope to have a resolution as soon as possible. I'll update this issue when I have more information.

@Kayden-lolasery
Copy link

I have a very similar error:

Steps to replicate:

  • rm ~/.circleci/build_agent_settings.json
  • circleci local execute
Docker image digest: sha256:ea206e01751a9d4acc6dc21fb8184bdf67b0c2a524c156e526bdb991b1bd2e23
====>> Spin up environment
Build-agent version  ()
System information:
 Server Version: 20.10.11
 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/python:3.8
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image is cached as cimg/python:3.8, but refreshing...
cimg/python:3.8:
  using image cimg/python@sha256:db17fcbb1469f1f70bbbd76867c6d371d4bf9596cae84ece3b62de8fe9c20fb2
  pull stats: Image was already available so the image was not pulled
  time to create container: 52ms
Starting container cimg/postgres:12.7
3.8: Pulling from cimg/python
Digest: sha256:db17fcbb1469f1f70bbbd76867c6d371d4bf9596cae84ece3b62de8fe9c20fb2
Status: Image is up to date for cimg/python:3.8
Creating Docker containers in parallel ....
cimg/postgres:12.7:
  using image cimg/postgres@sha256:a488ce128a9e16e98f21a47af8981b0ea797b59cccee907d034d855e63b1a164
  pull stats: Image was already available so the image was not pulled
  time to create container: 48ms
Time to upload agent and config: 1.708347017s
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/ad8c463b3491878d8cf8a44061b4f0ff3bf147998c4e2a980d30b89e2f57ad8b/dda3240f3a162cc38220cdfb64a84ce60f57a7478277cecdc500d7f5b981d314" with domain controllers -- it is in an invalid state: unknown

Step failed
Task failed

@matschaffer
Copy link

@Kayden-lolasery see if the workaround in #676 works for you

@rohan-kulkarni-phx
Copy link

Hi, getting the following on Monterey 12.2, MacBook Pro 16-inch 2019 (intel)

$ uname -a
21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 x86_64
$ rm ~/.circleci/build_agent_settings.json
$ circleci config process .circleci/config.yml > process.yml
$ circleci local execute -c process.yml --job lint-and-test

Output:

Docker image digest: sha256:dad8f737004adbb7722e416d99b53433f0c10fe5cabd6900e3c9d698470af054
====>> 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/python:3.9
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image is cached as cimg/python:3.9, but refreshing...
3.9: Pulling from cimg/python
Digest: sha256:c1b6220cb31a456613ab628c70831166388b7f37865c9dbc87b5ff80ca48e313
Status: Image is up to date for cimg/python:3.9
cimg/python:3.9:
  using image cimg/python@sha256:c1b6220cb31a456613ab628c70831166388b7f37865c9dbc87b5ff80ca48e313
  pull stats: Image was already available so the image was not pulled
  time to create container: 43ms
Creating Docker containers in parallel 
Time to upload agent and config: 1.463058971s
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/888d43cae73f845ab9f699eeb5485e3080569fb65a68d424e3b6b67fd76f4a87/6b20aeb06ee03bb37a119d4008fb5c593cb4599816df51f7a659f378df8b98f1" 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/888d43cae73f845ab9f699eeb5485e3080569fb65a68d424e3b6b67fd76f4a87/6b20aeb06ee03bb37a119d4008fb5c593cb4599816df51f7a659f378df8b98f1" with domain controllers -- it is in an invalid state: unknown

@rohan-kulkarni-phx
Copy link

Hi, getting the following on Monterey 12.2, MacBook Pro 16-inch 2019 (intel)

$ uname -a
21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 x86_64
$ rm ~/.circleci/build_agent_settings.json
$ circleci config process .circleci/config.yml > process.yml
$ circleci local execute -c process.yml --job lint-and-test

Output:

Docker image digest: sha256:dad8f737004adbb7722e416d99b53433f0c10fe5cabd6900e3c9d698470af054
====>> 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/python:3.9
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image is cached as cimg/python:3.9, but refreshing...
3.9: Pulling from cimg/python
Digest: sha256:c1b6220cb31a456613ab628c70831166388b7f37865c9dbc87b5ff80ca48e313
Status: Image is up to date for cimg/python:3.9
cimg/python:3.9:
  using image cimg/python@sha256:c1b6220cb31a456613ab628c70831166388b7f37865c9dbc87b5ff80ca48e313
  pull stats: Image was already available so the image was not pulled
  time to create container: 43ms
Creating Docker containers in parallel 
Time to upload agent and config: 1.463058971s
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/888d43cae73f845ab9f699eeb5485e3080569fb65a68d424e3b6b67fd76f4a87/6b20aeb06ee03bb37a119d4008fb5c593cb4599816df51f7a659f378df8b98f1" 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/888d43cae73f845ab9f699eeb5485e3080569fb65a68d424e3b6b67fd76f4a87/6b20aeb06ee03bb37a119d4008fb5c593cb4599816df51f7a659f378df8b98f1" with domain controllers -- it is in an invalid state: unknown

FYI the workaround in #676 worked for me as well

@steven-dicristofaro
Copy link

Can also confirm the workaround from @deokseong-kim-toss re: #676 solves the issue for me as well. Thank you for sharing that!

@mrickard
Copy link

mrickard commented Apr 6, 2022

@sebastian-lerner I'm having the same problem.

MacOS: Monterey (12.3.1)
circleci: 0.1.16947+263902a (homebrew)
Docker Desktop: 4.6.1 (76265).

The problem occurs with cimg/14.19.0, as well as cimg/14.19.1 and cimg/14.18.2.

I've removed the build agent file, though the error I'm getting is consistently this:

Error: Unhandled prepare executor error: Error response from daemon: failed to create shim: 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/cab3a2678cf64754071971f9089730323c1f06468efe1002e50e5ec3115345e6/15512e227f7fde93a3b0b5b6300679978c5ad0382b34eadd79fa8131f8260393" with domain controllers -- it is in an invalid state: unknown

@matschaffer
Copy link

@mrickard the workaround on #676 may help

@mrickard
Copy link

mrickard commented Apr 7, 2022

@matschaffer Thank you! I have been able to get that to work.

@sebastian-lerner
Copy link

Hey folks, a quick update on this. We believe we've identified the root cause with the latest issue that has been reported and we think we've attributed it to a bug with Docker Desktop for Mac which we've filed here: docker/for-mac#6288

We're in the process of working with Docker to try and get this fixed. I'll update when I have more

cc @Scipi @pete-woods

@mzarismithnyc
Copy link

Hey folks, (I'm from CircleCI btw). The workaround that we described before, still continue to use that. We have raised the issue with Docker but they will take awhile to resolve the cgroupsv2 issue. We will update folks here on the thread once they have resolved the issue and thank you for your patience.

@mkotsollaris
Copy link

FWIW, the issue still persists, even if ~/.circleci/build_agent_settings.json is no longer present in macOS:

cd ~/.circleci/
USER:.circleci USER$ ls
cli.yml                 update_check.yml

Would be nice to see if there's any workaround for this 🙏

@mzarismithnyc
Copy link

We're still waiting to see if there is a workaround but at the moment, we're still investigating with folx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests