circleci-cli: [circleci local execute] error looking up cgroup: not implemented for cgroup v2 unified hierarchy
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.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 28
- Comments: 68 (10 by maintainers)
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.
We believe we have a fix for this issue in the CircleCI
build-agent(Docker imagecircleci/picard) now.To accelerate your rollout of the agent, you can run:
rm ~/.circleci/build_agent_settings.jsonto get the latest version.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=1will cause cgroups v2 to be used by the library. However, I have this parameter on my system (as part ofGRUB_CMDLINE_LINUXandGRUB_CMDLINE_LINUX_DEFAULTin/etc/default/grub), but I still get the error mentioned in this issue.It looks like
circleci-clineeds to update its version ofrunc[edit: I did some digging around, and it seems more likely that the non-publiccircleci/picardDocker image is what needs to updaterunc.]. See, for example, a similar error message in another issue:Edit: Update
I pulled
circleci/picardand poked around inside:It looks like the latest
circleci/picardis usingrunc@v1.0.0-rc92. 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).I’m experiencing this same issue on OSX Big Sur. Happens whether I use
brew install circleclior use the provided curl command for Mac/LinuxWe 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.
Okay. In my case, I changed
LastestSha256to sha256:6c640d1c0aed49afd1c6a426bfb8f5f40fbb7de439a154b73d53184977b9c1f6 and It works. there seems to be a problem with the latestcircleci/picardimageI’ve tried removing the build agent file already but am still getting the following error:
cc: @pete-woods
I’ve been following the steps about for MacOS. It is not working for me, though.
Given the
.circleci/config.ymlThen running the
circleciCLI.I can create a new issue if need be, but it seems related because of the
cgroupsin the stacktrace.CLI Version:
0.1.16535+5010eb7 (homebrew)Docker Desktop Mac:Docker Desktop 4.4.2 (73305)Hitting this today on MacOS Monterey.
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
runcis up to 1.0.3:This is bothersome, since I can no longer test out circleci changes and have to use remote resources to debug.
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.
@Kayden-lolasery see if the workaround in https://github.com/CircleCI-Public/circleci-cli/issues/676 works for you
Same issue for me.
CLI Version:
0.1.16535+5010eb7 (homebrew)Can confirm, resolved for me. Thank you @sebastian-lerner.
To make sure everyone is one the same page of instructions:
@pete-woods Joy! Local CircleCI builds are happy again on MacOS (after
rm ~/.circleci/build_agent_settings.json). Thanks for this fix!FWIW, I think
systemd.unified_cgroup_hierarchyneeds to be set to0(zero) to enable cgroup v1 behaviour. At least it worked for me when setting it to1did not.Thanks a lot! It’s working now on my Mac with https://github.com/CircleCI-Public/circleci-cli/issues/589#issuecomment-1005865018.
Exactly same error here. Running macOS Monterrey 12.2.1, installed CLI manually (v0.1.16947).
Trace:
+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.jsoncircleci local execute --job "node/test"Can also confirm the workaround from @deokseong-kim-toss re: https://github.com/CircleCI-Public/circleci-cli/issues/676 solves the issue for me as well. Thank you for sharing that!
After deleting the build agent file and re-running, I’m now getting a different error on Manjaro:
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.
We’re still waiting to see if there is a workaround but at the moment, we’re still investigating with folx.
FWIW, the issue still persists, even if
~/.circleci/build_agent_settings.jsonis no longer present in macOS:Would be nice to see if there’s any workaround for this 🙏
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: https://github.com/docker/for-mac/issues/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
@matschaffer Thank you! I have been able to get that to work.
@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 ascimg/14.19.1andcimg/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: unknownI have a very similar error:
Steps to replicate:
I was specifically asked for feedback by Pete. Apologies if it’s cluttering your inbox.
👍 the comments. That’s what they are there for.
I’ve just released a new version of the CircleCI build-agent. Could anyone running on Linux with the
systemdCgroup driver please try updating and running again?Any update on this?
I’m seeing this also when attempting to test bioconda builds on a MacBook locally.