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

panic: runtime error: index out of range #130

Closed
cpswan opened this issue Sep 22, 2015 · 1 comment
Closed

panic: runtime error: index out of range #130

cpswan opened this issue Sep 22, 2015 · 1 comment

Comments

@cpswan
Copy link

cpswan commented Sep 22, 2015

I'm trying to get a basic Dex system up and running by following the getting started guide.

I'm running inside an ubuntu:14.04 container that I've installed Go 1.4.2 and Postgres 9.3 into.

After some futzing with psql authentication I have a dex_db created, and I've set up the credentials into the connection string DEX_DB_URL=postgres://postgres:pa55Word@localhost/dex_db?sslmode=disable

When I start the overlord I'm seeing:

INFO: Performed 7 db migrations
INFO: Binding to 127.0.0.1:5557...
panic: runtime error: index out of range

goroutine 8 [running]:
github.com/coreos/dex/db.(*PrivateKeySetRepo).Set(0xc20801fc60, 0x7f22dbd4e048, 0xc20800bc00, 0x0, 0x0)
        /root/dex/Godeps/_workspace/src/github.com/coreos/dex/db/key.go:134 +0x607
github.com/coreos/go-oidc/key.rotatePrivateKeys(0x7f22dbd4da90, 0xc20801fc60, 0xc208095f80, 0x2, 0xecd94c15d, 0x355417cd, 0xb7a6c0, 0x0, 0x0)
        /root/dex/Godeps/_workspace/src/github.com/coreos/go-oidc/key/rotate.go:164 +0x54b
github.com/coreos/go-oidc/key.func·001()
        /root/dex/Godeps/_workspace/src/github.com/coreos/go-oidc/key/rotate.go:102 +0x1cb
github.com/coreos/go-oidc/key.func·002()
        /root/dex/Godeps/_workspace/src/github.com/coreos/go-oidc/key/rotate.go:128 +0x232
created by github.com/coreos/go-oidc/key.(*PrivateKeyRotator).Run
        /root/dex/Godeps/_workspace/src/github.com/coreos/go-oidc/key/rotate.go:133 +0x19c

goroutine 1 [chan receive]:
main.main()
        /root/dex/Godeps/_workspace/src/github.com/coreos/dex/cmd/dex-overlord/main.go:142 +0x149b

goroutine 5 [chan receive]:
database/sql.(*DB).connectionOpener(0xc2080f1400)
        /usr/local/go/src/database/sql/sql.go:589 +0x4c
created by database/sql.Open
        /usr/local/go/src/database/sql/sql.go:452 +0x31c

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

goroutine 6 [IO wait]:
net.(*pollDesc).Wait(0xc208010ae0, 0x72, 0x0, 0x0)
        /usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
net.(*pollDesc).WaitRead(0xc208010ae0, 0x0, 0x0)
        /usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
net.(*netFD).accept(0xc208010a80, 0x0, 0x7f22dbd4ad48, 0xc20802bb68)
        /usr/local/go/src/net/fd_unix.go:419 +0x40b
net.(*TCPListener).AcceptTCP(0xc208030110, 0x479aa4, 0x0, 0x0)
        /usr/local/go/src/net/tcpsock_posix.go:234 +0x4e
net/http.tcpKeepAliveListener.Accept(0xc208030110, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/http/server.go:1976 +0x4c
net/http.(*Server).Serve(0xc2080525a0, 0x7f22dbd4db98, 0xc208030110, 0x0, 0x0)
        /usr/local/go/src/net/http/server.go:1728 +0x92
net/http.(*Server).ListenAndServe(0xc2080525a0, 0x0, 0x0)
        /usr/local/go/src/net/http/server.go:1718 +0x154
main.func·001()
        /root/dex/Godeps/_workspace/src/github.com/coreos/dex/cmd/dex-overlord/main.go:138 +0x2a
created by main.main
        /root/dex/Godeps/_workspace/src/github.com/coreos/dex/cmd/dex-overlord/main.go:139 +0x1444

goroutine 7 [select]:
github.com/coreos/dex/db.func·002()
        /root/dex/Godeps/_workspace/src/github.com/coreos/dex/db/gc.go:59 +0x3db
created by github.com/coreos/dex/db.(*GarbageCollector).Run
        /root/dex/Godeps/_workspace/src/github.com/coreos/dex/db/gc.go:78 +0xfb
bcwaldon added a commit to bcwaldon/dex that referenced this issue Dec 10, 2015
Move connector configs to DB; cache OIDC connector data in DB through overlord
@ericchiang
Copy link
Contributor

Giving --key-secrets an empty list causes this panic.

$ ./bin/dex-overlord --key-secrets="" --db-url "postgres://[email protected]:32768/postgres?sslmode=disable"
INFO: Performed 8 db migrations
INFO: Binding to 127.0.0.1:5557...
panic: runtime error: index out of range

goroutine 8 [running]:
github.com/coreos/dex/db.(*PrivateKeySetRepo).Set(0xc8202d0240, 0x7fb9582d6250, 0xc8204bb7c0, 0x0, 0x0)
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/dex/db/key.go:141 +0x6d6
github.com/coreos/go-oidc/key.rotatePrivateKeys(0x7fb95935ea78, 0xc8202d0240, 0xc8204c1860, 0x2, 0xece04e704, 0x3b3671fe, 0xc43420, 0x0, 0x0)
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/go-oidc/key/rotate.go:164 +0x57f
github.com/coreos/go-oidc/key.(*PrivateKeyRotator).Run.func1()
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/go-oidc/key/rotate.go:102 +0x1bd
github.com/coreos/go-oidc/key.(*PrivateKeyRotator).Run.func2(0xc8201eb4c0, 0xc82027b2a0, 0xc8201e28a0)
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/go-oidc/key/rotate.go:128 +0x233
created by github.com/coreos/go-oidc/key.(*PrivateKeyRotator).Run
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/go-oidc/key/rotate.go:133 +0xa6

goroutine 1 [chan receive]:
main.main()
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/dex/cmd/dex-overlord/main.go:148 +0x17f3

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

goroutine 5 [chan receive]:
database/sql.(*DB).connectionOpener(0xc8201c1540)
    /usr/local/go/src/database/sql/sql.go:634 +0x45
created by database/sql.Open
    /usr/local/go/src/database/sql/sql.go:481 +0x336

goroutine 6 [IO wait]:
net.runtime_pollWait(0x7fb95935dfa8, 0x72, 0xc82000e220)
    /usr/local/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8202e2060, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8202e2060, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).accept(0xc8202e2000, 0x0, 0x7fb958312070, 0xc8202e4040)
    /usr/local/go/src/net/fd_unix.go:408 +0x27c
net.(*TCPListener).AcceptTCP(0xc8202e6000, 0xc820040dc0, 0x0, 0x0)
    /usr/local/go/src/net/tcpsock_posix.go:254 +0x4d
net/http.tcpKeepAliveListener.Accept(0xc8202e6000, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:2135 +0x41
net/http.(*Server).Serve(0xc8201e27e0, 0x7fb958312038, 0xc8202e6000, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:1887 +0xb3
net/http.(*Server).ListenAndServe(0xc8201e27e0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:1877 +0x136
main.main.func1(0xc8201e27e0)
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/dex/cmd/dex-overlord/main.go:144 +0x25
created by main.main
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/dex/cmd/dex-overlord/main.go:145 +0x179e

goroutine 7 [select]:
github.com/coreos/dex/db.(*GarbageCollector).Run.func1(0xc8202d03f0, 0xc8201e2840)
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/dex/db/gc.go:59 +0x3e8
created by github.com/coreos/dex/db.(*GarbageCollector).Run
    /home/eric/src/github.com/coreos/dex/Godeps/_workspace/src/github.com/coreos/dex/db/gc.go:78 +0x5d

@ericchiang ericchiang added this to the v0.2.1 milestone Dec 16, 2015
ericchiang added a commit to ericchiang/dex that referenced this issue Dec 17, 2015
Passing an empty list to the overlord or worker's --key-secrets
flag currently causes an out of range panic. Always check to ensure
there's at least one element passed.

Fixes dexidp#130
Fixes dexidp#217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants