moby: Docker stop doesn't stop the docker container

screen shot 2017-07-13 at 11 09 13 pm **Description**

Hi,

I issued docker stop command on a container and it didn’t stop. It stills shows in the docker ps command. Basically I noticed that the docker-proxy hangs on the port 8082.

Steps to reproduce the issue:

  1. Run a docker container
  2. Stop it using docker stop containerid
  3. Run docker ps and it still shows it as running.

Describe the results you received: The docker ps command still shows the container as running.

Describe the results you expected: I would expect the container to close.

Output of docker version:

Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:05:44 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:05:44 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 4
 Running: 2
 Paused: 0
 Stopped: 2
Images: 23
Server Version: 17.03.1-ce
Storage Driver: devicemapper
 Pool Name: docker-8:1-35909492-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 5.935 GB
 Data Space Total: 107.4 GB
 Data Space Available: 60.87 GB
 Metadata Space Used: 8.061 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.139 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.107-RHEL7 (2015-10-14)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-327.3.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.305 GiB
Name: gce-opnfv-sandbox-fbrockners
ID: OGTI:EGLD:WHN6:6QZ3:N5AO:OIGL:6VA2:KS4T:EFLF:R54X:6KBE:I635
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 28 (9 by maintainers)

Most upvoted comments

wow this is still a thing?

hello @thaJeztah We do have the same issue. I have debug log from the docker daemon, hope this will clarify some things! Also, it happens quite frequently. If you need more details, please ask.

  1. Issue: docker stop does not remove container from the output of docker ps
[ec2-user@ip-10-205-230-228 ~]$ docker ps | grep 18229deae6a7
18229deae6a7        062294638970.dkr.ecr.ap-southeast-2.amazonaws.com/journey:145              "java -jar app.jar..."   10 hours ago        Up 10 hours         0.0.0.0:32881->8080/tcp, 0.0.0.0:32880->8081/tcp   ecs-dev-journey-101-journey-eee6aaa39cf1f594bc01
[ec2-user@ip-10-205-230-228 ~]$ docker stop 18229deae6a7
18229deae6a7
[ec2-user@ip-10-205-230-228 ~]$ docker ps | grep 18229deae6a7
18229deae6a7        062294638970.dkr.ecr.ap-southeast-2.amazonaws.com/journey:145              "java -jar app.jar..."   10 hours ago        Up 10 hours         0.0.0.0:32881->8080/tcp, 0.0.0.0:32880->8081/tcp   ecs-dev-journey-101-journey-eee6aaa39cf1f594bc01
  1. I run docker ps, here is the output docker_ps.log. Two containers are identical: 551a3d590617 and 18229deae6a7, but the former one replies to http requests, while the later does not. See the ports mapping in the docker_ps.log
[ec2-user@ip-10-205-230-228 ~]$ curl localhost:32883
{"code":404,"message":"HTTP 404 Not Found"}
[ec2-user@ip-10-205-230-228 ~]$ curl localhost:32881
curl: (56) Recv failure: Connection reset by peer
  1. I run docker inspect for both containers: alive container docker_inspect_551a3d590617.log, ghost container docker_inspect_18229deae6a7.log. The process for the live container exists, while the process for the ghost container does not exists
[ec2-user@ip-10-205-230-228 ~]$ docker inspect -f '{{json .State}}'  551a3d590617
{"Status":"running","Running":true,"Paused":false,"Restarting":false,"OOMKilled":false,"Dead":false,"Pid":28574,"ExitCode":0,"Error":"","StartedAt":"2017-11-28T15:13:58.324505345Z","FinishedAt":"0001-01-01T00:00:00Z"}
[ec2-user@ip-10-205-230-228 ~]$ ps auxf | grep 28574
ec2-user  5532  0.0  0.1 110468  2004 pts/0    S+   09:43   0:00              \_ grep --color=auto 28574
1000     28574  0.2 21.9 2214348 223268 ?      Ssl  04:13   0:41  |       \_ java -jar app.jar server etc/test.yml
[ec2-user@ip-10-205-230-228 ~]$ docker inspect -f '{{json .State}}' 18229deae6a7
{"Status":"running","Running":true,"Paused":false,"Restarting":false,"OOMKilled":false,"Dead":false,"Pid":4977,"ExitCode":0,"Error":"","StartedAt":"2017-11-28T10:26:07.523573265Z","FinishedAt":"0001-01-01T00:00:00Z"}
[ec2-user@ip-10-205-230-228 ~]$ ps auxf | grep 4977
ec2-user 15395  0.0  0.2 110468  2080 pts/0    S+   10:14   0:00              \_ grep --color=auto 4977
  1. Output of the docker info: docker_info.log

  2. Debug log of the docker daemon since the beginning of the EC2 instance: docker.log