This started happening with docker v20.10 on ubuntu 22.04.
Specifically I had errors like these pop up when trying to run the rancher/agent
(for rancher/server v1.6.30):
time="2021-06-29T09:13:28Z" level=fatal msg="Failed to find container id:\n0::/\n"
Seems to be caused by cgroups v2
To make it work again run: echo 'GRUB_CMDLINE_LINUX=systemd.unified_cgroup_hierarchy=false' > /etc/default/grub.d/cgroup.cfg
OR (if it fails if you're not root) create/edit the file /etc/default/grub.d/cgroup.cfg
and add this line to it:
GRUB_CMDLINE_LINUX=systemd.unified_cgroup_hierarchy=false
Then run: update-grub
and finally reboot the system and it should all work again :)