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 issue when serviceName contains a dot #475

Closed
joonas-fi opened this issue Jun 21, 2016 · 5 comments · Fixed by #477
Closed

consulCatalog issue when serviceName contains a dot #475

joonas-fi opened this issue Jun 21, 2016 · 5 comments · Fixed by #477
Labels

Comments

@joonas-fi
Copy link

joonas-fi commented Jun 21, 2016

tl;dr: I only got consulCatalog to work by adding --consulCatalog.constraints=tag==foo to argv and adding traefik.tags=traefik tag to service definition in Consul - which sounds very artificial since according to docs the defaults should work with every Consul service and no constraints would be required. Without the constraints Traefik fails with very unhelpful error message.

Version: traefik:latest (today is 2016-06-21)


Full description:

constraints is documented as optional. BUT, running without it yields:

time="2016-06-21T10:19:31Z" level=error msg="Error loading new configuration, aborted Undefined backend: " 

This error message just leaves me dumbfounded. There's nothing in it that helps me diagnose what's wrong. Desperately I'll try to add a constraint to filter Consul-advertised services to only one service that has very explicit tags and so it should work - at least for drilling down on the issue.

When I try to apply a constraint using the documented way:

constraints = ["tag==foo"]

This yields:

Error reading TOML config file /etc/traefik/traefik.toml : Type mismatch for 'main.TraefikConfiguration.ConsulCatalog': Type mismatch for 'provider.ConsulCatalog.Constraints': Type mismatch for types.Constraint. Expected map but found 'string'.

This also doesn't work:

constraints = "tag==foo"

Nor:

[consulCatalog.constraints]
tag = "foo"

I got it working only after I added --consulCatalog.constraints=tag==foo to argv.

To this moment, I don't know why I have to add a constraint, since according to docs there doesn't need to be any Consul tags with a service for it to work correctly in Traefik (only tag that seems really important is traefik.frontend.rule but it has a sensible default anyways (defining domain didn't help).

Also, it is super confusing to specify constraint tag==foo and to realize it doesn't look at Consul tag "foo", but Traefik tag foo instead, which is implemented with Consul tags, but with a prefix (traefik.tags=foo). I think I might just have a stroke dealing with all this complexity. :D

@emilevauge emilevauge added the bug label Jun 22, 2016
@emilevauge
Copy link
Member

Ping @samber

@joonas-fi
Copy link
Author

joonas-fi commented Jun 22, 2016

Umm this might be something else, as now Traefik stopped working with consulCatalog even though I have the described constraint system in effect.

I'm still researching this, but currently this seems to trigger when I bring a service online, whose service name in Consul contains a dot (.).

@joonas-fi
Copy link
Author

Yeah, I've tested many times stopping and starting my only service whose name contains a dot, and it appears consistent that the log line emits when that service comes online:

Error loading new configuration, aborted Undefined backend: 

When the dot-containing service is present in Consul, after restarting Traefik the consul_catalog tab in the UI does not pop up (even though I have another service, not containing a dot, in Consul that should appear in Traefik).

The second I stop my dot-containing service consul_catalog shows up in Traefik. If that dot-containing service comes online when Traefik is running, the other valid service shows up under consul_catalog tab, but it seems that updates are not synced from consul_catalog as long as the dot-containing service name exists.

Workaround until now: I'll make the service not contain a dot.

@joonas-fi
Copy link
Author

P.s. constraints = ["tag==foo"] not working is still a bug, right?

@emilevauge
Copy link
Member

emilevauge commented Jun 22, 2016

@joonas-fi

P.s. constraints = ["tag==foo"] not working is still a bug, right?

The documentation is false:
#451 (comment)

@emilevauge emilevauge changed the title consulCatalog not working per the example in documentation consulCatalog issue when serviceName contains a dot Jun 22, 2016
@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