Skip to content
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 volume rm fails on an unmounted volume #44

Open
trajano opened this issue Apr 3, 2018 · 7 comments
Open

docker volume rm fails on an unmounted volume #44

trajano opened this issue Apr 3, 2018 · 7 comments

Comments

@trajano
Copy link

trajano commented Apr 3, 2018

  • Plugin version (or commit ref) : v1.01
  • Docker version : 18.03
  • Plugin type : legacy
  • Operating system: Linux

Description

  1. Create the volume
  2. Create a container that uses the volume
  3. stop the container
  4. umount the glusterfs mount
  5. docker volume rm fails with error code 32 in the logs because the mount point does not exist.

The scenario happens as well when you reboot the cluster.

I think a quick fix would be to check if there is a mount before doing a umount when doing an rm

rm -f still works though

@trajano
Copy link
Author

trajano commented Apr 4, 2018

Going to try to learn how to do this myself and learn Go at the same time https://github.com/trajano/glusterfs-volume-plugin

@hcguersoy
Copy link

In my case I'm always unable to remove created volume. It doesn't care if it was used by a container or not.
Even volume rm -f doesn't work.

@trajano
Copy link
Author

trajano commented May 2, 2018

When I was building my plugin I found that this was because it was still in the backing store. Since my backing store now is boltdb and unmounting caused an error which I didn't ignore I had to remove the plugin and reinstall it.

@Muscothym
Copy link

Muscothym commented Jun 7, 2018

I am also experiencing this.

its almost as if the name the volume is stored as (StackName-serviceName) under the /var/lib/docker/plugins/be1c976936ea6cc8cfbd63affbdbaf13b52934cdf42bcdaeb41dcf8195c5cdf7/rootfs/var/lib/docker-volumes/gluster/logging_elasticsearch

but once the stack has been removed, the volumes are listed by the swarm daemon and on the hosts, but if I run docker volume rm logging_elasticsearch it says : Volume not found.

then if I relaunch the stack , I get "Volume plugin error" and have to remove and reinstall the plugin before I can deploy the stack again.

@trajano
Copy link
Author

trajano commented Jun 7, 2018

To resolve it simply ignore syscall.EINVAL

https://github.com/trajano/docker-volume-plugins/blob/master/mounted-volume/driver.go#L273-L274

that's the error that gets raised when unmounting a non-valid mount which is the scenario after a reboot.

@sapk
Copy link
Owner

sapk commented Jun 7, 2018

@Muscothym I must be that the volume was not mounted at the start. I need to take time to find a solution to report failure of mount but docker current api doesn't provide health for volume.

@trajano I don't find satisfying to ignore error (even if it is ignoring a mountpoint that doesn't exist) but it works. The best solution should be to report the failed mountpoint.

@trajano
Copy link
Author

trajano commented Jun 7, 2018

I would be curious about it too. I log the event but do not do anything about it.

One way I can think of is on start up check which mounts that are recorded in the data store are valid and remove them when they are not valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants