Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message about packaging problem of docker-machine-driver tarball #4486

Closed
jmatsushita opened this issue Apr 20, 2016 · 8 comments
Assignees
Labels
area/machine Issues that deal with rancher-machine kind/bug Issues that are defects reported by users or that we know have reached a real release

Comments

@jmatsushita
Copy link

Rancher Version:
1.0.1

Docker Version:

OS:

Steps to Reproduce:
Install docker machine driver:

Results:

The driver doesn't install and the UI keeps displaying "Request..."

Logs display:

panic: runtime error: index out of range

goroutine 38 [running]:
github.com/rancher/go-machine-service/dynamicDrivers.extractDriver(0xc8203ef170, 0x2f, 0x0, 0x0, 0x0, 0x0)
    /source/gopath/src/github.com/rancher/go-machine-service/dynamicDrivers/downloads.go:467 +0xbf6
github.com/rancher/go-machine-service/dynamicDrivers.downloadVerifyExtractDriver(0xc82012a2a0, 0x70, 0x0, 0x0, 0xc82041b8a0, 0x8, 0x0, 0x0)
    /source/gopath/src/github.com/rancher/go-machine-service/dynamicDrivers/downloads.go:168 +0x52d
github.com/rancher/go-machine-service/dynamicDrivers.installDriver(0xc82012a2a0, 0x70, 0x0, 0x0, 0xc82041b8a0, 0x8, 0x0, 0x0)
    /source/gopath/src/github.com/rancher/go-machine-service/dynamicDrivers/downloads.go:400 +0x83
github.com/rancher/go-machine-service/dynamicDrivers.downloadMachineDriver(0xc82041b710, 0x5, 0xc82041b720, 0xd, 0xc8203c0b70, 0xc8203c0bd0, 0xc82041b8d0, 0x4, 0xc8204a0be0, 0x14, ...)
    /source/gopath/src/github.com/rancher/go-machine-service/dynamicDrivers/downloads.go:501 +0xd03
created by github.com/rancher/go-machine-service/dynamicDrivers.downloadDrivers
    /source/gopath/src/github.com/rancher/go-machine-service/dynamicDrivers/downloads.go:199 +0x635

goroutine 1 [runnable]:
sync.runtime_Semacquire(0xc82040232c)
    /usr/local/go/src/runtime/sema.go:43 +0x26
sync.(*WaitGroup).Wait(0xc820402320)
    /usr/local/go/src/sync/waitgroup.go:126 +0xb4
github.com/rancher/go-machine-service/dynamicDrivers.downloadDrivers(0xc8200f2800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /source/gopath/src/github.com/rancher/go-machine-service/dynamicDrivers/downloads.go:202 +0x670
github.com/rancher/go-machine-service/dynamicDrivers.UpdateDrivers(0x0, 0x0, 0x0)
    /source/gopath/src/github.com/rancher/go-machine-service/dynamicDrivers/downloads.go:55 +0x4ca
main.main()
    /source/main.go:25 +0x235

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 6 [syscall]:
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
    /usr/local/go/src/os/signal/signal_unix.go:28 +0x37

goroutine 7 [chan receive]:
github.com/rancher/go-machine-service/locks.locker()
    /source/gopath/src/github.com/rancher/go-machine-service/locks/locks.go:61 +0xda
created by github.com/rancher/go-machine-service/locks.init.1
    /source/gopath/src/github.com/rancher/go-machine-service/locks/locks.go:7 +0x59

goroutine 15 [IO wait]:
net.runtime_pollWait(0x7f50976a3dc0, 0x72, 0xc82000a140)
    /usr/local/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8200fd4f0, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8200fd4f0, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8200fd490, 0xc820119000, 0x1000, 0x1000, 0x0, 0x7f509769b050, 0xc82000a140)
    /usr/local/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc82002a548, 0xc820119000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:172 +0xe4
net/http.noteEOFReader.Read(0x7f50976a4080, 0xc82002a548, 0xc8200c3658, 0xc820119000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8200fb2e0, 0xc820119000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc820013680)
    /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc820013680, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8200c3600)
    /usr/local/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:685 +0xc78

goroutine 16 [select]:
net/http.(*persistConn).writeLoop(0xc8200c3600)
    /usr/local/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:686 +0xc9d

goroutine 22 [select]:
net/http.(*persistConn).writeLoop(0xc82047d130)
    /usr/local/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:686 +0xc9d

goroutine 21 [IO wait]:
net.runtime_pollWait(0x7f50976a3d00, 0x72, 0xc82000a140)
    /usr/local/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc820056530, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820056530, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8200564d0, 0xc8200b0000, 0x800, 0x800, 0x0, 0x7f509769b050, 0xc82000a140)
    /usr/local/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc82002a028, 0xc8200b0000, 0x800, 0x800, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc8203c1830, 0x7f50976a4080, 0xc82002a028, 0x5, 0x0, 0x0)
    /usr/local/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc820438dc0, 0xbd8917, 0x0, 0x0)
    /usr/local/go/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc820438dc0, 0xc820118000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x7f5095664c00, 0xc820438dc0, 0xc82047d188, 0xc820118000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8203b0bc0, 0xc820118000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc82041e8a0)
    /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc82041e8a0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc82047d130)
    /usr/local/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:685 +0xc78

goroutine 48 [IO wait]:
net.runtime_pollWait(0x7f50976a3c40, 0x72, 0xc82000a140)
    /usr/local/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8200fd720, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8200fd720, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8200fd6c0, 0xc8205b0000, 0x8000, 0x8000, 0x0, 0x7f509769b050, 0xc82000a140)
    /usr/local/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc82025a040, 0xc8205b0000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc8203844b0, 0x7f50976a4080, 0xc82025a040, 0x5, 0x0, 0x0)
    /usr/local/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc820438840, 0xbd8917, 0x0, 0x0)
    /usr/local/go/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc820438840, 0xc82058f000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x7f5095664c00, 0xc820438840, 0xc8204da058, 0xc82058f000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc820390040, 0xc82058f000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc820496d80)
    /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc820496d80, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8204da000)
    /usr/local/go/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:685 +0xc78

goroutine 49 [select]:
net/http.(*persistConn).writeLoop(0xc8204da000)
    /usr/local/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:686 +0xc9d

Expected:

@moul
Copy link

moul commented Apr 20, 2016

I think this is due to a bad binary naming, I will regenerate all the binaries

@jmatsushita
Copy link
Author

I have tried but I get the same error unfortunately. Also tried to rename with only middle dashes but it doesn't work either.

@jmatsushita
Copy link
Author

Taring with only the go static binary at the root (no folder) did the trick! Keeping this issue opened and renaming to focus on catching the error and displaying it to the end user.

@jmatsushita jmatsushita changed the title docker machine driver installation fails with "panic: runtime error: index out of range " Improve error message about packaging problem of docker-machine-driver tarball Apr 20, 2016
@cjellick
Copy link

@jmatsushita can you outline what you did to work around it exactly?

Can you give the original file structure inside the tar that caused the problem?

Definitely something we should handle more gracefully on our end.
In working around,

@jmatsushita
Copy link
Author

The original file structure is inside this tarball https://github.com/scaleway/docker-machine-driver-scaleway/releases/download/v1.0.2/docker-machine-driver-scaleway_1.0.2_linux_amd64.tar.gz which has a docker-machine-driver-scaleway folder inside and the binary in there. When removing the folder and moving the binary to the root then it works.

@cjellick
Copy link

ok. thanks for reporting. we'll get it fixed. I think the intended behavior right now is to log/reply with a sensible error message saying that the tar should just contain the binary, but the logic is flawed and it is instead panicing.

@deniseschannon deniseschannon added the kind/bug Issues that are defects reported by users or that we know have reached a real release label Apr 22, 2016
@deniseschannon deniseschannon added this to the Release 1.1.0-dev1 milestone Apr 22, 2016
@deniseschannon deniseschannon added the area/machine Issues that deal with rancher-machine label Apr 22, 2016
@will-chan will-chan modified the milestones: Release 1.1, Release 1.1.0-dev2 May 19, 2016
@deniseschannon deniseschannon modified the milestones: Release 1.1.0-dev2, Release 1.1 May 23, 2016
@deniseschannon deniseschannon self-assigned this May 23, 2016
@deniseschannon
Copy link

Verified with v1.1.0-dev2-rc4 that there is no longer a panic with invalid URL. Intstead there is an error Failed to extract

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/machine Issues that deal with rancher-machine kind/bug Issues that are defects reported by users or that we know have reached a real release
Projects
None yet
Development

No branches or pull requests

5 participants