rafecolton / docker-builder

Docker builder builds Docker images from a friendly config file.
MIT License
80 stars 11 forks source link

Running server without BasicAuth broken #134

Closed wjzijderveld closed 9 years ago

wjzijderveld commented 9 years ago

Ironically, commit Finally fixing things broke docker-builder serve when not using BasicAuth :-)

The backtrace:

vagrant@vagrant-ubuntu-trusty-64:~/.gvm/pkgsets/go1.3.1/global/src/github.com/rafecolton/docker-builder$ docker-builder serve
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x98 pc=0x594bc9]

goroutine 16 [running]:
runtime.panic(0x7bb480, 0xa38573)
    /home/vagrant/.gvm/gos/go1.3.1/src/pkg/runtime/panic.c:279 +0xf5
github.com/go-martini/martini.validateHandler(0x0, 0x0)
    /home/vagrant/.gvm/pkgsets/go1.3.1/global/src/github.com/go-martini/martini/martini.go:128 +0x49
github.com/go-martini/martini.(*route).Validate(0xc20801b270)
    /home/vagrant/.gvm/pkgsets/go1.3.1/global/src/github.com/go-martini/martini/router.go:221 +0x91
github.com/go-martini/martini.(*router).addRoute(0xc20801ac30, 0x80fb90, 0x4, 0x81f6b0, 0xd, 0xc20800f7e0, 0x2, 0x2, 0x6ef360)
    /home/vagrant/.gvm/pkgsets/go1.3.1/global/src/github.com/go-martini/martini/router.go:142 +0x4e1
github.com/go-martini/martini.(*router).Post(0xc20801ac30, 0x81f6b0, 0xd, 0xc20800f7e0, 0x2, 0x2, 0x0, 0x0)
    /home/vagrant/.gvm/pkgsets/go1.3.1/global/src/github.com/go-martini/martini/router.go:83 +0x8d
github.com/rafecolton/docker-builder/server.Serve(0xc208040210)
    /home/vagrant/.gvm/pkgsets/go1.3.1/global/src/github.com/rafecolton/docker-builder/server/server.go:63 +0x512
main.func·003(0xc208040210)
    /home/vagrant/.gvm/pkgsets/go1.3.1/global/src/github.com/rafecolton/docker-builder/main.go:142 +0x37
github.com/codegangsta/cli.Command.Run(0x819850, 0x5, 0x0, 0x0, 0x8a2a70, 0x4c, 0x8db8b0, 0x435, 0x0, 0x0, ...)
    /home/vagrant/.gvm/pkgsets/go1.3.1/global/src/github.com/codegangsta/cli/command.go:101 +0xc6f
github.com/codegangsta/cli.(*App).Run(0xc20804c0c0, 0xc20800e000, 0x2, 0x2, 0x0, 0x0)
    /home/vagrant/.gvm/pkgsets/go1.3.1/global/src/github.com/codegangsta/cli/app.go:125 +0x941
main.main()
    /home/vagrant/.gvm/pkgsets/go1.3.1/global/src/github.com/rafecolton/docker-builder/main.go:190 +0xc95

There now isn't a handler when no username/password given for BasicAuth

rafecolton commented 9 years ago

Gotta love the irony. Thanks for reporting this! Will look into it.