Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Unable to use volume provided by vieux/sshfs #21

Closed
chrsch opened this issue May 28, 2017 · 6 comments
Closed

Unable to use volume provided by vieux/sshfs #21

chrsch opened this issue May 28, 2017 · 6 comments

Comments

@chrsch
Copy link

chrsch commented May 28, 2017

Goal: Assign sshfs based volume to a docker container.
Note 1: sshfs is accessible as tested with other sftp client
Note 2: The problem is related to the password: If it contains specific chars e. g. } )

Step 1: Install plugin
docker plugin install vieux/sshfs

Step 2: Create volume
docker volume create -d vieux/sshfs --name sshfs -o sshcmd=user-id@sftp.somehost.com:/some/path/ -o password=xxx

Step 3: Check if volume is mounted and can be used
docker run --rm -v sshfs:/data busybox ls /data

Expected result:
List of directories and files from '/some/path/'

Received result:

docker: Error response from daemon: error while mounting volume '/mnt/sda1/var/lib/docker/plugins/49b619c1775bf25bc55b481477ea744a3a080c3f7fd66fcce28f6596c4dbe7ae/rootfs/mnt/volumes/426d940205d7b244b5baa035db7f7686': VolumeDriver.Mount: exit status 2.
ERRO[0000] error getting events from daemon: net/http: request canceled 

Additional infos:
docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Tue Mar 28 00:40:02 2017
OS/Arch: darwin/amd64
Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 21:43:09 2017
OS/Arch: linux/amd64
Experimental: true

docker plugin inspect vieux/sshfs:latest

[
    {
        "Config": {
            "Args": {
                "Description": "",
                "Name": "",
                "Settable": null,
                "Value": null
            },
            "Description": "sshFS plugin for Docker",
            "Documentation": "https://docs.docker.com/engine/extend/plugins/",
            "Entrypoint": [
                "/docker-volume-sshfs"
            ],
            "Env": [
                {
                    "Description": "",
                    "Name": "DEBUG",
                    "Settable": [
                        "value"
                    ],
                    "Value": "0"
                }
            ],
            "Interface": {
                "Socket": "sshfs.sock",
                "Types": [
                    "docker.volumedriver/1.0"
                ]
            },
            "IpcHost": false,
            "Linux": {
                "AllowAllDevices": false,
                "Capabilities": [
                    "CAP_SYS_ADMIN"
                ],
                "Devices": [
                    {
                        "Description": "",
                        "Name": "",
                        "Path": "/dev/fuse",
                        "Settable": null
                    }
                ]
            },
            "Mounts": [
                {
                    "Description": "",
                    "Destination": "/mnt/state",
                    "Name": "",
                    "Options": [
                        "rbind"
                    ],
                    "Settable": null,
                    "Source": "/var/lib/docker/plugins/",
                    "Type": "bind"
                }
            ],
            "Network": {
                "Type": "host"
            },
            "PidHost": false,
            "PropagatedMount": "/mnt/volumes",
            "User": {},
            "WorkDir": "",
            "rootfs": {
                "diff_ids": [
                    "sha256:ff9d914aa86856c5e9d7288c8d34031b0c89a4e02ac85ca86850fd699edddf25"
                ],
                "type": "layers"
            }
        },
        "Enabled": true,
        "Id": "49b619c1775bf25bc55b481477ea744a3a080c3f7fd66fcce28f6596c4dbe7ae",
        "Name": "vieux/sshfs:latest",
        "PluginReference": "docker.io/vieux/sshfs:latest",
        "Settings": {
            "Args": [],
            "Devices": [
                {
                    "Description": "",
                    "Name": "",
                    "Path": "/dev/fuse",
                    "Settable": null
                }
            ],
            "Env": [
                "DEBUG=0"
            ],
            "Mounts": [
                {
                    "Description": "",
                    "Destination": "/mnt/state",
                    "Name": "",
                    "Options": [
                        "rbind"
                    ],
                    "Settable": null,
                    "Source": "/var/lib/docker/plugins/",
                    "Type": "bind"
                }
            ]
        }
    }
]
@vieux
Copy link
Owner

vieux commented Aug 14, 2017

@chrsch can you try with vieux/sshfs:next ? I believe @tiborvass fixed this issue already.

Thanks.

@chrsch
Copy link
Author

chrsch commented Aug 15, 2017

@vieux Yes it is fixed the way @tiborvass modified it. Thanks.

@chrsch chrsch closed this as completed Aug 15, 2017
@paniabhisek
Copy link

I'm getting the error even if I use vieux/sshfs:next:

Error response from daemon: error while mounting volume '/mnt/volumes/a9308e0c6ba90e1e44c4d39ba66998a5': VolumeDriver.Mount: exit status 1%!(EXTRA []interface {}=[])

$ docker volume inspect sshvolume

[
{
"Driver": "vieux/sshfs:next",
"Labels": {},
"Mountpoint": "/mnt/volumes/a9308e0c6ba90e1e44c4d39ba66998a5",
"Name": "sshvolume",
"Options": {
"allow_other": "yes",
"password": "xxxx",
"sshcmd": "admin@10.87.74.162:/home/admin"
},
"Scope": "local"
}
]

Commands I used:

docker volume create -d vieux/sshfs:next -o sshcmd=admin@10.87.74.162:/home/admin -o password=xxxx -o allow_other=yes sshvolume

docker run -it -v sshvolume:/app ubuntu:16.10 /bin/bash

@vieux
Copy link
Owner

vieux commented May 2, 2018

@Abhisek- hi, I just removed the next tag, it's quite old, do you have the same error with vieux/sshfs:latest ? if so, can you please enable debug and retry ?

@paniabhisek
Copy link

@vieux hi, for vieux/sshfs:latest, yesterday I was getting the same error. but luckily today I'm getting different error :)

Commands I've executed:

docker plugin install vieux/sshfs:latest DEBUG=1
docker volume create -d vieux/sshfs -o sshcmd=admin@10.74.30.156:/pt sshvolume
docker run -it --privileged -v sshvolume:/pt --name ssh-new1 ad13c28ad7a8 /bin/bash

For the above I'm getting

C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: VolumeDriver.Mount: sshfs command execute failed: exit status 1 (read: Connection reset by peer).
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

But If I execute without using the volume and run sshfs within container it works fine:

docker run -it --privileged --name ssh-new1 ad13c28ad7a8 /bin/bash
sshfs -o allow_other admin@10.74.30.156:/pt /pt

I've also tried

docker volume create -d vieux/sshfs -o allow_other -o sshcmd=admin@10.74.30.156:/pt sshvolume

but no luck till now

@paniabhisek
Copy link

If I do docker run -it -v sshvolume:/pt --name ssh-new ssh-new /bin/bash without --privileged, I get

C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: error while mounting volume '/mnt/sda1/var/lib/docker/plugins/646e80e39e7f1505
a987e47da45330d8d1b55576ed71a340cec3d58a0025dd7f/rootfs': VolumeDriver.Mount: sshfs command execute failed: exit stattiism 1 (rr"e20dd8:- 0C5o-03nTT11
44::477:oo1++0  :330" llevvel  errroor mpesegrr"er))or
wC:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: error while mounting volume '/mnt/sda1/var/lib/docker/plugins/646e80e39e7f150
5a987e47da45330d8d1b55576ed71a340cec3d58a0025dd7f/rootfs': VolumeDriver.Mount: sshfs command execute failed: exit stattiism 1 (rr"e20dd8:- 0C5o-03nTT1
144::477:oo1++0  :330" llevvel  errroor mpesegrr"er))or
waiting for container: context canceled"

Any idea ?

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

No branches or pull requests

3 participants