Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "open /proc/self/fd: no such file or directory": unknown #246

Open
yanpeipan opened this issue Mar 2, 2018 · 67 comments

Comments

@yanpeipan
Copy link

machine: nvidia drive px2

/apollo/data/core/core_%e.%p
dev-aarch64-20170927_1111: Pulling from apolloauto/apollo
a1c981565bcf: Already exists 
4ecd22b74242: Already exists 
8d4841161f63: Already exists 
a93b04770247: Already exists 
Digest: sha256:10fc9daa7699f30650df05b9f3aff9762a236433e089e8755dcb0f6cfb7baab0
Status: Downloaded newer image for apolloauto/apollo:dev-aarch64-20170927_1111
RTNETLINK answers: Device or resource busy
modprobe: FATAL: Module nvidia not found in directory /lib/modules/4.4.38-rt49-tegra
modprobe: FATAL: Module nvidia-uvm not found in directory /lib/modules/4.4.38-rt49-tegra
[WARNING] Failed to find device with pattern "ttyUSB*" ...
[ OK ] Found device: /dev/ttyS0.
[ OK ] Found device: /dev/ttyS3.
[ OK ] Found device: /dev/ttyS2.
[ OK ] Found device: /dev/ttyS1.
[ OK ] Found device: /dev/can3.
[ OK ] Found device: /dev/can2.
[ OK ] Found device: /dev/can1.
[ OK ] Found device: /dev/can0.
[WARNING] Failed to find device with pattern "ram*" ...
[WARNING] Failed to find device with pattern "loop*" ...
[ OK ] Found device: /dev/nvidia-uvm-tools.
[ OK ] Found device: /dev/nvidia-uvm.
[ OK ] Found device: /dev/nvidia0.
[ OK ] Found device: /dev/nvidiactl.
bb0567aef16ae92397e23fb577cabf78a3821e1bb6cef9d598c7004947618eec
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "open /proc/self/fd: no such file or directory": unknown

docker info

Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 2
Server Version: 17.12.1-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9b55aab90508bd389d7654c4baf173a981477d55
runc version: 9f9c96235cc97674e935002fc3d78361b696a69e
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.4.38-rt49-tegra
Operating System: Ubuntu 16.04 LTS
OSType: linux
Architecture: aarch64
CPUs: 6
Total Memory: 6.504GiB
Name: nvidia
ID: C4UG:ILPT:DQFX:ZUZA:R4RE:45XP:KKV3:6XMX:X4CK:D56J:C4PL:BOFZ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
@andrewrynhard
Copy link

@yanpeipan I am seeing the same issue in a Kubernetes cluster. Any luck finding out the root cause here?

@AndrianD
Copy link

#subscribe

@thaJeztah
Copy link
Member

This could be a duplicate of #238, moby/moby#36467, which was a bug in Runc, and fixed through opencontainers/runc#1727 in RunC 1.0.0-rc5 (included in Docker 18.03 through moby/moby#36449).

Can you try updating to Docker 18.03.1 and see if you still run into this?

@samlyhuang
Copy link

I also see this problem
ubuntu@qa:~$ uname -a
Linux qa 4.4.0-93-generic #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@qa:~$ docker -v
Docker version 18.03.0-ce, build 0520e24
ubuntu@qa:~$ sudo docker exec -it ihr360-one-click-provider -a
OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown
ubuntu@qa:~$ sudo docker exec -it ihr360-one-click-provider sh
OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown
this problem has fixed now?

@ruslanguns
Copy link

Me too.... looking forward for a solution ! thanks in advance

@eltiare
Copy link

eltiare commented Aug 5, 2018

I'm having this issue running Linux containers on Windows. Are these even checked anymore? :(

@tizki
Copy link

tizki commented Aug 6, 2018

I also see this issue:

time="2018-08-06T05:05:48.591754629Z" level=error msg="Error running exec 673c1fc689e85c542d12188b7bec2819638bfedb9c05b894c072d1c6d5f5a7d2
in container: OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "process_linux.go:86: executing setns process caused \"exit status 21\"": unknown"

my environment details:

Centos 7 Linux 4.4.144-1.el7.elrepo.x86_64 #1 SMP Wed Jul 25 13:54:40 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux
Docker version 18.03.0-ce, build 0520e24

@rks92
Copy link

rks92 commented Aug 16, 2018

Bump. I'm getting this issue on OSX Sierra

@egrueter-dev
Copy link

Same here. Using Docker version 18.06.1-ce, build e68fc7a

@nauer
Copy link

nauer commented Sep 19, 2018

Got this within a docker-compose run on Ubuntu 18.04:

OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: "Snakefile.BuildChoMine": executable file not found in $PATH": unknown

Using Docker version 18.06.1-ce
When I execute it from inside the container it works as usual.

@ronakganatra9
Copy link

ronakganatra9 commented Oct 27, 2018

The same issue is occurring in my Windows.

@eltiare
Copy link

eltiare commented Oct 28, 2018

I fixed this on Windows by running Docker as an administrator at least once. I don't recall if I had to do it every time though.

@ronakganatra9
Copy link

I'm having this issue running Linux containers on Windows. Are these even checked anymore? :(

same issue is in my system also.

@loomsen
Copy link

loomsen commented Oct 30, 2018

edit
not applicable

@thaJeztah
Copy link
Member

@loomsen if that stat is inside the container; also check if the binary may be dynamically linked, and may be missing a dependency. Linux may show a no such file or directory if a dependency (linked library) is missing

@loomsen
Copy link

loomsen commented Oct 30, 2018

@loomsen if that stat is inside the container; also check if the binary may be dynamically linked, and may be missing a dependency. Linux may show a no such file or directory if a dependency (linked library) is missing

No, the stat is outside. But this only happens if I use a couple of programs with their newest version, just checked, a downgrade of mitogen works. So I guess my comment is kind of obsolete?

@tkwant
Copy link

tkwant commented Jan 7, 2019

use /bin/sh instead of /bin/bash

@Wangjunyu
Copy link

thanks @tkwant it works for me

@DyingLight123
Copy link

use /bin/sh or bash

@HolyLow
Copy link

HolyLow commented Jan 17, 2019

have the same problem with 18.06.1-ce

@gezichenshan
Copy link

@tkwant thanks.
Why some containers just have sh and no bash? But some has both.

@jvelasquezm1
Copy link

The alpine only have the sh, it depends on how is created the container

@coderLyonMa
Copy link

have the same problem with 18.06.1-ce
and it really made me crazy

@Younghae
Copy link

Younghae commented Mar 8, 2019

My environment is Vmware in Windows 10.
Remove all Local volumes

  1. Check all local volumes : sudo docker volume ls
  2. Delete all local volumes : sudo ./byfn.sh -m down
    In my case it's working.

@PriyankaGupta05
Copy link

Error: failed to start container "kubernetes-demo-container": Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: "which shell": executable file not found in $PATH": unknown
:( same error

@AbhimanyuG
Copy link

Oddly, it worked for me after reboot.

@tpaksu
Copy link

tpaksu commented May 10, 2019

I fixed it with adding a dot before /bin/sh on windows minikube virtualbox setup. Final command that worked:

kubectl exec -it [pod_name] -c [container_name] -- ./bin/sh

@kalyandevopsengineer
Copy link

I ran into the same error while running the command docker exec -it jenkins bash on an already running container with name jenkins. I pulled the jenkins/jenkins image from repository.

The fix is:
1.Create a normal user/group with uid 1000.
2. add sudo permissions in visudo file.
3. Switch user as new user.
4. Execute the docker exec command as new user.

I am able to ssh into container.

@braian125
Copy link

use /bin/sh instead of /bin/bash

On Windows CMD (after switching to bash)
docker exec -it //bin//sh

On Git Bash
winpty docker exec -it //bin//sh

@TheRenato
Copy link

For everyone that has not found a solution yet, this might work:

The TTY problem in windows:
put winpty before your command

For the OCI error:
kubectl exec -it <podnamn> -n <namespace> -- //bin/bash
Observe that before the bin/bash it has two / not one.

So for me as windows user I wrote:
winpty kubectl exec -it <podnamn> -n <namespace> -- //bin/bash
That worked for me. The eternal code problem when you write /

Other solutions are to us sh instead of bash.

I hope it helps someone.
This solutions are not my own and you can find pieces out there.
Just wanted to collect them all in one post.

@gnboorse
Copy link

If you're still here, and none of the above solutions have worked for you... try using double quotes instead of single quotes. Seriously.
moby/moby#31702 (comment)

@tomaszczechowski
Copy link

It works for me:

docker exec -it <container> bin/sh

Patrik-Stas added a commit to hyperledger/aries-vcx that referenced this issue Aug 19, 2020
@Bruno-hub19
Copy link

use /bin/sh instead of /bin/bash

Works here!!

@sevaroy
Copy link

sevaroy commented Sep 4, 2020

use /bin/sh instead of /bin/bash

On Windows CMD (after switching to bash)
docker exec -it //bin//sh

On Git Bash winpty docker exec -it //bin//sh

I use git bash on windows 10
it work for me
thanks

@tailyer
Copy link

tailyer commented Oct 7, 2020

I was stuck in this problem before. It turns out that if the docker image uses alpine as their base, its container supports only bin/sh as many have mentioned. To verify whether your Docker image is using alpine or not, you can go to the Github page of your docker image and take a look at the Dockerfile, line FROM xxx
Cheers.

@ghost
Copy link

ghost commented Oct 26, 2020

use /bin/sh instead of /bin/bash

On Windows CMD (after switching to bash)
docker exec -it //bin//sh

On Git Bash winpty docker exec -it //bin//sh

thanks ! @braian125

@varpandit
Copy link

Changing the directory rights worked for me.
RUN chmod -x path/to/working/directory

@2billcom
Copy link

2billcom commented Nov 5, 2020

Very simple but powerful solution. It works

@notflip
Copy link

notflip commented Nov 7, 2020

use /bin/sh or bash

Could you explain why bash doesn't work? Thanks!

@Namrata3991
Copy link

I am trying to take backup of argocd using argo-utils where I use ccommand like this :

ARGO=$(kubectl get pods -n argocd| tail -n+2 | awk '{print $1}' | grep argocd-server)
kubectl exec -it -n argocd $ARGO argocd-util export > backup.yaml

This does not work it saves this o/p in my backup.yaml file OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"argocd-server-******-**\": executable file not found in $PATH": unknown

@scm-bryan
Copy link

You can also get this error if you enter the wrong container id - as in, one that doesn't have bash. I had done docker container ls and then tried to docker exec ... on the container it displayed without realizing that was the wrong container. When I did docker container ls --all, I realized the container I wanted was not the one I was using.

@Namrata3991
Copy link

@scm-bryan, I am using the right container, and also it does have bash, the image I am using is debian:10-slim

@neillindberg
Copy link

I never had this problem until using docker-compose to bring my two containers together. I do use "container_name" in configuring the two images. I am also using network_mode: "host".
But, never had a problem doing: docker exec -it <container_name> /bin/bash
Now I get this very similar error in Windows 10:
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "C:/Program Files/Git/usr/bin/sh": stat C:/Program Files/Git/usr/bin/sh: no such file or directory: unknown

@inossidabile
Copy link

inossidabile commented Sep 18, 2021

I'm having exactly the same problem (container_linux.go:380, runc exec: exit status 1) on Concourse PARTICULARLY with Debian Slim. This is definitely not access problem or bang probem because I immedaitely tried to start /bin/bash instead of any custom scripts and bash is in the system. I can run this exact same container with exactly the same command on another host 🤷

@jon241
Copy link

jon241 commented Oct 4, 2021

For my error "OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: no such file or directory: unknown" I changed the line feed from CRLF to LF and my bash script would now execute in docker.

@kg00488
Copy link

kg00488 commented Oct 29, 2021

On CentOS 7
Force-Stop container's process & restart container

kill -9 $(ps aux | grep $container_id | grep containerd | awk '{print $2}')
docker start $container_id

@amit11nov
Copy link

$ docker exec -it containerID sh "<<<<<< only sh solved problem"
/ #

@Queetinliu
Copy link

i install container-selinux then all become ok.

@kqvanity
Copy link

This error message popped out for me while fiddling with distrobox . As i perceive distrobox as a wrapper around docker, i've tried to alter the flags to include sh instead of bash but without luck . What worked for me was uninstalling the whole container then stop using sudo to invoke the containers with distrobox, and change the permissions instead . Finally installing the container and initialize it with the normal user not root .

@GO-DIE
Copy link

GO-DIE commented Mar 12, 2022

I have a sh file in docker construction process. When I use it in Windows system, the newline character of sh file is automatically changed to CRLF by the editor. If I change the newline character of SH file to LF, it works normally

@rikhii20
Copy link

rikhii20 commented Apr 9, 2022

use /bin/sh or bash

It works for me!! thanks

@ghost
Copy link

ghost commented Aug 18, 2022

I have the same issue on Ubuntu 22.04 (the same worked well on 20.04), no suggestions listed below are working for me

@Yoshihiro123
Copy link

use /bin/sh or bash

docker exec -it [container ID] bash worked on visual studio code installed on Windows 10!

@sauntheninja2
Copy link

sauntheninja2 commented Aug 7, 2023

I am running this command to exec into a pod and its not working
kubectl exec -it podname -- sh

This command was working fine a few days ago and today suddenly its not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests