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

A frontend route without a rule (or empty rule) causes a crash when traefik starts #453

Closed
marccampbell opened this issue Jun 12, 2016 · 1 comment · Fixed by #477
Closed
Labels
Milestone

Comments

@marccampbell
Copy link

I have the following keys in my consul store:

/traefik/backends/app/servers/server1/url
/traefik/backends/app/servers/server1/weight

/traefik/frontends/app/backend
/traefik/frontends/app/entrypoint
/traefik/frontends/app/priority
/traefik/frontends/app/routes/host/rules

(that last key should be named rule, not rules. When starting traefik in with this store, it crashes with:

2016/06/12 02:16:21 routine.go:68: runtime error: invalid memory address or nil pointer dereference
goroutine 11 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
    /usr/local/go/src/runtime/debug/stack.go:24 +0x80
runtime/debug.PrintStack()
    /usr/local/go/src/runtime/debug/stack.go:16 +0x18
github.com/containous/traefik/safe.defaultRecoverGoroutine(0xe08c60, 0xc82000e0e0)
    /go/src/github.com/containous/traefik/safe/routine.go:69 +0x81
github.com/containous/traefik/safe.GoWithRecover.func1.1(0x1186788)
    /go/src/github.com/containous/traefik/safe/routine.go:60 +0x4e
panic(0xe08c60, 0xc82000e0e0)
    /usr/local/go/src/runtime/panic.go:443 +0x4e9
main.getRoute(0xc8204467c0, 0xc8204467e0, 0x0, 0x0)
    /go/src/github.com/containous/traefik/server.go:589 +0x4b7
main.(*Server).loadConfig(0xc820362d00, 0xc82043f560, 0xa, 0x0, 0xc8202ec600, 0x1b, 0xc8202ec660, 0x1c, 0xf8bc78, 0x5, ...)
    /go/src/github.com/containous/traefik/server.go:400 +0x1004
main.(*Server).listenConfigurations(0xc820362d00, 0xc820364460)
    /go/src/github.com/containous/traefik/server.go:195 +0x60c
main.(*Server).Start.func2(0xc820364460)
    /go/src/github.com/containous/traefik/server.go:93 +0x2a
github.com/containous/traefik/safe.(*Pool).Go.func1()
    /go/src/github.com/containous/traefik/safe/routine.go:31 +0x41
github.com/containous/traefik/safe.GoWithRecover.func1(0x1186788, 0xc82035b8c0)
    /go/src/github.com/containous/traefik/safe/routine.go:63 +0x44
created by github.com/containous/traefik/safe.GoWithRecover
    /go/src/github.com/containous/traefik/safe/routine.go:64 +0x3f2016/06/12 02:16:21 routine.go:68: runtime error: invalid memory address or nil pointer dereference
goroutine 11 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
    /usr/local/go/src/runtime/debug/stack.go:24 +0x80
runtime/debug.PrintStack()
    /usr/local/go/src/runtime/debug/stack.go:16 +0x18
github.com/containous/traefik/safe.defaultRecoverGoroutine(0xe08c60, 0xc82000e0e0)
    /go/src/github.com/containous/traefik/safe/routine.go:69 +0x81
github.com/containous/traefik/safe.GoWithRecover.func1.1(0x1186788)
    /go/src/github.com/containous/traefik/safe/routine.go:60 +0x4e
panic(0xe08c60, 0xc82000e0e0)
    /usr/local/go/src/runtime/panic.go:443 +0x4e9
main.getRoute(0xc8204467c0, 0xc8204467e0, 0x0, 0x0)
    /go/src/github.com/containous/traefik/server.go:589 +0x4b7
main.(*Server).loadConfig(0xc820362d00, 0xc82043f560, 0xa, 0x0, 0xc8202ec600, 0x1b, 0xc8202ec660, 0x1c, 0xf8bc78, 0x5, ...)
    /go/src/github.com/containous/traefik/server.go:400 +0x1004
main.(*Server).listenConfigurations(0xc820362d00, 0xc820364460)
    /go/src/github.com/containous/traefik/server.go:195 +0x60c
main.(*Server).Start.func2(0xc820364460)
    /go/src/github.com/containous/traefik/server.go:93 +0x2a
github.com/containous/traefik/safe.(*Pool).Go.func1()
    /go/src/github.com/containous/traefik/safe/routine.go:31 +0x41
github.com/containous/traefik/safe.GoWithRecover.func1(0x1186788, 0xc82035b8c0)
    /go/src/github.com/containous/traefik/safe/routine.go:63 +0x44
created by github.com/containous/traefik/safe.GoWithRecover
    /go/src/github.com/containous/traefik/safe/routine.go:64 +0x3f

Renaming this rules key to rule allows traefik to start.

Expected behavior:
I'd expect an error to be logged and the rule (or frontend) not be applied. I'm not yet familiar enough with traefik to suggest the right behavior, but I think a log message would be useful in this scenario.

@vdemeester vdemeester added the bug label Jun 12, 2016
@vdemeester vdemeester added this to the 1.0 milestone Jun 12, 2016
@vdemeester
Copy link
Contributor

hum at least we should not panic 😓

@ldez ldez added the kind/bug/confirmed a confirmed bug (reproducible). label Apr 29, 2017
@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants