{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/25857","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/25857/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/25857/comments","events_url":"https://api.github.com/repos/docker/docker/issues/25857/events","html_url":"https://github.com/docker/docker/issues/25857","id":172027336,"number":25857,"title":"\"docker ps\" doesn't work after machine restart in swarm mode","user":{"login":"groyee","id":194016,"avatar_url":"https://avatars.githubusercontent.com/u/194016?v=3","gravatar_id":"","url":"https://api.github.com/users/groyee","html_url":"https://github.com/groyee","followers_url":"https://api.github.com/users/groyee/followers","following_url":"https://api.github.com/users/groyee/following{/other_user}","gists_url":"https://api.github.com/users/groyee/gists{/gist_id}","starred_url":"https://api.github.com/users/groyee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groyee/subscriptions","organizations_url":"https://api.github.com/users/groyee/orgs","repos_url":"https://api.github.com/users/groyee/repos","events_url":"https://api.github.com/users/groyee/events{/privacy}","received_events_url":"https://api.github.com/users/groyee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-18T23:58:24Z","updated_at":"2016-08-19T00:02:54Z","closed_at":null,"body":"<!--\r\nIf you are reporting a new issue, make sure that we do not have any duplicates\r\nalready open. You can ensure this by searching the issue list for this\r\nrepository. If there is a duplicate, please close your issue and add a comment\r\nto the existing issue instead.\r\n\r\nIf you suspect your issue is a bug, please edit your issue description to\r\ninclude the BUG REPORT INFORMATION shown below. If you fail to provide this\r\ninformation within 7 days, we cannot debug your issue and will close it. We\r\nwill, however, reopen it if you later provide the information.\r\n\r\nFor more information about reporting issues, see\r\nhttps://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues\r\n\r\n---------------------------------------------------\r\nBUG REPORT INFORMATION\r\n---------------------------------------------------\r\nUse the commands below to provide key information from your environment:\r\nYou do NOT have to include this information if this is a FEATURE REQUEST\r\n-->\r\n\r\n**Output of `docker version`:**\r\n\r\nClient:\r\n Version:      1.12.0\r\n API version:  1.24\r\n Go version:   go1.6.3\r\n Git commit:   8eab29e\r\n Built:        Thu Jul 28 22:05:53 2016\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      swarm/1.2.4\r\n API version:  1.22\r\n Go version:   go1.5.4\r\n Git commit:   5d5f7f0\r\n Built:        Thu Jul 28 19:52:54 UTC 2016\r\n OS/Arch:      linux/amd64\r\n\r\n\r\n**Output of `docker info`:**\r\n\r\nContainers: 30\r\n Running: 26\r\n Paused: 0\r\n Stopped: 4\r\nImages: 96\r\nServer Version: swarm/1.2.4\r\nRole: replica\r\nPrimary: 192.168.0.8:3376\r\nStrategy: spread\r\nFilters: health, port, containerslots, dependency, affinity, constraint\r\nNodes: 9\r\n batchprocessing1: 192.168.0.17:2376\r\n  └ ID: KZN7:CK5H:DSXN:U7IU:3BPY:WDQ5:EKOT:JE6M:ERXL:TSAW:UO6F:UIK2\r\n  └ Status: Healthy\r\n  └ Containers: 2 (2 Running, 0 Paused, 0 Stopped)\r\n  └ Reserved CPUs: 0 / 2\r\n  └ Reserved Memory: 0 B / 14.38 GiB\r\n  └ Labels: kernelversion=4.4.0-34-generic, machinerole=batchprocessing, machinetype=C, operatingsystem=Ubuntu 16.04.1 LTS, provider=azure, storagedriver=aufs\r\n  └ UpdatedAt: 2016-08-18T23:37:17Z\r\n  └ ServerVersion: 1.12.1\r\n batchprocessing2: 192.168.0.13:2376\r\n  └ ID: JN2D:WU2T:ODUB:FYFC:WVG7:STAC:CVJN:ANS6:7WHN:MHL4:YEMC:ULGH\r\n  └ Status: Healthy\r\n  └ Containers: 2 (2 Running, 0 Paused, 0 Stopped)\r\n  └ Reserved CPUs: 0 / 2\r\n  └ Reserved Memory: 0 B / 14.38 GiB\r\n  └ Labels: kernelversion=4.4.0-34-generic, machinerole=batchprocessing, machinetype=C, operatingsystem=Ubuntu 16.04.1 LTS, provider=azure, storagedriver=aufs\r\n  └ UpdatedAt: 2016-08-18T23:36:46Z\r\n  └ ServerVersion: 1.12.1\r\n kafka1: 192.168.0.9:2376\r\n  └ ID: NMOP:72DR:IWCA:LNNK:UMBO:QO2S:DQKC:NLVJ:RY3V:P6FN:ZLRI:MYGQ\r\n  └ Status: Healthy\r\n  └ Containers: 4 (4 Running, 0 Paused, 0 Stopped)\r\n  └ Reserved CPUs: 0 / 2\r\n  └ Reserved Memory: 0 B / 7.145 GiB\r\n  └ Labels: containerslots=4, kernelversion=4.2.0-41-generic, machinetype=A, operatingsystem=Ubuntu 15.10, provider=azure, storagedriver=aufs\r\n  └ UpdatedAt: 2016-08-18T23:37:26Z\r\n  └ ServerVersion: 1.12.0\r\n kafka2: 192.168.0.10:2376\r\n  └ ID: 2FL5:AY3V:3DTY:Z7KE:PPOO:LH3K:EDKV:FXZV:6BX7:LPNI:H3YU:EQCD\r\n  └ Status: Healthy\r\n  └ Containers: 4 (4 Running, 0 Paused, 0 Stopped)\r\n  └ Reserved CPUs: 0 / 2\r\n  └ Reserved Memory: 0 B / 7.145 GiB\r\n  └ Labels: containerslots=4, kernelversion=4.2.0-41-generic, machinetype=A, operatingsystem=Ubuntu 15.10, provider=azure, storagedriver=aufs\r\n  └ UpdatedAt: 2016-08-18T23:37:27Z\r\n  └ ServerVersion: 1.12.0\r\n kafka3: 192.168.0.11:2376\r\n  └ ID: YDWS:CSP6:3RQJ:O5EP:UTA6:LMUU:HFOY:VRCH:VC5C:NHYB:WQSW:JMLH\r\n  └ Status: Healthy\r\n  └ Containers: 4 (4 Running, 0 Paused, 0 Stopped)\r\n  └ Reserved CPUs: 0 / 2\r\n  └ Reserved Memory: 0 B / 7.145 GiB\r\n  └ Labels: containerslots=4, kernelversion=4.2.0-41-generic, machinetype=A, operatingsystem=Ubuntu 15.10, provider=azure, storagedriver=aufs\r\n  └ UpdatedAt: 2016-08-18T23:36:46Z\r\n  └ ServerVersion: 1.12.0\r\n mysql1: 192.168.0.16:2376\r\n  └ ID: SPM2:2WA7:4IPG:YWSF:YCVV:HOYZ:AMCO:MWNR:EHZD:EVNL:UFSL:XPZ6\r\n  └ Status: Healthy\r\n  └ Containers: 2 (2 Running, 0 Paused, 0 Stopped)\r\n  └ Reserved CPUs: 0 / 2\r\n  └ Reserved Memory: 0 B / 7.144 GiB\r\n  └ Labels: containerslots=4, kernelversion=4.4.0-34-generic, machinerole=mysql, machinetype=A, operatingsystem=Ubuntu 16.04.1 LTS, provider=azure, storagedriver=aufs\r\n  └ UpdatedAt: 2016-08-18T23:37:17Z\r\n  └ ServerVersion: 1.12.1\r\n swarm-master2: 192.168.0.8:2376\r\n  └ ID: 7BWV:3KOJ:6HLS:HW2S:L3SH:NNYN:Q4AB:TEIJ:TVRL:RFYS:TOJQ:T7XM\r\n  └ Status: Healthy\r\n  └ Containers: 4 (4 Running, 0 Paused, 0 Stopped)\r\n  └ Reserved CPUs: 0 / 1\r\n  └ Reserved Memory: 0 B / 1.718 GiB\r\n  └ Labels: containerslots=3, kernelversion=4.2.0-41-generic, operatingsystem=Ubuntu 15.10, provider=azure, storagedriver=aufs\r\n  └ UpdatedAt: 2016-08-18T23:37:35Z\r\n  └ ServerVersion: 1.12.0\r\n ws1: 192.168.0.14:2376\r\n  └ ID: MZX7:U5AU:LWVE:I45S:DXQO:NUJQ:O4KE:EIFZ:OBZQ:TJ7Z:PNLG:COAV\r\n  └ Status: Healthy\r\n  └ Containers: 4 (0 Running, 0 Paused, 4 Stopped)\r\n  └ Reserved CPUs: 0 / 2\r\n  └ Reserved Memory: 0 B / 7.145 GiB\r\n  └ Labels: kernelversion=4.2.0-41-generic, machinerole=ws, machinetype=B, operatingsystem=Ubuntu 15.10, provider=azure, storagedriver=aufs\r\n  └ UpdatedAt: 2016-08-18T23:37:29Z\r\n  └ ServerVersion: 1.12.0\r\n ws2: 192.168.0.15:2376\r\n  └ ID: QIE5:TBKZ:4OMM:TQX4:DUHC:23SG:W2K2:6SQN:W4OG:4YE2:X6AK:Q6W4\r\n  └ Status: Healthy\r\n  └ Containers: 4 (4 Running, 0 Paused, 0 Stopped)\r\n  └ Reserved CPUs: 0 / 2\r\n  └ Reserved Memory: 0 B / 7.145 GiB\r\n  └ Labels: kernelversion=4.2.0-41-generic, machinerole=ws, machinetype=B, operatingsystem=Ubuntu 15.10, provider=azure, storagedriver=aufs\r\n  └ UpdatedAt: 2016-08-18T23:37:21Z\r\n  └ ServerVersion: 1.12.0\r\nPlugins:\r\n Volume:\r\n Network:\r\nSwarm:\r\n NodeID:\r\n Is Manager: false\r\n Node Address:\r\nSecurity Options:\r\nKernel Version: 4.2.0-41-generic\r\nOperating System: linux\r\nArchitecture: amd64\r\nCPUs: 17\r\nTotal Memory: 73.34 GiB\r\nName: d80d396d7b83\r\nDocker Root Dir:\r\nDebug Mode (client): false\r\nDebug Mode (server): false\r\nWARNING: No kernel memory limit support\r\n\r\n**Additional environment details (AWS, VirtualBox, physical, etc.):**\r\n\r\n\r\n\r\n**Steps to reproduce the issue:**\r\n1. Configure swarm cluster\r\n2. Point to the swarm master: **_eval $(docker-machine env --swarm [YOUR_SWARM_MASTER])_**\r\n3. Put some docker container parametrs into docker-compose.yml. It doesn't really matter. You can just put a basic startup of Redis in the docker-compose.yml. Configure it with: **_restart: always_**\r\n4. Run _**docker-compose up -d**_\r\n5. Run **_docker ps_**. You will see the container running.\r\n6. Run **_docker-compose ps_**. You will see the container running.\r\n7. Restart the machine where this container is running. **docker-machine restart [MACHINE_NAME]**\r\n\r\nNow comes the problem:\r\n\r\n\r\n**Describe the results you received:**\r\n\r\nWhile the machine is down. **_docker ps_** doesn't show the running container which is fine because it is indeed not running. However, when the machine is up and running after the restart, the container is started again automatically but **_docker ps_** will still not show it.\r\n\r\nThe problem is even more serious. While the machine is down **_docker-compose ps_** doesn't work because it fails to connect to the failed machine. Which is I guess another defect I should open for docker-compose. Instead of listing what it can show it just shows:\r\n\r\n**_Get https://192.168.0.14:2376/containers/8a086e626e16d95ed010faa0e8440317c739fff1ae50572d758466884823c833/json: dial tcp 192.168.0.14:2376: getsockopt: connection refused_**\r\n\r\nSo because one machine is down, **_docker-compose ps_** doesn't work at all. docker ps is working fine. \r\n\r\nHowever, when the machine restarts then **_docker ps_** doesn't show the running container and **_docker-compose ps_** does.\r\n\r\nBottom line is that in a real production system you can't trust the ps command. **_docker ps_** will always work but can show you a wrong status, **_docker-compose ps_** can just not work when one of the machines in the cluster is down.\r\n\r\n**Describe the results you expected:**\r\n\r\n1. **_docker-compose ps_** should show the running containers even if it can't connect to one of the machines. It should show what it can.\r\n\r\n2. **_docker ps_** should show the running containers after machine reboot.\r\n\r\n**Additional information you deem important (e.g. issue happens only occasionally):**\r\n\r\nIf one of them would work that would be fine. But when both of them are not working this is a problem."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/240892946","html_url":"https://github.com/docker/docker/issues/25857#issuecomment-240892946","issue_url":"https://api.github.com/repos/docker/docker/issues/25857","id":240892946,"user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"created_at":"2016-08-19T00:02:54Z","updated_at":"2016-08-19T00:02:54Z","body":"This looks like an issue with Swarm (https://github.com/docker/swarm) not Swarm _mode_ (https://docs.docker.com/engine/swarm/) which was introduced in 1.12 (yes, the naming is confusing). This issue may be better opened in the Docker Swarm issue tracker https://github.com/docker/swarm/issues"}}
{"actor":{"display_login":"thaJeztah"}}