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

Cannot exec into docker container ("containerd: process not found for container") #22909

Closed
agyanttiwari opened this issue May 23, 2016 · 57 comments
Assignees
Labels
area/runtime kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/more-info-needed version/1.11

Comments

@agyanttiwari
Copy link

agyanttiwari commented May 23, 2016

Output of docker version:
Docker version 1.11.1, build 5604cbe

Output of docker info:
Containers: 8
Running: 6
Paused: 0
Stopped: 2
Images: 14
Server Version: 1.11.1
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 87
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 3.16.0-67-generic
Operating System: Ubuntu 14.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.31 GiB
Name: agyantdev
ID: XSB4:V4GP:MKT2:R3U5:7P3B:ZPPA:AOLJ:6AYU:SCS4:SYXI:B73D:YA6J
Docker Root Dir: /var/lib/docker
Debug mode (client): true
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support

Steps to reproduce the issue:

  1. installed docker
  2. started an image successfully
  3. ran : sudo docker exec -it CONTAINER_NAME /bin/bash
    also tried bash, bin/bash, sh, bin/sh, /bin/sh, ect

Describe the results you received:
time="2016-05-23T15:26:43.731439437+01:00" level=error msg="Error running exec in container: rpc error: code = 2 desc = "oci runtime error: exec failed: exit status 1"\n"
time="2016-05-23T15:26:43.731481314+01:00" level=error msg="Handler for POST /v1.23/exec/4e370de345ab1b06504c1242375c3b41e4b5ecd843aa486b54d288803e1f402a/start returned error: rpc error: code = 2 desc = "oci runtime error: exec failed: exit status 1""
2016/05/23 15:26:43 http: response.WriteHeader on hijacked connection
2016/05/23 15:26:43 http: response.Write on hijacked connection
time="2016-05-23T15:26:43.731718484+01:00" level=error msg="Handler for POST /v1.23/exec/4e370de345ab1b06504c1242375c3b41e4b5ecd843aa486b54d288803e1f402a/resize returned error: rpc error: code = 2 desc = "containerd: processs not found for container""

Describe the results you expected:
SSH terminal of the machine

Additional information you deem important (e.g. issue happens only occasionally):
Uninstalled and installed docker-engine multiple times

@thaJeztah
Copy link
Member

Was the container running when you tried to exec into it? You can only docker exec in a running container.

Note that a docker container is not a full virtual machine. For example, the hello-world image only contains a static binary, and nothing else, so you cannot get a shell in that image.

@thaJeztah
Copy link
Member

I also spotted that your command doesn't seem to have a container-name;

sudo docker exec -it /bin/bash

Should be

sudo docker exec -it CONTAINERNAME /bin/bash

@galtet
Copy link

galtet commented May 24, 2016

I got a similar problem:
(#22881)

@agyanttiwari
Copy link
Author

I had the container name in the command, forgot to add it in the description (updated now). I ran sudo docker exec -it CONTAINERNAME /bin/bash.

@justincormack
Copy link
Contributor

Is this the case for all containers? Can you just try

C=$(docker run -i -d alpine sh)
docker exec -it $C sh

and see if you get a shell?

@agyanttiwari
Copy link
Author

@justincormack : I am still getting the same error.
And yes, its happening with all the containers.

@galtet
Copy link

galtet commented May 25, 2016

as i mentioned before, it happens to me as well on all containers - and i am using ubuntu 14.04 as well.

@galtet
Copy link

galtet commented May 25, 2016

Ok, i investigated it a bit - the problem doesn't exist in version 1.10.3-0, it starts at version 1.11.0, which means that it happens in 1.11.0 and 1.11.1
I've tried to install each version and to see where it happens.

@agyanttiwari
Copy link
Author

Going back to version 1.10.3 fixed the problem for me as well.

@thaJeztah
Copy link
Member

@galtet @agyanttiwari are you both installing from the docker apt repository (apt.dockerproject.org), or from the Ubuntu-managed repo? Can you both give the output of docker version as well?

@galtet
Copy link

galtet commented May 25, 2016

I followed those instructions:
https://docs.docker.com/engine/installation/linux/ubuntulinux/

docker version output:
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Tue Apr 26 23:30:23 2016
OS/Arch: linux/amd64

Server:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Tue Apr 26 23:30:23 2016
OS/Arch: linux/amd64

@thaJeztah
Copy link
Member

Error is coming from here supervisor/signal.go#L12-L27 or here /supervisor/update.go#L62-L92, so either the process died before you're trying to exec into the container, or containerd isn't able to find it (or has no access).

If you run a container interactively (e.g. simply docker run -it --rm alpine sh), does that work?

Did you happen to have docker 1.10.0-rc1 installed at some point on that machine? Wondering if this could be a apparmor issue (see #21702 (comment), which also contains some instructions to remove the problematic profile)

@galtet
Copy link

galtet commented May 25, 2016

If i run the container interactively, it works fine.
I've never had 1.10.0-rc1 installed.

@agyanttiwari
Copy link
Author

The interactive exec worked for me as well, I didn't have 1.10.0 version installed on my machine at any time.

@vdemeester
Copy link
Member

The example of @justincormack is missing a -t. Without it the shell is in batch mode (because no tty) and thus dies immediatly.. so the exec will not work (container is stopped). The exec command also nedd a -t 👼

@agyanttiwari
Copy link
Author

@vdemeester, the real problem here is that exec is not working, in my case I don't want to start the machine interactively.

@thaJeztah
Copy link
Member

@agyanttiwari just to exclude that possibility, can you try

docker run -dit --name testing alpine sh
docker exec -it testing sh

@vdemeester
Copy link
Member

C=$(docker run -it -d alpine sh) 
docker exec -it $C sh

So this still does not work ?
Is apparmor running on the host or seccomp ? What are the daemon options ?

@galtet
Copy link

galtet commented May 25, 2016

@thaJeztah i still get the same error:
rpc error: code = 2 desc = "oci runtime error: exec failed: exit status 1

my docker opts:
DOCKER_OPTS='-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock --insecure-registry docker-xxx.xxx:5000'

@agyanttiwari
Copy link
Author

@thaJeztah : I am getting the same error when I run
docker run -dit --name testing alpine sh
docker exec -it testing sh

And as for the options, I didn't change any configuration and hence, I should be using the default values.

@thaJeztah thaJeztah added area/runtime kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. and removed status/more-info-needed labels May 25, 2016
@thaJeztah thaJeztah changed the title Cannot ssh into docker container Cannot exec into docker container ("containerd: process not found for container") May 25, 2016
@thaJeztah
Copy link
Member

thaJeztah commented May 25, 2016

Alright, I'm marking this as 'bug", but wondering if it's an interaction with something on the host and containerd/RunC. @galtet I'm closing your issue #22881, so that we keep the discussion in a single place (and I think it's the same issue).

To try and get some more insight into what can possibly cause this, could you both try;

ping @mlaventure @crosbymichael perhaps you have further ideas?

@agyanttiwari
Copy link
Author

agyanttiwari commented May 25, 2016

Nothing really stood out when I ran check-config.sh
info: reading kernel config from /boot/config-3.16.0-67-generic ...

Generally Necessary:

  • cgroup hierarchy: properly mounted [/sys/fs/cgroup]
  • apparmor: enabled and tools installed
  • CONFIG_NAMESPACES: enabled
  • CONFIG_NET_NS: enabled
  • CONFIG_PID_NS: enabled
  • CONFIG_IPC_NS: enabled
  • CONFIG_UTS_NS: enabled
  • CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled
  • CONFIG_CGROUPS: enabled
  • CONFIG_CGROUP_CPUACCT: enabled
  • CONFIG_CGROUP_DEVICE: enabled
  • CONFIG_CGROUP_FREEZER: enabled
  • CONFIG_CGROUP_SCHED: enabled
  • CONFIG_CPUSETS: enabled
  • CONFIG_MEMCG: enabled
  • CONFIG_KEYS: enabled
  • CONFIG_MACVLAN: enabled (as module)
  • CONFIG_VETH: enabled (as module)
  • CONFIG_BRIDGE: enabled (as module)
  • CONFIG_BRIDGE_NETFILTER: enabled
  • CONFIG_NF_NAT_IPV4: enabled (as module)
  • CONFIG_IP_NF_FILTER: enabled (as module)
  • CONFIG_IP_NF_TARGET_MASQUERADE: enabled (as module)
  • CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled (as module)
  • CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled (as module)
  • CONFIG_NF_NAT: enabled (as module)
  • CONFIG_NF_NAT_NEEDED: enabled
  • CONFIG_POSIX_MQUEUE: enabled

Optional Features:

  • CONFIG_USER_NS: enabled
  • CONFIG_SECCOMP: enabled
  • CONFIG_CGROUP_PIDS: missing
  • CONFIG_MEMCG_KMEM: enabled
  • CONFIG_MEMCG_SWAP: enabled
  • CONFIG_MEMCG_SWAP_ENABLED: missing
    (note that cgroup swap accounting is not enabled in your kernel config, you can enable it by setting boot option "swapaccount=1")
  • CONFIG_RESOURCE_COUNTERS: enabled
  • CONFIG_BLK_CGROUP: enabled
  • CONFIG_IOSCHED_CFQ: enabled
  • CONFIG_BLK_DEV_THROTTLING: enabled
  • CONFIG_CGROUP_PERF: enabled
  • CONFIG_CGROUP_HUGETLB: enabled
  • CONFIG_NET_CLS_CGROUP: enabled (as module)
  • CONFIG_CGROUP_NET_PRIO: enabled
  • CONFIG_CFS_BANDWIDTH: enabled
  • CONFIG_FAIR_GROUP_SCHED: enabled
  • CONFIG_RT_GROUP_SCHED: missing
  • CONFIG_EXT3_FS: missing
  • CONFIG_EXT3_FS_XATTR: missing
  • CONFIG_EXT3_FS_POSIX_ACL: missing
  • CONFIG_EXT3_FS_SECURITY: missing
    (enable these ext3 configs if you are using ext3 as backing filesystem)
  • CONFIG_EXT4_FS: enabled
  • CONFIG_EXT4_FS_POSIX_ACL: enabled
  • CONFIG_EXT4_FS_SECURITY: enabled
  • Storage Drivers:
    • "aufs":
      • CONFIG_AUFS_FS: enabled (as module)
    • "btrfs":
      • CONFIG_BTRFS_FS: enabled (as module)
    • "devicemapper":
      • CONFIG_BLK_DEV_DM: enabled
      • CONFIG_DM_THIN_PROVISIONING: enabled (as module)
    • "overlay":
      • CONFIG_OVERLAY_FS: missing
    • "zfs":
      • /dev/zfs: missing
      • zfs command: missing
      • zpool command: missing

@galtet
Copy link

galtet commented May 25, 2016

check-config.sh results:
warning: /proc/config.gz does not exist, searching other paths for kernel config ...
info: reading kernel config from /boot/config-3.13.0-58-generic ...

Generally Necessary:

  • cgroup hierarchy: properly mounted [/sys/fs/cgroup]
  • apparmor: enabled and tools installed
  • CONFIG_NAMESPACES: enabled
  • CONFIG_NET_NS: enabled
  • CONFIG_PID_NS: enabled
  • CONFIG_IPC_NS: enabled
  • CONFIG_UTS_NS: enabled
  • CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled
  • CONFIG_CGROUPS: enabled
  • CONFIG_CGROUP_CPUACCT: enabled
  • CONFIG_CGROUP_DEVICE: enabled
  • CONFIG_CGROUP_FREEZER: enabled
  • CONFIG_CGROUP_SCHED: enabled
  • CONFIG_CPUSETS: enabled
  • CONFIG_MEMCG: enabled
  • CONFIG_KEYS: enabled
  • CONFIG_MACVLAN: enabled (as module)
  • CONFIG_VETH: enabled (as module)
  • CONFIG_BRIDGE: enabled (as module)
  • CONFIG_BRIDGE_NETFILTER: enabled
  • CONFIG_NF_NAT_IPV4: enabled (as module)
  • CONFIG_IP_NF_FILTER: enabled (as module)
  • CONFIG_IP_NF_TARGET_MASQUERADE: enabled (as module)
  • CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled (as module)
  • CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled (as module)
  • CONFIG_NF_NAT: enabled (as module)
  • CONFIG_NF_NAT_NEEDED: enabled
  • CONFIG_POSIX_MQUEUE: enabled

Optional Features:

  • CONFIG_USER_NS: enabled
  • CONFIG_SECCOMP: enabled
  • CONFIG_CGROUP_PIDS: missing
  • CONFIG_MEMCG_SWAP: enabled
  • CONFIG_MEMCG_SWAP_ENABLED: missing
    (note that cgroup swap accounting is not enabled in your kernel config, you can enable it by setting boot option "swapaccount=1")
  • CONFIG_MEMCG_KMEM: enabled
  • CONFIG_RESOURCE_COUNTERS: enabled
  • CONFIG_BLK_CGROUP: enabled
  • CONFIG_BLK_DEV_THROTTLING: enabled
  • CONFIG_IOSCHED_CFQ: enabled
  • CONFIG_CFQ_GROUP_IOSCHED: enabled
  • CONFIG_CGROUP_PERF: enabled
  • CONFIG_CGROUP_HUGETLB: enabled
  • CONFIG_NET_CLS_CGROUP: enabled (as module)
  • CONFIG_NETPRIO_CGROUP: enabled (as module)
  • CONFIG_CFS_BANDWIDTH: enabled
  • CONFIG_FAIR_GROUP_SCHED: enabled
  • CONFIG_RT_GROUP_SCHED: missing
  • CONFIG_EXT3_FS: missing
  • CONFIG_EXT3_FS_XATTR: missing
  • CONFIG_EXT3_FS_POSIX_ACL: missing
  • CONFIG_EXT3_FS_SECURITY: missing
    (enable these ext3 configs if you are using ext3 as backing filesystem)
  • CONFIG_EXT4_FS: enabled
  • CONFIG_EXT4_FS_POSIX_ACL: enabled
  • CONFIG_EXT4_FS_SECURITY: enabled
  • Network Drivers:
    • "overlay":
      • CONFIG_VXLAN: enabled (as module)
  • Storage Drivers:
    • "aufs":
      • CONFIG_AUFS_FS: enabled (as module)
    • "btrfs":
      • CONFIG_BTRFS_FS: enabled (as module)
    • "devicemapper":
      • CONFIG_BLK_DEV_DM: enabled
      • CONFIG_DM_THIN_PROVISIONING: enabled (as module)
    • "overlay":
      • CONFIG_OVERLAY_FS: missing
    • "zfs":
      • /dev/zfs: missing
      • zfs command: missing
      • zpool command: missing

@Miyurz
Copy link

Miyurz commented Jul 26, 2016

Is this fixed yet ?

This is happening for me too when i try to connect to prometheus container.

Steps to reproduce this:
$ docker pull prom/prometheus
$ docker run -d --name prometheus -p 9090:9090 prom/prometheus
$ docker -D exec -it prometheus /bin/bash

rpc error: code = 2 desc = "oci runtime error: exec failed: exec: "/bin/bash": stat /bin/bash: no such file or directory"DEBU[0000] [hijack] End of stdout
DEBU[0000] Error resize: Error response from daemon: rpc error: code = 2 desc = "containerd: processs not found for container"

@thaJeztah
Copy link
Member

@Miyurz the prometheus image is based on busybox; https://hub.docker.com/r/prom/prometheus/~/dockerfile/, which doesn't have bash. Try sh instead;

docker run -d --name prometheus -p 9090:9090 prom/prometheus

docker -D exec -it prometheus sh                                                                                                                      di 26 jul 13:29:40 2016
/prometheus #

@Miyurz
Copy link

Miyurz commented Jul 26, 2016

Cool, it works for me now. Thanks @thaJeztah

@jwilmoth
Copy link

jwilmoth commented Aug 1, 2016

We're seeing the same issue running a container on 1.11.1 (on Amazon Linux). The check-config.sh results from this env also look generally good:

warning: /proc/config.gz does not exist, searching other paths for kernel config ...
info: reading kernel config from /boot/config-4.4.14-24.50.amzn1.x86_64 ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_CPUSETS: enabled
- CONFIG_MEMCG: enabled
- CONFIG_KEYS: enabled
- CONFIG_VETH: enabled (as module)
- CONFIG_BRIDGE: enabled (as module)
- CONFIG_BRIDGE_NETFILTER: enabled (as module)
- CONFIG_NF_NAT_IPV4: enabled (as module)
- CONFIG_IP_NF_FILTER: enabled (as module)
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled (as module)
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled (as module)
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled (as module)
- CONFIG_NF_NAT: enabled (as module)
- CONFIG_NF_NAT_NEEDED: enabled
- CONFIG_POSIX_MQUEUE: enabled

Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: enabled
- CONFIG_CGROUP_PIDS: enabled
- CONFIG_MEMCG_SWAP: enabled
- CONFIG_MEMCG_SWAP_ENABLED: enabled
- CONFIG_MEMCG_KMEM: enabled
- CONFIG_BLK_CGROUP: enabled
- CONFIG_BLK_DEV_THROTTLING: enabled
- CONFIG_IOSCHED_CFQ: enabled (as module)
- CONFIG_CFQ_GROUP_IOSCHED: missing
- CONFIG_CGROUP_PERF: enabled
- CONFIG_CGROUP_HUGETLB: enabled
- CONFIG_NET_CLS_CGROUP: enabled (as module)
- CONFIG_CGROUP_NET_PRIO: enabled
- CONFIG_CFS_BANDWIDTH: enabled
- CONFIG_FAIR_GROUP_SCHED: enabled
- CONFIG_RT_GROUP_SCHED: enabled
- CONFIG_IP_VS: enabled (as module)
- CONFIG_EXT3_FS: enabled (as module)
- CONFIG_EXT3_FS_XATTR: missing
- CONFIG_EXT3_FS_POSIX_ACL: enabled
- CONFIG_EXT3_FS_SECURITY: enabled
    (enable these ext3 configs if you are using ext3 as backing filesystem)
- CONFIG_EXT4_FS: enabled (as module)
- CONFIG_EXT4_FS_POSIX_ACL: enabled
- CONFIG_EXT4_FS_SECURITY: enabled
- Network Drivers:
  - "overlay":
    - CONFIG_VXLAN: enabled (as module)
    Optional (for secure networks):
    - CONFIG_XFRM_ALGO: enabled (as module)
    - CONFIG_XFRM_USER: enabled (as module)
  - "ipvlan":
    - CONFIG_IPVLAN: enabled (as module)
  - "macvlan":
    - CONFIG_MACVLAN: missing
    - CONFIG_DUMMY: enabled (as module)
- Storage Drivers:
  - "aufs":
    - CONFIG_AUFS_FS: missing
  - "btrfs":
    - CONFIG_BTRFS_FS: enabled (as module)
  - "devicemapper":
    - CONFIG_BLK_DEV_DM: enabled (as module)
    - CONFIG_DM_THIN_PROVISIONING: enabled (as module)
  - "overlay":
    - CONFIG_OVERLAY_FS: enabled (as module)
  - "zfs":
    - /dev/zfs: missing
    - zfs command: missing
    - zpool command: missing

Limits:
- /proc/sys/kernel/keys/root_maxkeys: 1000000

@jwilmoth
Copy link

jwilmoth commented Aug 1, 2016

In our case "docker exec -it bash" initially worked after the container was started, but after ~8 minutes it stopped working. Below are the /var/log/docker file contents up to the first failure.

time="2016-08-01T20:11:59.539677085Z" level=info msg="New containerd process, pid: 2569\n" 
time="2016-08-01T20:12:03.059593237Z" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section." 
time="2016-08-01T20:12:03.657066315Z" level=info msg="devmapper: Creating filesystem xfs on device docker-202:1-263699-base" 
time="2016-08-01T20:12:03.962615034Z" level=info msg="devmapper: Successfully created filesystem xfs on device docker-202:1-263699-base" 
time="2016-08-01T20:12:04.031002719Z" level=info msg="Graph migration to content-addressability took 0.00 seconds" 
time="2016-08-01T20:12:04.526054003Z" level=info msg="Firewalld running: false" 
time="2016-08-01T20:12:05.033797224Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" 
time="2016-08-01T20:12:05.084491427Z" level=warning msg="Your kernel does not support cgroup blkio weight" 
time="2016-08-01T20:12:05.084520454Z" level=warning msg="Your kernel does not support cgroup blkio weight_device" 
time="2016-08-01T20:12:05.084617684Z" level=warning msg="mountpoint for pids not found" 
time="2016-08-01T20:12:05.085189332Z" level=info msg="Loading containers: start." 

time="2016-08-01T20:12:05.085222412Z" level=info msg="Loading containers: done." 
time="2016-08-01T20:12:05.085231402Z" level=info msg="Daemon has completed initialization" 
time="2016-08-01T20:12:05.085241326Z" level=info msg="Docker daemon" commit="5604cbe/1.11.1" graphdriver=devicemapper version=1.11.1 
time="2016-08-01T20:12:05.090573272Z" level=info msg="API listen on /var/run/docker.sock" 
time="2016-08-01T20:12:17.551313502Z" level=info msg="Processing signal 'terminated'" 
time="2016-08-01T20:12:17Z" level=info msg="stopping containerd after receiving terminated" 
\nMon Aug  1 20:12:21 UTC 2016\n
time="2016-08-01T20:12:21.711687765Z" level=info msg="New containerd process, pid: 3176\n" 
time="2016-08-01T20:12:22.743509847Z" level=info msg="devmapper: Creating filesystem xfs on device docker-202:1-263711-base" 
time="2016-08-01T20:12:22.938052546Z" level=info msg="devmapper: Successfully created filesystem xfs on device docker-202:1-263711-base" 
time="2016-08-01T20:12:23.013383785Z" level=info msg="Graph migration to content-addressability took 0.00 seconds" 
time="2016-08-01T20:12:23.016876170Z" level=info msg="Firewalld running: false" 
time="2016-08-01T20:12:23.053115440Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" 
time="2016-08-01T20:12:23.107657021Z" level=warning msg="Your kernel does not support cgroup blkio weight" 
time="2016-08-01T20:12:23.107686647Z" level=warning msg="Your kernel does not support cgroup blkio weight_device" 
time="2016-08-01T20:12:23.107775412Z" level=warning msg="mountpoint for pids not found" 
time="2016-08-01T20:12:23.107951026Z" level=info msg="Loading containers: start." 

time="2016-08-01T20:12:23.107989637Z" level=info msg="Loading containers: done." 
time="2016-08-01T20:12:23.107999375Z" level=info msg="Daemon has completed initialization" 
time="2016-08-01T20:12:23.108010266Z" level=info msg="Docker daemon" commit="5604cbe/1.11.1" graphdriver=devicemapper version=1.11.1 
time="2016-08-01T20:12:23.113303778Z" level=info msg="API listen on /var/run/docker.sock" 
time="2016-08-01T20:12:53.062896165Z" level=info msg="Processing signal 'terminated'" 
time="2016-08-01T20:12:53Z" level=info msg="stopping containerd after receiving terminated" 
\nMon Aug  1 20:12:54 UTC 2016\n
Warning: '-r' is deprecated, it will be removed soon. See usage.
time="2016-08-01T20:12:54.194788817Z" level=info msg="New containerd process, pid: 3490\n" 
time="2016-08-01T20:12:55.304667149Z" level=info msg="Graph migration to content-addressability took 0.00 seconds" 
time="2016-08-01T20:12:55.308169336Z" level=info msg="Firewalld running: false" 
time="2016-08-01T20:12:55.359824755Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" 
time="2016-08-01T20:12:55.383076264Z" level=warning msg="Your kernel does not support cgroup blkio weight" 
time="2016-08-01T20:12:55.383103908Z" level=warning msg="Your kernel does not support cgroup blkio weight_device" 
time="2016-08-01T20:12:55.383205303Z" level=warning msg="mountpoint for pids not found" 
time="2016-08-01T20:12:55.383395988Z" level=info msg="Loading containers: start." 

time="2016-08-01T20:12:55.383435662Z" level=info msg="Loading containers: done." 
time="2016-08-01T20:12:55.383444925Z" level=info msg="Daemon has completed initialization" 
time="2016-08-01T20:12:55.383455424Z" level=info msg="Docker daemon" commit="5604cbe/1.11.1" graphdriver=devicemapper version=1.11.1 
time="2016-08-01T20:12:55.388846795Z" level=info msg="API listen on /var/run/docker.sock" 
time="2016-08-01T20:13:35.315865930Z" level=info msg="Layer sha256:d890696c5d0ccb2236ec6b3b89a1bcad58356fe80473f32162ac345f013dfd57 cleaned up" 
time="2016-08-01T20:13:35.474383422Z" level=error msg="devmapper: Error unmounting device 70990466e9dc623d0e82b861ccb95183a689c623da8ff4b37e00b495c45aa980: invalid argument" 
time="2016-08-01T20:14:19.542568413Z" level=error msg="Handler for DELETE /v1.23/containers/1c0612e24127 returned error: You cannot remove a running container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e. Stop the container before attempting removal or use -f" 
time="2016-08-01T20:14:19.598416064Z" level=error msg="Handler for DELETE /v1.23/images/c630e4091b2f returned error: conflict: unable to delete c630e4091b2f (cannot be forced) - image is being used by running container 1c0612e24127" 
time="2016-08-01T20:14:19.599737748Z" level=error msg="Handler for DELETE /v1.23/images/78b7d70e0731 returned error: conflict: unable to delete 78b7d70e0731 (cannot be forced) - image has dependent child images" 
time="2016-08-01T20:22:24.032174624Z" level=error msg="Handler for POST /v1.23/exec/d05799739e2ee71039976446fe1a411cfcb5bbbdca3ebf527b89af68732ea015/resize returned error: rpc error: code = 2 desc = \"containerd: processs not found for container\""

I tried stopping the container to see if restarting it would re-enable docker exec, but the container then wouldn't start up again.

time="2016-08-01T20:22:47.201883997Z" level=error msg="Handler for POST /v1.23/exec/3f14509ed924cb5efe6fcc1519dc8e0427cbc895a7e0ca5efc5a1ea75fe74d63/resize returned error: rpc error: code = 2 desc = \"containerd: processs not found for container\"" 
time="2016-08-01T20:23:02.258431100Z" level=error msg="Driver devicemapper couldn't return diff size of container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e: open /dev/mapper/docker-202:1-263711-8be875091126f9dd695b126e128bff87992c6e3f7bc754dc4e706e3ae5f343ab: no such file or directory" 
time="2016-08-01T20:23:59.757624611Z" level=error msg="Handler for POST /v1.23/exec/728d1e17338f7734c5147ea4f6d0ef4f00adde95402a1606e40cad14b7057653/resize returned error: rpc error: code = 2 desc = \"containerd: processs not found for container\"" 
time="2016-08-01T20:24:01.857539531Z" level=error msg="Driver devicemapper couldn't return diff size of container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e: open /dev/mapper/docker-202:1-263711-8be875091126f9dd695b126e128bff87992c6e3f7bc754dc4e706e3ae5f343ab: no such file or directory" 
time="2016-08-01T20:25:01.858125619Z" level=error msg="Driver devicemapper couldn't return diff size of container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e: open /dev/mapper/docker-202:1-263711-8be875091126f9dd695b126e128bff87992c6e3f7bc754dc4e706e3ae5f343ab: no such file or directory" 
time="2016-08-01T20:26:01.861025497Z" level=error msg="Driver devicemapper couldn't return diff size of container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e: open /dev/mapper/docker-202:1-263711-8be875091126f9dd695b126e128bff87992c6e3f7bc754dc4e706e3ae5f343ab: no such file or directory" 
time="2016-08-01T20:27:01.860577728Z" level=error msg="Driver devicemapper couldn't return diff size of container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e: open /dev/mapper/docker-202:1-263711-8be875091126f9dd695b126e128bff87992c6e3f7bc754dc4e706e3ae5f343ab: no such file or directory" 
time="2016-08-01T20:28:01.862537739Z" level=error msg="Driver devicemapper couldn't return diff size of container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e: open /dev/mapper/docker-202:1-263711-8be875091126f9dd695b126e128bff87992c6e3f7bc754dc4e706e3ae5f343ab: no such file or directory" 
time="2016-08-01T20:29:01.864614770Z" level=error msg="Driver devicemapper couldn't return diff size of container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e: open /dev/mapper/docker-202:1-263711-8be875091126f9dd695b126e128bff87992c6e3f7bc754dc4e706e3ae5f343ab: no such file or directory" 
time="2016-08-01T20:29:44.854316105Z" level=info msg="Container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e failed to exit within 10 seconds of signal 15 - using the force" 
time="2016-08-01T20:29:45.050264401Z" level=error msg="devmapper: Error unmounting device 8be875091126f9dd695b126e128bff87992c6e3f7bc754dc4e706e3ae5f343ab: invalid argument" 
time="2016-08-01T20:29:45.050305592Z" level=error msg="Error unmounting container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e: invalid argument" 
time="2016-08-01T20:29:45.095966154Z" level=warning msg="error locating sandbox id aa4b26aa429d5a2ef1bf972d3d8e1e2284018a7ad6909f8fc92eb4b2d24e2c38: sandbox aa4b26aa429d5a2ef1bf972d3d8e1e2284018a7ad6909f8fc92eb4b2d24e2c38 not found" 
time="2016-08-01T20:29:45.096006178Z" level=warning msg="failed to cleanup ipc mounts:\nfailed to umount /var/lib/docker/containers/1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e/shm: invalid argument" 
time="2016-08-01T20:29:45.096020922Z" level=error msg="Error unmounting container 1c0612e24127506845e4c01b859baf0fb1e2fa65ee1bee73fbf3c7a0f8c94b2e: not mounted" 

@mlaventure
Copy link
Contributor

@jwilmoth would it be possible for you to switch the daemon into debug mode so the logs can provide us more information? Then if you could post the updated logs when it re-occurs, it would be helpful.

Also, your logs seems to show that the daemon got stopped 3 times before the issue occurred, is this an expected behavior of your setup?

@pompeiisneaks
Copy link

I work with @jonwilmoth, I was able to run this with docker debug enabled (It wasn't easy, the host seems to be in a state where I can't get it to read in anything and restarting docker doesn't help, it just returns to this state. Even a reboot fails.) It seems potentially to be related to the docker socket /var/run/docker.sock, I tried echo'ing the POST command to the socket directly and it complains of no such file or directory. I can see it there and everything. I'm attaching strace output of the run when I tried docker exec and I have a separate debug output where I ran docker manually on the host with -D at the end to get debug output. Let me know if you need anything else.
dockerStraceOutput.txt
DockerDebugOutput.txt

@abivarghese
Copy link

I am hitting this issue as well (with docker version 1.11.1). Not able to recover my containers even after reboot. Environment is RHEL 7.2. I am hitting this issue periodically, when hit unable to recover from the problem. I think this has some connection with devicemapper driver possibly but not sure..

@mlaventure:
I have the below logs, please see if it help to solve this issue.. (Somehow the strace details haven't come, if that is an issue I could try to reproduce the logs). Attaching the /var/log/messages as well.

docker-containerd.txt
docker-commands.txt
dockerd.txt
messages.txt

@pompeiisneaks
Copy link

Any updates? at this point I'm going to try to roll back to 1.9.x to see if I can keep my services accessible post deploy.

@mlaventure
Copy link
Contributor

@pompeiisneaks Have you tried stracing it (see #22909 (comment))

Also, have you tried using 1.12.0 instead?

Since I still can't reproduce the issue, it makes debugging it quite complicated.

@mlaventure
Copy link
Contributor

@abivarghese looking at your logs, it seems that you have quite a few device mapper related error, could it be that you're running out of space on your device?

@pompeiisneaks
Copy link

@mlaventure I'll give the strace a try. Was my strace output of the command itself not enough information, or the debug output? I'm currently trying to move back to 1.9.1, as we don't have the ability to go forward, we're locked into AWS' EB environment options, which, for docker, go only to 1.11.1

@mlaventure
Copy link
Contributor

@pompeiisneaks the exec comes from runc itself, its strace may be useful to determine which path exactly is being taken

@abivarghese
Copy link

@mlaventure : We have enough space on the disk, so it do not look to be a disk issue. We consistently hit device mapper issues on our containers on RHEL. Do not know how to avoid the issues? Appreciate any pointers which help to reduce the issues or impacts on RHEL..

@mlaventure
Copy link
Contributor

@abivarghese sorry, at the moment, I still don't have an idea of what could be the root cause.

If you could provide a strace of runc when doing the exec, it could help me getting a better idea of what's going on.

@mlaventure mlaventure self-assigned this Aug 31, 2016
@mlaventure
Copy link
Contributor

ping @crosbymichael in case you get any ideas

ping @abivarghese any luck with strace? :)

@aa21
Copy link

aa21 commented Sep 16, 2016

Having the same error here too:

Error: rpc error: code = 2 desc = oci runtime error: exec failed: exec: "exec which mysql": executable file not found in $PATH

Host machine: OSX El Capitan 10.11

Docker image setup command:
docker run --name DB -e MYSQL_ROOT_PASSWORD=my_pass --net Common -v /Users/a20/docker-host/DB/data:/var/lib/mysql -v /Users/a20/docker-host/DB/log:/var/log -p 3306:3306 -d mysql:5.7.15

Commands that results in the error:
e.g Command 1: docker exec $DOCKER_MYSQL_NAME "exec which mysql"

rpc error: code = 2 desc = oci runtime error: exec failed: exec: "exec which mysql": executable file not found in $PATH

e.g Command 2: docker exec $DOCKER_MYSQL_NAME "exec mysql -uroot -pmy_pass"

rpc error: code = 2 desc = oci runtime error: exec failed: exec: "exec mysql -uroot -pmy_pass ": executable file not found in $PATH

Image is running, running the commands interactively works.

@thaJeztah
Copy link
Member

thaJeztah commented Sep 16, 2016

@aa21 exec is a built-in command, so cannot be used as command for a container (theres no "file" / "executable" named exec). In your case, there's no reason to use it, try running simply:

docker exec $DOCKER_MYSQL_NAME which mysql

or (with a shell);

docker exec $DOCKER_MYSQL_NAME /bin/sh -c "which mysql"

And it should work

@qupro
Copy link

qupro commented Dec 15, 2016

@mlaventure, yes I tested in 1.12 (first time ever with docker) and I get same error

rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: container_linux.go:247: starting container process caused \"exec: \\\"/bin/initdb\\\": stat /bin/initdb: no such file or directory\"\n"

$ docker version
Client:
Version: 1.12.4
API version: 1.24
Go version: go1.6.4
Git commit: 1564f02
Built: Mon Dec 12 23:50:16 2016
OS/Arch: linux/amd64

@thaJeztah
Copy link
Member

@qupro is that an image you built yourself? Make sure that;

These errors are usually directly from the kernel, and can be cryptic

@qupro
Copy link

qupro commented Dec 16, 2016

@thaJeztah I am using this docker container https://github.com/geo-data/openstreetmap-tiles-docker, and I was running this sudo docker exec <PID> run initdb without "run", with it it's ok. I will read more documentation, thanks.

@mlaventure
Copy link
Contributor

@qupro the parameter to exec after the container id is directly the command to be executed, you can forgo the run.

I'll close this issue meanwhile seems it seems the issue was the command used.

If you have more questions on how to use docker, feel free to join our slack community: https://community.docker.com/registrations/groups/4316

@ghost
Copy link

ghost commented Feb 15, 2017

I used to manage this issue by simply restarting the docker daemon:

ubuntu@myserver:~$ sudo docker exec -it 3c0874121e1e /bin/bash
rpc error: code = 2 desc = containerd: container not found
ubuntu@myserver:~$ sudo systemctl restart docker
ubuntu@myserver:~$ docker exec -it 3c0874121e1e /bin/bash
root@3c0874121e1e:/#

@RunsFor
Copy link

RunsFor commented Mar 7, 2017

Also, restart did help :(

[i.konyukhov@mc1 ~]$ docker ps | grep 67b35ca8
67b35ca8a669        feature-137-mig-topic-page-defda3a7087ae464cef1275a8a6cf710382c23d0           "/web/node_modules..."   16 hours ago        Up 16 hours         0.0.0.0:32992->8888/tcp                               feature137migtopicpagesiteautoramblerunity_web_1
[i.konyukhov@mc1 ~]$ docker exec -it 67b35ca8a669 sh
rpc error: code = 2 desc = containerd: container not found
Docker version 1.13.0-rc4

@thaJeztah
Copy link
Member

@RunsFor looks like you're running an old pre-release version of docker; at least try updating to the current release. If you still have issues, please open a new issue with details, and steps to reproduce.

@thaJeztah
Copy link
Member

It looks like the original issue reported here was resolved, and I want to prevent this issue from becoming a kitchen sink of possibly unrelated issues, so I'm going to lock the conversation here.

If you still have issues and suspect there's a bug at hand, please open a new issue. Be sure to include as much details as possible, and steps to reproduce to help debugging the issue.

@moby moby locked and limited conversation to collaborators Mar 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/runtime kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/more-info-needed version/1.11
Projects
None yet
Development

No branches or pull requests