rancher / convoy

A Docker volume plugin, managing persistent container volumes.
Apache License 2.0
1.31k stars 135 forks source link

EBS Failed #194

Closed peebles closed 7 years ago

peebles commented 7 years ago

After creating a AWS docker-machine and installing the convoy software and launching the daemon, back on my laptop I run:

docker run --rm -it -v test_volume:/test --volume-driver=convoy ubuntu bash

which returned:

Error response from daemon: error while mounting volume '/': Post http://%2Fvar%2Frun%2Fconvoy%2Fconvoy.sock/VolumeDriver.Mount: http: ContentLength=95 with Body length 0

The convoy daemon log:

$ sudo HOME=/root convoy daemon --drivers ebs
DEBU[0000] Found existing config. Ignoring command line opts, loading config from /var/lib/rancher/convoy  pkg=daemon
DEBU[0000]                                               driver=ebs driver_opts=map[] event=init pkg=daemon reason=prepare root=/var/lib/rancher/convoy
DEBU[0000]                                               driver=ebs event=init pkg=daemon reason=complete
DEBU[0000] Registering GET, /info                        pkg=daemon
DEBU[0000] Registering GET, /volumes/list                pkg=daemon
DEBU[0000] Registering GET, /volumes/                    pkg=daemon
DEBU[0000] Registering GET, /snapshots/                  pkg=daemon
DEBU[0000] Registering GET, /backups/list                pkg=daemon
DEBU[0000] Registering GET, /backups/inspect             pkg=daemon
DEBU[0000] Registering POST, /volumes/create             pkg=daemon
DEBU[0000] Registering POST, /volumes/mount              pkg=daemon
DEBU[0000] Registering POST, /volumes/umount             pkg=daemon
DEBU[0000] Registering POST, /snapshots/create           pkg=daemon
DEBU[0000] Registering POST, /backups/create             pkg=daemon
DEBU[0000] Registering DELETE, /volumes/                 pkg=daemon
DEBU[0000] Registering DELETE, /snapshots/               pkg=daemon
DEBU[0000] Registering DELETE, /backups                  pkg=daemon
DEBU[0000] Registering plugin handler POST, /VolumeDriver.Mount  pkg=daemon
DEBU[0000] Registering plugin handler POST, /VolumeDriver.Unmount  pkg=daemon
DEBU[0000] Registering plugin handler POST, /VolumeDriver.Path  pkg=daemon
DEBU[0000] Registering plugin handler POST, /VolumeDriver.Get  pkg=daemon
DEBU[0000] Registering plugin handler POST, /VolumeDriver.List  pkg=daemon
DEBU[0000] Registering plugin handler POST, /Plugin.Activate  pkg=daemon
DEBU[0000] Registering plugin handler POST, /VolumeDriver.Create  pkg=daemon
DEBU[0000] Registering plugin handler POST, /VolumeDriver.Remove  pkg=daemon
DEBU[0026] Handle plugin get volume: POST /VolumeDriver.Get  pkg=daemon
DEBU[0026] Request from docker: &{test_volume map[]}     pkg=daemon
DEBU[0026] Response:  {
    "Err": "Could not find volume test_volume."
}  pkg=daemon
DEBU[0026] Handle plugin create volume: POST /VolumeDriver.Create  pkg=daemon
DEBU[0026] Request from docker: &{test_volume map[]}     pkg=daemon
DEBU[0026] Create a new volume test_volume for docker    pkg=daemon
DEBU[0026]                                               event=create object=volume opts=map[VolumeIOPS:0 PrepareForVM:false Size:0 BackupURL: VolumeName:test_volume VolumeDriverID: VolumeType:] pkg=daemon reason=prepare volume=test_volume
DEBU[0031] Adding tags for vol-0693ed7153eae20f5, as map[Name:test_volume]  pkg=ebs
DEBU[0031] Created volume test_volume from EBS volume vol-0693ed7153eae20f5  pkg=ebs
DEBU[0031] Attaching vol-0693ed7153eae20f5 to i-0837238424d802aae's /dev/sdn  pkg=ebs
DEBU[0037] Attached EBS volume vol-0693ed7153eae20f5 to /dev/xvdn  pkg=ebs
DEBU[0038] Created volume                                event=create object=volume pkg=daemon reason=complete volume=test_volume
DEBU[0038] Created volume for docker test_volume         pkg=daemon
DEBU[0038] Response:  {}                                 pkg=daemon
ERRO[0038] Handler not found: POST /VolumeDriver.Capabilities  pkg=daemon
DEBU[0038] Handle plugin volume path: POST /VolumeDriver.Path  pkg=daemon
DEBU[0038] Request from docker: &{test_volume map[]}     pkg=daemon
2017/02/17 20:24:53 http: panic serving @: runtime error: invalid memory address or nil pointer dereference
goroutine 26 [running]:
net/http.(*conn).serve.func1(0xc820152180)
    /usr/local/go/src/net/http/server.go:1389 +0xc1
panic(0xb3fcc0, 0xc8200160f0)
    /usr/local/go/src/runtime/panic.go:443 +0x4e9
github.com/rancher/convoy/ebs.(*Driver).GetVolumeInfo(0xc8200152c0, 0xc82046d8e0, 0xb, 0x0, 0x0, 0x0)
    /go/src/github.com/rancher/convoy/ebs/ebs.go:501 +0x898
github.com/rancher/convoy/daemon.(*daemon).getDriverForVolume(0xc820082500, 0xc82046d8e0, 0xb, 0x0, 0x0, 0x0, 0x0)
    /go/src/github.com/rancher/convoy/daemon/volume.go:515 +0x414
github.com/rancher/convoy/daemon.(*daemon).getVolume(0xc820082500, 0xc82046d8e0, 0xb, 0x0)
    /go/src/github.com/rancher/convoy/daemon/volume.go:27 +0x3f
github.com/rancher/convoy/daemon.(*daemon).getDockerVolume(0xc820082500, 0xc820388b60, 0x20, 0xc8200f99d8, 0x0, 0x0)
    /go/src/github.com/rancher/convoy/daemon/docker.go:96 +0x97
github.com/rancher/convoy/daemon.(*daemon).dockerVolumePath(0xc820082500, 0x7f9900c3c278, 0xc8201629c0, 0xc820388b60)
    /go/src/github.com/rancher/convoy/daemon/docker.go:238 +0x1ae
github.com/rancher/convoy/daemon.(*daemon).(github.com/rancher/convoy/daemon.dockerVolumePath)-fm(0x7f9900c3c278, 0xc8201629c0, 0xc820388b60)
    /go/src/github.com/rancher/convoy/daemon/daemon.go:105 +0x3e
net/http.HandlerFunc.ServeHTTP(0xc8201afe30, 0x7f9900c3c278, 0xc8201629c0, 0xc820388b60)
    /usr/local/go/src/net/http/server.go:1618 +0x3a
github.com/rancher/convoy/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc820015360, 0x7f9900c3c278, 0xc8201629c0, 0xc820388b60)
    /go/src/github.com/rancher/convoy/vendor/github.com/gorilla/mux/mux.go:98 +0x29e
net/http.serverHandler.ServeHTTP(0xc8201bad80, 0x7f9900c3c278, 0xc8201629c0, 0xc820388b60)
    /usr/local/go/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc820152180)
    /usr/local/go/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2137 +0x44e
DEBU[0058] Handle plugin mount volume: POST /VolumeDriver.Mount  pkg=daemon
DEBU[0058] Request from docker: &{test_volume map[]}     pkg=daemon
2017/02/17 20:25:14 http: panic serving @: runtime error: invalid memory address or nil pointer dereference
goroutine 40 [running]:
net/http.(*conn).serve.func1(0xc820153480)
    /usr/local/go/src/net/http/server.go:1389 +0xc1
panic(0xb3fcc0, 0xc8200160f0)
    /usr/local/go/src/runtime/panic.go:443 +0x4e9
github.com/rancher/convoy/ebs.(*Driver).GetVolumeInfo(0xc8200152c0, 0xc8204518e0, 0xb, 0x0, 0x0, 0x0)
    /go/src/github.com/rancher/convoy/ebs/ebs.go:501 +0x898
github.com/rancher/convoy/daemon.(*daemon).getDriverForVolume(0xc820082500, 0xc8204518e0, 0xb, 0x0, 0x0, 0x0, 0x0)
    /go/src/github.com/rancher/convoy/daemon/volume.go:515 +0x414
github.com/rancher/convoy/daemon.(*daemon).getVolume(0xc820082500, 0xc8204518e0, 0xb, 0x0)
    /go/src/github.com/rancher/convoy/daemon/volume.go:27 +0x3f
github.com/rancher/convoy/daemon.(*daemon).getDockerVolume(0xc820082500, 0xc820389180, 0x21, 0xc8200479c0, 0x0, 0x0)
    /go/src/github.com/rancher/convoy/daemon/docker.go:96 +0x97
github.com/rancher/convoy/daemon.(*daemon).dockerMountVolume(0xc820082500, 0x7f9900c3c278, 0xc820163040, 0xc820389180)
    /go/src/github.com/rancher/convoy/daemon/docker.go:179 +0x1c2
github.com/rancher/convoy/daemon.(*daemon).(github.com/rancher/convoy/daemon.dockerMountVolume)-fm(0x7f9900c3c278, 0xc820163040, 0xc820389180)
    /go/src/github.com/rancher/convoy/daemon/daemon.go:103 +0x3e
net/http.HandlerFunc.ServeHTTP(0xc8201afe10, 0x7f9900c3c278, 0xc820163040, 0xc820389180)
    /usr/local/go/src/net/http/server.go:1618 +0x3a
github.com/rancher/convoy/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc820015360, 0x7f9900c3c278, 0xc820163040, 0xc820389180)
    /go/src/github.com/rancher/convoy/vendor/github.com/gorilla/mux/mux.go:98 +0x29e
net/http.serverHandler.ServeHTTP(0xc8201bad80, 0x7f9900c3c278, 0xc820163040, 0xc820389180)
    /usr/local/go/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc820153480)
    /usr/local/go/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2137 +0x44e

Please advise. I'll provide any other information you may need. Here is what I did to install the daemon:

   wget https://github.com/rancher/convoy/releases/download/v0.5.0/convoy.tar.gz
   tar xvzf convoy.tar.gz
   sudo cp convoy/convoy convoy/convoy-pdata_tools /usr/local/bin/
   sudo mkdir -p /etc/docker/plugins/
   sudo bash -c 'echo "unix:///var/run/convoy/convoy.sock" > /etc/docker/plugins/convoy.spec'
peebles commented 7 years ago

EBS driver is now working for me, at least from the master branch. v0.5.0 may have a problem.