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

Consul KV seem broken #587

Closed
jippi opened this issue Aug 2, 2016 · 13 comments
Closed

Consul KV seem broken #587

jippi opened this issue Aug 2, 2016 · 13 comments

Comments

@jippi
Copy link
Contributor

jippi commented Aug 2, 2016

Downloading https://github.com/containous/traefik/blob/master/examples/consul-config.sh and the guide at https://docs.traefik.io/toml/#key-value-storage-structure running on my local Consul cluster yields nothing more than this.

traef k 2016-08-02 21-58-46

with the following errors from CLI

-> ./traefik_linux-amd64 -c config.toml k
ERRO[2016-08-02T19:59:06Z] Error getting keys /traefik/backends/traefik/servers/ Key not found in store
ERRO[2016-08-02T19:59:06Z] Error getting keys /traefik/backends/traefik/servers/ Key not found in store
ERRO[2016-08-02T19:59:06Z] Error getting keys /traefik/frontends/traefik/routes/ Key not found in store
ERRO[2016-08-02T19:59:06Z] Undefined backend '' for frontend traefik
ERRO[2016-08-02T19:59:06Z] Skipping frontend traefik...
ERRO[2016-08-02T19:59:06Z] Error getting keys /traefik/frontends/traefik/routes/ Key not found in store

config file

defaultEntryPoints = ["http"]

[entryPoints]
[entryPoints.http]
address = ":8080"

[web]
address = ":8081"

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

Running Consul v0.6.4

update tried the last 5 releases, i see the same issue on all of these releases

@jippi jippi changed the title Consul KV seem broken on v1.0.2 Consul KV seem broken Aug 2, 2016
@emilevauge
Copy link
Member

Hi @jippi, your TOML file is wrong:

defaultEntryPoints = ["http"]
[entryPoints] 
[entryPoints.http] 
address = ":8080"

[web] 
address = ":8081" 

[consul] 
endpoint = "127.0.0.1:8500" 
watch = true 

Also, you can launch traefik using -d to get more logs.

@jippi
Copy link
Contributor Author

jippi commented Aug 2, 2016

@emilevauge i updated the post with the right config :)

add -d gives this

INFO[2016-08-02T20:17:18Z] Traefik version v1.0.2 built on 2016-08-02_05:35:02PM
INFO[2016-08-02T20:17:18Z] Using TOML configuration file /root/src/config.toml
DEBU[2016-08-02T20:17:18Z] Global configuration loaded {"GraceTimeOut":10,"Debug":true,"AccessLogsFile":"","TraefikLogsFile":"","LogLevel":"DEBUG","EntryPoints":{"http":{"Network":"","Address":":8080","TLS":null,"Redirect":null}},"Constraints":[],"ACME":null,"DefaultEntryPoints":["http"],"ProvidersThrottleDuration":2000000000,"MaxIdleConnsPerHost":200,"Retry":null,"Docker":null,"File":null,"Web":{"Address":":8081","CertFile":"","KeyFile":"","ReadOnly":false},"Marathon":null,"Consul":{"Watch":true,"Filename":"","Constraints":null,"Endpoint":"127.0.0.1:8500","Prefix":"/traefik","TLS":null},"ConsulCatalog":null,"Etcd":null,"Zookeeper":null,"Boltdb":null,"Kubernetes":null}
INFO[2016-08-02T20:17:18Z] Preparing server http &{Network: Address::8080 TLS:<nil> Redirect:<nil>}
INFO[2016-08-02T20:17:18Z] Starting provider *main.WebProvider {"Address":":8081","CertFile":"","KeyFile":"","ReadOnly":false}
INFO[2016-08-02T20:17:18Z] Starting provider *provider.Consul {"Watch":true,"Filename":"","Constraints":null,"Endpoint":"127.0.0.1:8500","Prefix":"/traefik","TLS":null}
INFO[2016-08-02T20:17:18Z] Starting server on :8080
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/alias Key not found in store, setting default /traefik
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/alias Key not found in store, setting default /traefik
ERRO[2016-08-02T20:17:18Z] Error getting keys /traefik/backends/traefik/servers/ Key not found in store
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/backends/traefik/circuitbreaker/expression Key not found in store, setting default
ERRO[2016-08-02T20:17:18Z] Error getting keys /traefik/backends/traefik/servers/ Key not found in store
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/backends/traefik/loadbalancer/method Key not found in store, setting default
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/backends/traefik/circuitbreaker/expression Key not found in store, setting default
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/backends/traefik/maxconn/amount Key not found in store, setting default
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/backends/traefik/loadbalancer/method Key not found in store, setting default
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/backends/traefik/maxconn/extractorfunc Key not found in store, setting default
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/backends/traefik/maxconn/amount Key not found in store, setting default
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/frontends/traefik/entrypoints Key not found in store, setting default empty
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/backends/traefik/maxconn/extractorfunc Key not found in store, setting default
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/frontends/traefik/backend Key not found in store, setting default
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/frontends/traefik/passHostHeader Key not found in store, setting default true
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/frontends/traefik/entrypoints Key not found in store, setting default empty
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/frontends/traefik/backend Key not found in store, setting default
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/frontends/traefik/priority Key not found in store, setting default 0
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/frontends/traefik/passHostHeader Key not found in store, setting default true
ERRO[2016-08-02T20:17:18Z] Error getting keys /traefik/frontends/traefik/routes/ Key not found in store
WARN[2016-08-02T20:17:18Z] Error getting key /traefik/frontends/traefik/priority Key not found in store, setting default 0
DEBU[2016-08-02T20:17:18Z] Configuration received from provider consul: {"frontends":{"traefik":{"entryPoints":["http"],"passHostHeader":true,"priority":0}}}
DEBU[2016-08-02T20:17:18Z] Last consul config received more than 2s, OK
DEBU[2016-08-02T20:17:18Z] Creating frontend traefik
DEBU[2016-08-02T20:17:18Z] Wiring frontend traefik to entryPoint http
DEBU[2016-08-02T20:17:18Z] Creating backend
ERRO[2016-08-02T20:17:18Z] Undefined backend '' for frontend traefik
ERRO[2016-08-02T20:17:18Z] Skipping frontend traefik...
INFO[2016-08-02T20:17:18Z] Server configuration reloaded on :8080
ERRO[2016-08-02T20:17:18Z] Error getting keys /traefik/frontends/traefik/routes/ Key not found in store
DEBU[2016-08-02T20:17:18Z] Configuration received from provider consul: {"frontends":{"traefik":{"entryPoints":["http"],"passHostHeader":true,"priority":0}}}
INFO[2016-08-02T20:17:18Z] Skipping same configuration for provider consul

@emilevauge
Copy link
Member

Your KV config seems incorrect: you must define a backend in your frontend ERRO[2016-08-02T20:17:18Z] Undefined backend '' for frontend traefik

@jippi
Copy link
Contributor Author

jippi commented Aug 2, 2016

I don't get why its asking for anything in /traefik/backends/traefik/ or /traefik/frontends/traefik/

can't find any tests with those paths, and it doesn't exist in my consul kv either

this is what I have in consul kv : https://gist.github.com/jippi/051b35676e37bf7b251ebbd6c344ff5b

@jippi
Copy link
Contributor Author

jippi commented Aug 2, 2016

@emilevauge what i have in consul is 100% (and only that) of https://github.com/containous/traefik/blob/master/examples/consul-config.sh

@jippi
Copy link
Contributor Author

jippi commented Aug 2, 2016

And again, i don't provide any backend or frontend named traefik

consul by hashicorp 2016-08-02 22-21-41

consul by hashicorp 2016-08-02 22-22-39

this are my keys

[
  "traefik/backends/backend1/circuitbreaker/expression",
  "traefik/backends/backend1/servers/server1/url",
  "traefik/backends/backend1/servers/server1/weight",
  "traefik/backends/backend1/servers/server2/url",
  "traefik/backends/backend1/servers/server2/weight",
  "traefik/backends/backend2/loadbalancer/method",
  "traefik/backends/backend2/servers/server1/url",
  "traefik/backends/backend2/servers/server1/weight",
  "traefik/backends/backend2/servers/server2/url",
  "traefik/backends/backend2/servers/server2/weight",
  "traefik/frontends/frontend1/backend",
  "traefik/frontends/frontend1/entrypoints",
  "traefik/frontends/frontend1/routes/test_1/rule",
  "traefik/frontends/frontend2/backend",
  "traefik/frontends/frontend2/entrypoints",
  "traefik/frontends/frontend2/routes/test_2/rule"
]

@emilevauge
Copy link
Member

My bad, here is the correct TOML:

defaultEntryPoints = ["http"]
[entryPoints] 
[entryPoints.http] 
address = ":8080"

[web] 
address = ":8081" 

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

Just tested, works as expected:
capture du 2016-08-02 22 26 14

@jippi
Copy link
Contributor Author

jippi commented Aug 2, 2016

works for me too now too

@jippi jippi closed this as completed Aug 2, 2016
@emilevauge
Copy link
Member

Hum, you're welcome...

@jippi
Copy link
Contributor Author

jippi commented Aug 3, 2016

@emilevauge I just realized i closed the issue in a kinda-grumpy way last night.. not an excuse, but it was 23:30, and was dead tired. Layed in bad with the laptop trying to make it work for a PoC.

I'm really happy and grateful that you took your time to help me get it working that fast

Thank you! :)

jippi added a commit to jippi/traefik that referenced this issue Aug 3, 2016
Seemed to have been the cause of traefik#587
@jippi jippi mentioned this issue Aug 3, 2016
emilevauge pushed a commit that referenced this issue Aug 8, 2016
Seemed to have been the cause of #587
@adamgoose
Copy link

Seems like the take-away here is to not include the / in your prefix. This also seems to apply when using the /traefik/alias for atomic changes. The value of the alias should not begin with a /. Perhaps the aforelinked docs should be updated?

#1352 was created when experiencing a similar issue where traefik was insisting on having a front-end called traefik when none was defined.

@timoreimann
Copy link
Contributor

A PR to update the docs would be appreciated. :-)

@seeruk
Copy link

seeruk commented Nov 8, 2018

FYI; the docs still need updating for this. If I get some time soon I'll submit one if someone else doesn't beat me to it, but I've just been scratching my head at this for about an hour!

@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.
Projects
None yet
Development

No branches or pull requests

6 participants