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

'/bin/bash' not found or does not exist.. #23411

Closed
superhero opened this issue Jun 9, 2016 · 14 comments
Closed

'/bin/bash' not found or does not exist.. #23411

superhero opened this issue Jun 9, 2016 · 14 comments

Comments

@superhero
Copy link

Output of docker version:

$ docker version
Client:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:23:39 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:23:39 2016
 OS/Arch:      linux/amd64

Output of docker info:

$ docker info
Containers: 12
 Running: 11
 Paused: 0
 Stopped: 1
Images: 11
Server Version: 1.11.2
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 129
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: host bridge null
Kernel Version: 3.16.0-4-amd64
Operating System: Debian GNU/Linux 8 (jessie)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.65 GiB
Name: work
ID: DMDC:CFRR:PTYM:R6AR:CSRJ:VNQ5:HGGV:SATM:TY3K:ZRDW:R77U:T646
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support

Steps to reproduce the issue:
Describe the results you received:
Additional information you deem important (e.g. issue happens only occasionally):

docker run \
  --name        adamo.tests.integration.php \
  --publish     127.0.8.1:8080:80 \
  --volume      `pwd`/../component/tests/php/integration:/var/www \
  --detach \
  php:apache /bin/bash -c "echo foobar;"

returns docker: Error response from daemon: Container command '/bin/bash' not found or does not exist.. but when I don't mount the volume. It works just fine... as you can see when listing the containers:

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                   CREATED             STATUS              PORTS                                            NAMES
a7686f8ffe57        php:apache          "/bin/bash -c 'echo f"    2 minutes ago       Created                                                              adamo.tests.integration.php
842c5b443ca3        php:apache          "/bin/bash -c '\n    s"   40 minutes ago      Up 40 minutes       127.0.4.1:8080->80/tcp                           adamo.wholesale

I believe this is a bug, and a very strange one imo.. The volume I'm mounting has 1 php script in it.

@superhero
Copy link
Author

when adding --workdir /var/www, then it works. idk if you can call it a bug or not, but I wouldn't expect this error from using a working directory that doesn't exist. I'm leaving it open, but you can just close it if you think it's not worth looking at ofc ..

@cpuguy83
Copy link
Member

cpuguy83 commented Jun 9, 2016

This is most likely not the correct error caused by https://github.com/docker/docker/blob/master/daemon/start.go#L142
Where it's not checking if the returned error is mentioning the container command or some other path as not found.

It happens to be fixed here in this PR: https://github.com/docker/docker/pull/22983/files#diff-3cb140026df40998ea29c5bcb6bb292eR150 which is not yet merged.

@cpuguy83
Copy link
Member

cpuguy83 commented Jun 9, 2016

It looks like the daemon logs should have the correct error in it.

@superhero
Copy link
Author

My log was empty when I tried to read it. @cpuguy83

@shmilee
Copy link

shmilee commented Jun 14, 2016

+1, when I run docker run -u 1000 --rm -p 8000:8000 -v /home/notebooks:/workdir -t -i matplot:160516 /usr/bin/bash and /workdir exists in image matplot:160516.

error:

docker: Error response from daemon: Container command '/usr/bin/bash' not found or does not exist..

Adding --workdir /workdir or using -v /home/notebooks:/workdir-new , it works.
(/workdir-new does not exist in matplot:160516.)

@thaJeztah
Copy link
Member

Is anyone having this issue able to test the docker 1.12 release candidate, to see if the error message returned gives a more descriptive message? https://github.com/docker/docker/pull/22983/files#diff-3cb140026df40998ea29c5bcb6bb292eR150 is now merged

@ifrh
Copy link

ifrh commented Jul 26, 2016

@thaJeztah Could you please write some notes, how I can test if your mentioned modifications produce better messages in my situation : "Option --workdir breaks "docker run" inside Ubuntu/Trusty running in VirtualBox on Windows 8.1" #25052

@MUI-Pop
Copy link

MUI-Pop commented Dec 18, 2016

@superhero @thaJeztah @cpuguy83
We are seeing the error upgrading Docker from 1.9.1 to 1.11.2, are there any workarounds to resolve this ?

When we attempt to start a container the error ''/bin/bash' not found or does not exist' is displayed and in the docker logs we see
'msg="containerd: start container" error="oci runtime error: fork/exec /usr/bin/docker (deleted): no such file or directory:'.

Restarting the Docker service resolving this but it also bringing down the containers.

@superhero
Copy link
Author

@MUI-Fazy yes there is a "workaround" 😄 simply use a working directory that exists.
...the issue is not an actual code bug, it's an error message bug. The feedback tells you that bin/bash doesn't exist when it's actually the working directory that doesn't exist. If this is not the case for you then you having a different issue then the one I filed.

@MUI-Pop
Copy link

MUI-Pop commented Dec 20, 2016

@superhero Do you mean specifying WORKDIR in Dockerfile ?

@superhero
Copy link
Author

@MUI-Fazy how you specify the working directory is besides the point, the working directory has to exist. I believe the run command will be superior to any other declaration, so add the flag --workdir in your run command will suppress any other declaration.

@MUI-Pop
Copy link

MUI-Pop commented Dec 20, 2016

@superhero My issue appearing to be different, including workdir is not resolving it.
I am seeing the error message from Docker logs
msg="containerd: start container" error="oci runtime error: fork/exec /usr/bin/docker (deleted): no such file or directory:

@thaJeztah @cpuguy83 : Any thoughts ?

@cpuguy83
Copy link
Member

I think this is a case of bad error reporting.
Can you try with 1.12? Think this is improved in 1.12.

@thaJeztah
Copy link
Member

Let me close this ticket for now, as it looks like it went stale.

@thaJeztah thaJeztah closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants