Report this

What is the reason for this report?

docker sshfs plugin issue

Posted on September 22, 2019

Hello. I have 2 servers, running on Centos 7.7 and docker 19.03 CE. I tried to use sshfs volumes, but something goes wrong.
I successfully creates volume with this command:[lanadmin@mordred ~]$ docker volume create --driver vieux/sshfs -o sshcmd=lanadmin@10.220.127.247:/home/test -o password=mypass sshvolume

But when i tries to use this volume in container i have an error like this:

[lanadmin@mordred ~]$ docker run -it -v sshvolume:/etc busybox ls /etc
docker: Error response from daemon: failed to copy file info for /var/lib/docker/plugins/518a1874166cf493dd0700d9efec1c3e2d7649cb4a560d44a2af1a6aa16f0526/propagated-mount/5cd59d97ef5e801349f7c06a8f2c113d: failed to chown /var/lib/docker/plugins/518a1874166cf493dd0700d9efec1c3e2d7649cb4a560d44a2af1a6aa16f0526/propagated-mount/5cd59d97ef5e801349f7c06a8f2c113d: lchown /var/lib/docker/plugins/518a1874166cf493dd0700d9efec1c3e2d7649cb4a560d44a2af1a6aa16f0526/propagated-mount/5cd59d97ef5e801349f7c06a8f2c113d: permission denied. See 'docker run --help'.

Also if i tries to use empty directory everything work fine.

And the most funny thing is when i put some file in /home/test there is no error with coping files when container runs and i have this files in /home/test:

lanadmin@ganimed ~]$ ls -lah /home/test/ 
итого 8,0K 
drwxrwxrwx. 2 lanadmin lanadmin 4,0K сен 21 23:15 . 
drwxr-xr-x. 5 root root 4,0K сен 21 18:48 .. 
-rwxr-xr-x. 1 lanadmin lanadmin 0 сен 21 23:15 hostname 
-rwxr-xr-x. 1 lanadmin lanadmin 0 сен 21 23:15 hosts 
-rw-rw-r--. 1 lanadmin lanadmin 0 сен 21 23:14 notest.file 
-rwxr-xr-x. 1 lanadmin lanadmin 0 сен 21 23:15 resolv.conf

Can anyone help me with that?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

It looks like a permissions issue, have you tried mounting a different folder besides /etc like /tmp for example?

I’ve tried recreating the setup at my end and it worked as expected with when using root:

[root@docker-test ~]# docker run -it -v sshvolume_test2:/etc busybox ls /etc
group        hosts        mtab         passwd       shadow
hostname     localtime    network      resolv.conf
[root@docker-question ~]# 

Regards, Bobby

Heya,

You can try adding no_root_squash to your /etc/exports file.

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.