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

Unable to remove a directory of out the Docker root #33800

Closed
rvernica opened this Issue Jun 23, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@rvernica

rvernica commented Jun 23, 2017

Description

Due to poor default partitioning scheme, I am forced to store the Docker volumes in a different directory and add a symbolic link to it from /var/lib/docker:

> ls -l /var/lib/docker
...
rwxrwxrwx. 1 root root 13 Sep 29  2016 volumes -> /home/volumes

This works fine, except when I want to remove volumes. I get:

Error response from daemon: unable to remove volume: remove 06a9724d58196f4657e5f546dd08f62797bfef71699c5129984f09604f067812: 
Unable to remove a directory of out the Docker root /var/lib/docker: /home/volumes/06a9724d58196f4657e5f546dd08f62797bfef71699c5129984f09604f067812/_data

The workaround is to go a manually remove the /home/volumes/... directory. Then, removing the volume works.

Describe the results you expected:

I would expect Docker to be more consistent. If it can create directories and files outside the root, how come it cannot delete them.

Output of docker version:

> docker version
Client:
 Version:      17.04.0-ce-rc2
 API version:  1.28
 Go version:   go1.7.5
 Git commit:   2f35d73
 Built:        Wed Mar 29 07:43:44 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.04.0-ce-rc2
 API version:  1.28 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   2f35d73
 Built:        Wed Mar 29 07:43:44 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

> docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 70
Server Version: 17.04.0-ce-rc2
Storage Driver: devicemapper
 Pool Name: centos-dockerpool
 Pool Blocksize: 65.54kB
 Base Device Size: 10.74GB
 Backing Filesystem: xfs
 Data file: 
 Metadata file: 
 Data Space Used: 45.15GB
 Data Space Total: 214.7GB
 Data Space Available: 169.6GB
 Metadata Space Used: 53.43MB
 Metadata Space Total: 104.9MB
 Metadata Space Available: 51.43MB
 Thin Pool Minimum Free Space: 21.47GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Library Version: 1.02.135-RHEL7 (2016-11-16)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: active
 NodeID: 0bn9wp5zz6tcgd7kdwhrjoezx
 Is Manager: true
 ClusterID: f372pdcfok6r9i1se60lqp6jn
 Managers: 1
 Nodes: 3
 Orchestration:
  Task History Retention Limit: 10
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
 Node Address: 15.78.4.63
 Manager Addresses:
  15.78.4.63:2377
Runtimes: runc
Default Runtime: runc
Init Binary: 
containerd version: 422e31ce907fd9c3833a38d7b8fdd023e5a76e73
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-327.36.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 23.37GiB
Name: blu-03
ID: CBXH:UD64:UUH7:DK4P:D2AC:Y627:3EGT:OTYB:YQTC:QH5C:TZKV:Q7X7
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Http Proxy: http://...
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: bridge-nf-call-ip6tables is disabled

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

physical

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Jun 23, 2017

Contributor

Here's the offending code: https://github.com/moby/moby/blob/master/volume/local/local.go#L236
I'm not sure why it is setup like this... Have you tried a bind-mount instead of a symlink?

Probably the best option is to provide a way to configure the data root for the local volume driver.

Contributor

cpuguy83 commented Jun 23, 2017

Here's the offending code: https://github.com/moby/moby/blob/master/volume/local/local.go#L236
I'm not sure why it is setup like this... Have you tried a bind-mount instead of a symlink?

Probably the best option is to provide a way to configure the data root for the local volume driver.

@rvernica

This comment has been minimized.

Show comment
Hide comment
@rvernica

rvernica Jun 27, 2017

Bind-mount works well. Thanks.

rvernica commented Jun 27, 2017

Bind-mount works well. Thanks.

@eperov

This comment has been minimized.

Show comment
Hide comment
@eperov

eperov Jan 18, 2018

Hi,
Would you please explain how you did bind-mount to the directory?
I tried with ElasticSearch:
docker volume create --name edikvol --opt type=none --opt device=/edik --opt o=local
ES starts up, but does not work, returns an authentication error.
Thanks

eperov commented Jan 18, 2018

Hi,
Would you please explain how you did bind-mount to the directory?
I tried with ElasticSearch:
docker volume create --name edikvol --opt type=none --opt device=/edik --opt o=local
ES starts up, but does not work, returns an authentication error.
Thanks

@cpuguy83

This comment has been minimized.

Show comment
Hide comment
@cpuguy83

cpuguy83 Jan 18, 2018

Contributor

@eperov this seems like a problem with ES and not related here. Feel free to hop on the Docker community slack if you'd like help troubleshooting.

Closing anyhow since it looks like the OP has solved the issue.
Thanks!

Contributor

cpuguy83 commented Jan 18, 2018

@eperov this seems like a problem with ES and not related here. Feel free to hop on the Docker community slack if you'd like help troubleshooting.

Closing anyhow since it looks like the OP has solved the issue.
Thanks!

@cpuguy83 cpuguy83 closed this Jan 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment