dockerkubernetescontainerdrunckubernetes-rook

OCI runtime exec failed: exec failed: unable to start container process: open /dev/pts/0: operation not permitted: unknown


I have read many links similar to my issue, but none of them were helping me to resolve the issue.

Similar Links:

  1. Failed to exec into the container due to permission issue after executing 'systemctl daemon-reload'
  2. OCI runtime exec failed: exec failed: unable to start container process: open /dev/pts/0: operation not permitted: unknown
  3. CI runtime exec failed: exec failed: unable to start container process: open /dev/pts/0: operation not permitted: unknown
  4. OCI runtime exec failed: exec failed: unable to start container process: open /dev/pts/0: operation not permitted: unknown
  5. Fail to execute docker exec
  6. OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "open /proc/self/fd: no such file or directory": unknown

Problem Description:

I have created a new Kubernetes cluster using Kubespray. When I wanted to execute some commands in one of containers I faced to the following error:

Executed Command
kubectl exec -it -n rook-ceph rook-ceph-tools-68d847b88d-7kw2v -- sh
Error:

OCI runtime exec failed: exec failed: unable to start container process: open /dev/pts/1: operation not permitted: unknown command terminated with exit code 126

I have also logged in to the node, which runs the pod, and try executing the container using docker exec command, but the error was not changed.

Workarounds:

Can anyone help me to find the root cause of this problem and then solve it?


Solution

  • This issue may relate to docker, first drain your node.

    kubectl drain <node-name>
    

    Second, SSH to the node and restart docker service.

    systemctl restart docker.service
    

    At the end try to execute your command.