-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
docker kill leaves directories behind. #197
Comments
Just an extra comment: it is normal for 'docker kill' to leave the container directory. By default all containers are stored, so you can inspect their filesystem state, commit them into images, restart them etc. But of course it is not normal to see "stale NFS handle" errors :) |
I can't reproduce. My host is ubuntu12.10 and I used the base as guest. |
Is there a way to manually repair the directory so I can delete the directories without rebooting the host? |
Not that I know of. Note that there is no known side-effect outside the On Monday, April 15, 2013, Thomas Hansen wrote:
|
As discussed earlier, this is probably due to the asynchronous nature of aufs unmount. I'm downgrading this to minor bug, since: a) it occurs very rarely (1 known occurrence so far) |
+1 on a fix for this since i just bumped into it:
|
@simonjohansson Since #816, did you get the error? |
ping @simonjohansson |
Hi guys, sorry I didn't see this until now. I have some holiday coming up in the next couple of days, Ill make sure to see if #816 fixed the issue! |
Just encountered the same issue:
|
I cannot reproduce anymore.
GG :) |
@dscape can you try again with docker 0.5.1? |
I keep seeing this issue over and over using docker inside VirtualBox. I usually run docker rm $(docker ps -a |cut -d " " -f 1) to remove all containers but many of them fail with stale NFS file handle. |
Just to add, I tried some brutal force removing the directories of such containers. After that, trying to remove them via docker rm still prints the same message. Managed to remove after restarting docker host. |
This seems fixed to me.
Also make sure you have no bash running inside the container path. |
Was the asynchronous unmount theory ever proven? I wonder if this is the "deleted a container's image while the container is running" bug:
|
@dsissitka i think that is exactly what it is. happened with me.
how can the container be removed now? |
The original issue is resolved in 0.7 because kill does not do an umount anymore. Containers are unmounted when the daemon is stopped. |
In case anyone has a #!/usr/bin/python
import json
import os
import shutil
import subprocess
import re
dockerdir = '/var/lib/docker'
volumesdir = os.path.join(dockerdir, 'volumes')
containers = dict((line, 1) for line in subprocess.check_output('docker ps -a -q -notrunc', shell=True).splitlines())
volumes = os.walk(os.path.join(volumesdir, '.')).next()[1]
for volume in volumes:
if not re.match('[0-9a-f]{64}', volume):
print volume + ' is not a valid volume identifier, skipping...'
continue
volume_metadata = json.load(open(os.path.join(volumesdir, volume, 'json')))
container_id = volume_metadata['container']
if container_id in containers:
print 'Container ' + container_id[:12] + ' does still exist, not clearing up volume ' + volume
continue
print 'Deleting volume ' + volume + ' (container: ' + container_id[:12] + ')'
volumepath = os.path.join(volumesdir, volume)
print 'Volumepath: ' + volumepath
shutil.rmtree(volumepath) |
thanks for the script! I fixed the indentation and a small bug:
|
Thanks! No idea why the indentation was messed up in my post, edited + fixed it. I used |
Doing a docker kill UUID have left some directories behind in /var/lib/docker/containers
Doing a ls reveals
I am running docker inside a rather slow virtualbox-vm (Ubuntu 12.04, 3.5.0-23-generic). I have right now 7 of these directories, two of them comes from containers where I have made big changes(apt-get update), the other five have only been "echo hello world"-containers.
Relevant IRC-chat
The text was updated successfully, but these errors were encountered: