When running Docker Executor jobs on Server 4, you may see them fail on the 'Spin up environment' step with the error containing the message
"cgroup doesn't match target mode"
The issue is caused by how the Nomad client tries to use cgroup v2 for memory usage control when running the Docker executor on Ubuntu 22 whereby v1 is the only version natively supported out of the box.
To resolve the issue, do the following to revert to cgroup v1:
- Run the following command: sudo nano /etc/default/grub
- Within /etc/default/grub, change the GRUB_CMDLINE_LINUX value such that it reads as follows:GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=0"
Save the file and then run the following command:
- Reboot the VM's upon which the Nomad client is installed and retry the job.