fentas/docker-volume-davfs

Container Boot Faild - logs : VolumeDriver.Mount: exit status 1%!(EXTRA []interface {}=[])

Opened this issue · 5 comments

docker container boof faild caused by docker-volume-davfs bug, there are the logs:

Failure error while mounting volume Failure error while mounting volume '/var/lib/docker/plugins/66235d61a6c4b16d936c6c2369e343665e65b90fc83cabc9770c3525483c5632/rootfs': VolumeDriver.Mount: exit status 1%!(EXTRA []interface {}=[])

I got this problem after I rebooted my vps. To reproduce the bug, I've tried several times on different vps. It reproduced randomly.

To figure out this bug I attached inside of the plugin rootfs sh by "Debugging plugins"

I read the main.go and simulated the action of mount function by shell

mount.davfs http://x.x.x.x:xx/xx /mnt/volumes/223bce26d5145548e9980f5738087c80 -o uid=1000 -o gid=1000

and got those msg:

found PID file /var/run/mount.davfs/mnt-volumes-223bce26d5145548e9980f5738087c80.pid.
Either /mnt/volumes/223bce26d5145548e9980f5738087c80 is used by another process,
or another mount process ended irregular

As so far, the bug is clear. And there're two enhanced features can be discussed:

  1. The different (name) webdav volumes with the same url cannot be support by now due to the same davfs pid name confliction . Could we do some works to support?
  2. The davfs pid file conflicted probabilistically after the physical machines of docker rebooted .

Thanks for your great jobs !

nice job 👍
Hm do you think pid consists from the davfs url? I would say it reflects the docker volume id, so a problem could be a multi mount of the same volume (would guess volumes - pids - are also mounted for stopped container ~ would explain that it consists after reboot).

We have to look into this. 👀

I thought this project is no longer maintained, so I forked and modified the code a few hours before. ^_^
The major changes :
line:324
cmd_full := exec.Command(fmt.Sprintf("kill -0 $(cat %s) > /dev/null 2>&1;if [ $? -ne 0 ];then rm %s -f && %s;fi", pidFile, pidFile, mountCmd))
https://github.com/Loongel/docker-volume-davfs/blob/master/main.go

Just sideproject. : )
Hm you just kill pid (webdav mount) mounted or not and then remount.
Maybe better way would be to check if mounted and if so just let it be or mount if it is not there?

Yes. The code kill -0 is a simple and crude method for checking mounted.

I've got hit by this error after a system upgrade and a necessary reboot.
Now it is not possible anymore to have two docker volumes with the same webdav server, but two different subdirectories, to be used by one container.
How do I solve this?