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

ConsulCatalog and File not working #903

Closed
gozer opened this issue Nov 25, 2016 · 1 comment
Closed

ConsulCatalog and File not working #903

gozer opened this issue Nov 25, 2016 · 1 comment
Labels
kind/bug/confirmed a confirmed bug (reproducible). priority/P0 needs hot fix status/5-frozen-due-to-age

Comments

@gozer
Copy link
Contributor

gozer commented Nov 25, 2016

I've been trying what seems to me like a straightforward configuration. ConsulCatalog for most services along with a few manual rules in a file.

My config looks like:

/etc/traefik/traefik.toml

defaultEntryPoints = ["http","https"]

[entryPoints]
  [entryPoints.http]
    address = ":80"
    [entryPoints.http.redirect]
      entryPoint = "https"
  [entryPoints.https]
    address = ":443"
    [entryPoints.https.tls]

[file]
watch = true
filename = "/etc/traefik/rules.toml"

[consulCatalog]
endpoint = "127.0.0.1:8500"

[consul]
endpoint = "127.0.0.1:8500"
watch = true
prefix = "traefik/prod/config"

[acme]
email="gozer@mozilla.com"
storage = "traefik/prod/acme"
entryPoint = "https"

/etc/traefik/rules.toml

[backends]
  [backends.backend-nginx]
    [backends.backend-nginx.servers.local]
    url = "http://127.0.0.1:8080"

[frontends]
  [frontends.frontend-nginx]
  backend = "backend-nginx"
  entrypoints = ["https","http"]
    [frontends.frontend-nginx.routes.main]
    rule = "Host:nginx.localdomain"

And here is what's interesting about that. If I start traefik with that configuration, it will start, but a panic will be logged:

ERROR [2016-11-25T14:19:06Z] Error in Go routine: interface conversion: interface is nil, not bool 
goroutine 30 [running]:
runtime/debug.Stack(0x4e668f, 0xc4200166e0, 0xe75a83)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x79
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x22
github.com/containous/traefik/safe.defaultRecoverGoroutine(0xd2f3a0, 0xc420403d80)
        /go/src/github.com/containous/traefik/safe/routine.go:135 +0x7d
github.com/containous/traefik/safe.GoWithRecover.func1.1(0xedc938)
        /go/src/github.com/containous/traefik/safe/routine.go:126 +0x57
panic(0xd2f3a0, 0xc420403d80)
        /usr/local/go/src/runtime/panic.go:458 +0x243
github.com/containous/traefik/cluster.(*Leadership).IsLeader(0xc420407500, 0x0)
        /go/src/github.com/containous/traefik/cluster/leadership.go:101 +0x64
main.(*Server).postLoadConfig(0xc4200ba900)
        /go/src/github.com/containous/traefik/server.go:293 +0x354
main.(*Server).listenConfigurations(0xc4200ba900, 0xc42023c380)
        /go/src/github.com/containous/traefik/server.go:281 +0x67f
main.(*Server).Start.func2(0xc42023c380)
        /go/src/github.com/containous/traefik/server.go:102 +0x34
github.com/containous/traefik/safe.(*Pool).Go.func1()
        /go/src/github.com/containous/traefik/safe/routine.go:73 +0x3a
github.com/containous/traefik/safe.GoWithRecover.func1(0xedc938, 0xc4204490e0)
        /go/src/github.com/containous/traefik/safe/routine.go:129 +0x4d
created by github.com/containous/traefik/safe.GoWithRecover
        /go/src/github.com/containous/traefik/safe/routine.go:130 +0x49

But traefik will come up, but will never see the configuration from ConsulCatalog

However, if I startup traefik with an empty rules file, then, after startup, if I modify that file to add back the rules as I've showed them, it works as I'd expect, both ConsulCatalog and File configurations are being correctly merged.

@emilevauge
Copy link
Member

Fixed by #956

@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
kind/bug/confirmed a confirmed bug (reproducible). priority/P0 needs hot fix status/5-frozen-due-to-age
Projects
None yet
Development

No branches or pull requests

4 participants