moby: OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown

Description docker exec xxx ls: OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown

Steps to reproduce the issue: occur very infrequently

Describe the results you received:

`docker ps` find that the container is running, 
Actually the container is exited( cat /proc/${Container.State.Pid}/stat: No such file or directory ) 

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

18.03.0-ce

Output of docker info:

Containers: 48
 Running: 11
 Paused: 0
 Stopped: 37
Images: 59
Server Version: 18.03.0-ce
Storage Driver: overlay2
 Backing Filesystem: xfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: syslog
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: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.16.6-1.el7.elrepo.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 62.91GiB
...
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 21 (8 by maintainers)

Most upvoted comments

I also see this error, any updates?

Happened to us too, After OOM killer.

docker inspect:

[
    {
        "Id": "9b3043f16abc36d0c82fc609f530c62d2b25474a335b13d8782d6768c8a173ad",
        "Created": "2021-01-28T17:05:11.787491846Z",
        "Path": "docker-entrypoint.sh",
        "Args": [
            "npm",
            "run",
            "start:prod"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 10659,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2021-01-30T14:49:23.77605117Z",
            "FinishedAt": "2021-01-30T14:49:19.412762798Z"
        },
        "Image": "sha256:736da07d5d33995e4c9db41017b0ff41e1682bf5a8d13218b2836b550134790b",
        "ResolvConfPath": "/var/lib/docker/containers/9b3043f16abc36d0c82fc609f530c62d2b25474a335b13d8782d6768c8a173ad/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/9b3043f16abc36d0c82fc609f530c62d2b25474a335b13d8782d6768c8a173ad/hostname",
        "HostsPath": "/var/lib/docker/containers/9b3043f16abc36d0c82fc609f530c62d2b25474a335b13d8782d6768c8a173ad/hosts",
        "LogPath": "",
        "Name": "/vag_vag-session-manager_1",
        "RestartCount": 5,
        "Driver": "overlay2",
        "Platform": "linux",
...
$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 11
  Running: 11
  Paused: 0
  Stopped: 0
 Images: 13
 Server Version: 19.03.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version:
 runc version:
 init version:
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-1036-azure
 Operating System: Ubuntu 18.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 1
 Total Memory: 3.352GiB
 Name: connector
 ID: 4GOI:SJIQ:YGLJ:KFKL:5RZL:TYTI:3QEU:BDFJ:VOA4:SPZP:QJTE:YG4U
 Docker Root Dir: /var/lib/docker
 Debug Mode: 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