containous / traefik-extra-service-fabric

Traefik extra: Service Fabric Provider
Apache License 2.0
12 stars 14 forks source link

Traefik fails to register any services when a service has a bad label #36

Closed littleninja closed 6 years ago

littleninja commented 6 years ago

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

BUG

What did you do?

Deploy two services, one with a valid ServiceManifest.xml and good labels (GoodService) for Traefik, and one a ServiceManifest.xml containing a bad label value (BorkService):

<StatelessServiceType ServiceTypeName="BorkServiceType" UseImplicitHost="true">
  <Extensions>
    <Extension Name="Traefik">
      <Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
        <Label Key="traefik.frontend.rule.borkservice">PathPrefixStrip: /bork</Label>
        <Label Key="traefik.enable">true</Label>
        <Label Key="traefik.frontend.entryPoints">["https","http"]</Label><!-- value should be: https,http -->
      </Labels>
    </Extension>
  </Extensions>
</StatelessServiceType>

What did you expect to see?

Traefik should register GoodService but not BorkService.

What did you see instead?

No backend services. Traefik Dashboard UI is entirely blank except for header. Errors are not visible unless viewing Traefik logs on server.

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

1.6.0

What is your environment & configuration (arguments, toml, provider, platform, ...)?

Provider: Service Fabric v6.1.480.9494 Platform: Windows Server 2016 Datacenter

################################################################
# Global configuration
################################################################

InsecureSkipVerify = true
debug = true
logLevel = "INFO"
defaultEntryPoints = ["https","http"]

[traefikLog]
  filePath = "traefik.log"

[entryPoints]
  [entryPoints.http]
  address = ":30080"
  [entryPoints.https]
  address = ":30443"
    [entryPoints.https.proxyProtocol]
      insecure = true
    [entryPoints.https.tls]
      [entryPoints.https.tls.ClientCA]
      optional = true
      [[entryPoints.https.tls.certificates]]
      certFile = "localhost.cert"
      keyFile = "localhost.key"
[entryPoints.traefik]
address = ":38080"

################################################################
# API definition
################################################################

[api]
  entryPoint = "traefik"
  dashboard = true

################################################################
# Service Fabric provider
################################################################

[servicefabric]
clustermanagementurl = "https://localhost:19080"
apiversion = "3.0"

[serviceFabric.tls]
  cert = "traefikcert.crt"
  key = "traefikkey.key"
  insecureskipverify = true
  caoptional = true

If applicable, please paste the log output at DEBUG level (--logLevel=DEBUG switch)

time="2018-05-11T19:54:07Z" level=error msg="Provider connection error: Near line 133 (last key parsed 'frontends.frontend-fabric:/BorkService/BorkService.entryPoints'): expected a comma or array terminator ']', but got 'h' instead; retrying in 1.008273491s"
ldez commented 6 years ago

Related to https://github.com/containous/traefik/issues/3313

lawrencegripper commented 6 years ago

@ldez is this issue better suited to the top level traefik repo? I believe you would also see the same behavior on other providers as the logic used is the SF provider around parsing the endpoints is nearly identical to the approach used in the docker provider.

ldez commented 6 years ago

As I already said to @littleninja, it's the same behavior than the other providers.

ldez commented 6 years ago

I reopened https://github.com/containous/traefik/issues/3313