How to resolve "no cgroup mount found in mountinfo: unknown" error?
Asked Answered
S

1

6

I am getting following error while starting docker container.

 Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:326: applying cgroup configuration for process caused: no cgroup mount found in mountinfo: unknown
    Error: failed to start containers: postgres-11

My docker version is ----> Docker version 19.03.13-ce, build 4484c46
OS--> 
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

Thank you in advance.

Surbeck answered 2/2, 2021 at 5:24 Comment(2)
What are you trying to do? What steps/command you executed which lead to this error?Headroom
I'm trying to start my container by running----> docker start "Container-name", I also tried to run New conatiner by "docker run " CMD..but i got same issue...Surbeck
E
3

I had the same error, "OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:340: applying cgroup configuration for process caused: no cgroup mount found in mountinfo: unknown"

First, check if "docker run hello-world" is working properly. This will validate the docker installation.

I found this script very useful. Owner: https://mobyproject.org/

  • Download with "curl https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh > check-config.sh"
  • Make rwx with "chmod 777 check-config.sh" & execute "./check-config.sh"
  • Understand the output, mainly the cgroup hierarchy.
  • If cgroup hierarchy is "properly mounted [/sys/fs/cgroup]" then we shouldn't be seeing this problem.
  • If cgroup hierarchy is something like "?????????" then below are the things which you should seek to fix the problem.

Try & Hit solutions:

  1. Install cgroup-utils & cgroup-lite sudo apt-get install cgroup-lite cgroup-utils
  2. https://github.com/docker/for-linux/issues/219#issuecomment-375160449 Which is to mount systemd with sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
  3. There are few kernel setting solutions on the internet that you could try if you like.
  4. If nothings works, then it is surely the problem of your docker installation, which was my case too [SOLVED], then you should go for replacing the docker installation. Default installation with docker-ce version 20.10 was also problematic for me but custom installation of docker-ce version 18.09 was helpful.

    Remove current installation:
    sudo apt-get purge docker-ce docker-ce-cli containerd.io || sudo rm -rf /var/lib/docker || sudo rm -rf /var/lib/containerd

    Install new docker-ce, docker-cli & containerd-io as per the Linux distribution:
    Go to https://download.docker.com/linux/ubuntu/dists/, choose your Ubuntu version, then browse to pool/stable/, choose amd64, armhf, or arm64, and download the .deb file for the Docker Engine version you want to install & install with sudo dpkg -i /path/to/package.deb

In the end, recheck docker run hello-world.

Embryologist answered 26/4, 2021 at 12:1 Comment(1)
Same error in raspberry pi 4. Uninstall, Reboot and Install fixed it.Seemaseeming

© 2022 - 2024 — McMap. All rights reserved.