You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Running docker system prune --force on a worker node is removing resources of swarm services in the state of "Created", which then prevents the service from start properly. The service will be recreated anyway.
The 60s delay is just for demo purposes. In our environment we had delay of 24 hour in order to rerun a service every 24h. so if then a docker system prune --force would be issued on a daily base as well this service never will be started properly.
deploy stack: docker stack deploy --compose-file docker-compose test
check on worker node if service is created docker ps -a
088764be4063 alpine:3.9 "ash -c 'echo \"start…" 13 seconds ago Created test_test1.1.dc3ykvthbuvaa03jiypen18a9
running docker system prune --force on the worker node while the service is in "Created" state
Describe the results you received: docker service logs test_test1 --follow
# service is not starting because of lack of resources
Describe the results you expected: docker service logs test_test1 --follow
test_test1.1.vriry1pw67wc@worker-01 | start test1: Thu Feb 14 08:48:46 UTC 2019
test_test1.1.vriry1pw67wc@worker-01 | end test1: Thu Feb 14 08:49:06 UTC 2019
test_test1.1.cx795i38pc5d@worker-01 | start test1: Thu Feb 14 08:50:07 UTC 2019
test_test1.1.cx795i38pc5d@worker-01 | end test1: Thu Feb 14 08:50:27 UTC 2019
test_test1.1.uyfdrkdkm0q3@worker-01 | start test1: Thu Feb 14 08:51:29 UTC 2019
test_test1.1.uyfdrkdkm0q3@worker-01 | end test1: Thu Feb 14 08:51:49 UTC 2019
test_test1.1.tzrkcl3qawdf@worker-01 | start test1: Thu Feb 14 08:52:50 UTC 2019
test_test1.1.tzrkcl3qawdf@worker-01 | end test1: Thu Feb 14 08:53:10 UTC 2019
test_test1.1.czae6d3lbyqf@worker-01 | start test1: Thu Feb 14 08:54:11 UTC 2019
test_test1.1.czae6d3lbyqf@worker-01 | end test1: Thu Feb 14 08:54:31 UTC 2019
test_test1.1.6g0ltlwn86aj@worker-01 | start test1: Thu Feb 14 08:55:33 UTC 2019
Additional information you deem important (e.g. issue happens only occasionally):
Reproducible
Output of docker version:
Client:
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:35:23 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 03:42:13 2019
OS/Arch: linux/amd64
Experimental: false
@yorap I know we talked about this before, so a few new and old thoughts:
prune is likely not swarm-aware, so it won't know about resources that are "not being used but may soon be used". This would include containers that are created but not running.
I thought you were doing docker image prune --all --force, which is what I currently recommend, It will clean up the big "space offender" but only remove images with no containers (stopped or started) depending on it.
system prune is more likely to cause issues because stopped containers could get removed, along with their images. Swarm also keeps 4 containers for each task around after they have stopped and system prune would likely break that too.
Note that docker stack rm doesn't remove named volumes, but people usually don't want those auto-pruned for safety.
Can you replicate if you use docker image prune --all --force instead?
Description
Running
docker system prune --force
on a worker node is removing resources of swarm services in the state of "Created", which then prevents the service from start properly. The service will be recreated anyway.The 60s delay is just for demo purposes. In our environment we had delay of 24 hour in order to rerun a service every 24h. so if then a
docker system prune --force
would be issued on a daily base as well this service never will be started properly.Bret, fyi: @BretFisher
Steps to reproduce the issue:
docker stack deploy --compose-file docker-compose test
docker ps -a
docker system prune --force
on the worker node while the service is in "Created" stateDescribe the results you received:
docker service logs test_test1 --follow
Describe the results you expected:
docker service logs test_test1 --follow
Additional information you deem important (e.g. issue happens only occasionally):
Reproducible
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Running on VMware vSpheres
The text was updated successfully, but these errors were encountered: