blocker icon indicating copy to clipboard operation
blocker copied to clipboard

'Name not found' while trying to mount a volume

Open mvanholsteijn opened this issue 8 years ago • 5 comments

I am trying to load a volume, but blocker gives the error 'Name not found'.

2016/06/11 20:52:25 * /VolumeDriver.Path
2016/06/11 20:52:25     done: (vol-38386f82): (, Name not found.)
2016/06/11 20:52:25 * /VolumeDriver.Mount
2016/06/11 20:52:25     done: (vol-38386f82): (, Name not found.)
2016/06/11 20:52:25 * /VolumeDriver.Unmount
2016/06/11 20:52:25     done: (vol-38386f82): Name not found.

The volume is definitely there as it does list with

 aws ec2 describe-volumes --volume-ids vol-38386f82

I am running in eu-central-1.

mvanholsteijn avatar Jun 11 '16 20:06 mvanholsteijn

It could be that docker and blocker volume list is out of sync.

Modern docker versions do not call VolumeDriver.Create every time its mounted, thus ebs_driver.go#L71 not being populated.

It may happen because of blocker restart without removing the volumes first.

To workaround you can remove the volume manualy with

docker volume rm ...

or try a fork of mine which is completely stateless. I'm still not sure about merging it here, and if its the correct way to fix the issue. fyi #f94aca0

monder avatar Jun 11 '16 21:06 monder

I found out that Docker 1.9 does not call Volume.Create on blocker.

When I add it using curl, the volume is attached and mounted.

curl --unix-socket /var/run/blocker.sock http://localhost/VolumeDriver.Create -d '{ "Name": "vol-38386f82" }'

@monder I like your stateless implementation :-)

mvanholsteijn avatar Jun 11 '16 22:06 mvanholsteijn

(I guess I had notifications turned off for this repo .. whoops.)

I prefer the stateless implementation too. Happy to merge if you submit a PR.

joeduffy avatar Jul 21 '16 23:07 joeduffy

Hey. I dont think that it would be possible to keep it stateless. Especially with https://github.com/joeduffy/blocker/commit/ca190d917647f57c0a2a4c906dab6b8f8cb09fba and support of #5 since the driver api gives us only the name of the volume. We need to think of some kind of way for storing the state between daemon restarts.

monder avatar Jul 29 '16 06:07 monder

Strange, I've been running a stateless fork with volume create for a while now. Just use volume labels and EC2 calls to keep track of state.

zbyte64 avatar Aug 11 '16 23:08 zbyte64