sysbox icon indicating copy to clipboard operation
sysbox copied to clipboard

Error while launching container inside of the SysBox System Container

Open Deepansharora27 opened this issue 3 years ago • 12 comments

Hi Team,

I have been trying to deploy a System Container with Systemd, sshd, and Docker inside. Although I have been successfully able to deploy this system container. When I try to run my dockerized image(or any Docker Image for that matter), it returns me the following error:

docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: unable to apply cgroup configuration: mkdir /sys/fs/cgroup/rdma/docker: permission denied: unknown

Correct me if I am wrong but this error is being triggered because the SysBox Container does not have the necessary settings to modify the cgroup settings.

Another thing I would like to highlight here is that, I am testing out SysBox inside of a GCP VM and I am set to the Project Owner as well. So I believe spinning up the Container inside of a VM is not the cause of the issue here.

The VM OS Distribution is Ubuntu 18.04.6 LTS and I have checked that this Linux Distribution is supported by SysBox.

Your Help would be appreciated on this Thanks

Deepansharora27 avatar Jan 21 '23 10:01 Deepansharora27

Hi @Deepansharora27, thanks for trying Sysbox, hope you find it useful.

When I try to run my dockerized image(or any Docker Image for that matter), it returns me the following error docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: unable to apply cgroup configuration: mkdir /sys/fs/cgroup/rdma/docker: permission denied: unknown

Is that error reported by the Docker engine inside the Sysbox container, or by the Docker engine at host level?

Also, is there an easy we could repro?

ctalledo avatar Jan 21 '23 23:01 ctalledo

Hi @ctalledo It is being reported by the Docker Engine inside the SysBox Container.

Well to reproduce, it is giving me the issue with any docker image, not a specific docker image

Even if I run sudo docker run hello-world

It results me the same error

Deepansharora27 avatar Jan 22 '23 05:01 Deepansharora27

@ctalledo Hi, were you able to reproduce this at your End ?

Deepansharora27 avatar Jan 23 '23 07:01 Deepansharora27

hi @Deepansharora27, no I am not able to repro.

Are you running the latest version of Sysbox (v0.5.2)? Sounds like you may be running an older version, per issue #560 .

ctalledo avatar Jan 23 '23 17:01 ctalledo

I sourced the latest binary, but let me check once again

Deepansharora27 avatar Jan 23 '23 17:01 Deepansharora27

I just checked it was the 0.5.0 version, but here in the Installation Guide https://github.com/nestybox/sysbox/blob/master/docs/user-guide/install-package.md It only mentions 0.5.0 version while trying to install it via wget

Deepansharora27 avatar Jan 23 '23 17:01 Deepansharora27

While Installing the SysBox 0.5.2 version, I get the following error:

` The Sysbox installer requires a docker service restart to configure network parameters, but it cannot proceed due to existing Docker containers. Please remove them as indicated below and re-launch the installation process. Refer to Sysbox installation documentation for details. "docker rm $(docker ps -a -q) -f"

dpkg: error processing package sysbox-ce (--configure): installed sysbox-ce package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: sysbox-ce E: Sub-process /usr/bin/dpkg returned an error code (1) `

Then, I had a look at the Troubleshoot section, and it mentions to execute systemctl list-units -t service --all | grep sysbox

But it results me a Blank output, and does not show me the service running as well

CC: @ctalledo

Deepansharora27 avatar Jan 23 '23 17:01 Deepansharora27

Hi @Deepansharora27, try stopping all running Docker containers and the run the installer again please.

ctalledo avatar Jan 23 '23 19:01 ctalledo

@Deepansharora27, the installation error logs above explain what the issue is and how to fix it. Please run the suggested instruction and try to install it again:

"docker rm $(docker ps -a -q) -f"

rodnymolina avatar Jan 24 '23 05:01 rodnymolina

Hi @rodnymolina

I ran this but this results into an error. That's why I went to the troubleshooting section and the steps mentioned in troubleshooting section also doesn't resolve it

Deepansharora27 avatar Jan 24 '23 05:01 Deepansharora27

@rodnymolina This is what I get while executingsudo docker rm $(docker ps -a -q) -f

This is the Error returned:

` permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?all=1": dial unix /var/run/docker.sock: connect: permission denied "docker rm" requires at least 1 argument. See 'docker rm --help'.

Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]

Remove one or more containers `

Deepansharora27 avatar Jan 24 '23 06:01 Deepansharora27

@Deepansharora27, that's right, the docker instruction above returns an error when there are no existing containers (we should provide a slightly different one to avoid any confusion), so you should be able to re-install sysbox now with the same apt-get install instruction you previously used. Are you saying that you are still getting the same installation error?

rodnymolina avatar Jan 25 '23 20:01 rodnymolina