Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Traefik fails to parse extension labels containing newline characters #51

Open
1 of 2 tasks
gheibia opened this issue Apr 26, 2019 · 1 comment
Open
1 of 2 tasks

Comments

@gheibia
Copy link

gheibia commented Apr 26, 2019

Do you want to request a feature or report a bug?

Bug

Did you try using a 1.7.x configuration for the version 2.0?

  • Yes
  • No

What did you do?

I run Traefik inside Azure Service Fabric. At the same time, I configure other services on Service Fabric with Traefik's extension labels including traefik.frontend.rule. For instance:

<ServiceTypes>
    <StatelessServiceType ServiceTypeName="MyServiceType" UseImplicitHost="true">
      <Extensions>
        <Extension Name="Traefik">
          <Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
            <Label Key="traefik.enable">true</Label>
            <Label Key="traefik.frontend.passHostHeader">true</Label>
            <Label Key="traefik.frontend.rule">
                   Host:myapp.mydomain.com;PathPrefixStripRegex:/{path:(?i)path1}, /{path:(?i)path2}
            </Label>
            <Label Key="traefik.backend.loadbalancer.stickiness">true</Label>
            <Label Key="traefik.backend.healthcheck.path">/</Label>
            <Label Key="traefik.backend.healthcheck.interval">20s</Label>
          </Labels>
        </Extension>
      </Extensions>
    </StatelessServiceType>
  </ServiceTypes>

What did you expect to see?

Traefik discover the service and display it on the dashboard.

What did you see instead?

Traefik didn't discover the service.

Output of traefik version: (What version of Traefik are you using?)

1.7.6

If applicable, please paste the log output in DEBUG level (--log.level=DEBUG switch)

time="2019-04-26T20:28:44Z" level=error msg="Provider connection error: Near line 122 (last key parsed 'frontends.frontend-fabric:/xxxx/xxxx.routes.traefik.frontend.rule.rule'): strings cannot contain newlines; retrying in 650.84664ms"
@gheibia
Copy link
Author

gheibia commented Apr 26, 2019

It goes without saying that removing newline characters between the opening and closing tags will resolve the issue. However, XML documents are allowed to have whitespace characters. Traefik should instead trim the label strings before using them.

@ldez ldez transferred this issue from traefik/traefik Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant