Docker provider applies unexpected rule

  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

  • Yes, I've searched similar issues on GitHub and didn't find any.

What did you do?

Hi guys,

I am using traefik v2.5 with standalone docker containers. In order to detect automatically containers, I have configured the docker provider.

So, this seems fine cause it automatically detects docker stuff and allows dynamic traefik configuration.

What did you see instead?

So it works fine for all of my containers, except only 1 container that is not well handled, for unknown reason :

As you can see, the route for sonarr is :

Host(`sonarr-sonarr.domain.net`)

Whereas it should be :

Host(`sonarr.domain.net`)

Here is the output of docker ps --format {{ .Names }} :

sonarr
transmission
owncloud
traefik
plex

What version of Traefik are you using?

Version:      2.5.0-rc2
Codename:     brie
Go version:   go1.16.5
Built:        2021-06-28T18:59:55Z
OS/Arch:      linux/amd64

What is your environment & configuration?

Here is the traefik configuration :

# Docker configuration backend
providers:
  docker:
    defaultRule: "Host(`{{ trimPrefix `/` .Name }}.domain.net`)"

# API and dashboard configuration
api:
  insecure: true

# Entrypoints
entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: "websecure"
          scheme: "https"
          permanent: true
  websecure:
    address: ":443"

# Certs
certificatesResolvers:
  letsencrypt:
    acme:
      email: myuser@domain.net
      storage: /etc/traefik/acme.json
      httpChallenge:
        # used for the HTTP challenge
        entryPoint: web

log:
  filePath: "/etc/traefik/applog.log"
  level: DEBUG

Docker version :

Docker version 17.05.0-ce, build 89658be

If applicable, please paste the log output in DEBUG level

time="2021-07-13T14:39:44Z" level=debug msg="Provider event received {Status:start ID:c2b91340ff20e1123af25db1ab4ff67268762b3df3114c5b063774f1b28ea904 From:ghcr.io/linuxserver/sonarr:5.14-version-2.0.0.5344 Type:container Action:start Actor:{ID:c2b91340ff20e1123af25db1ab4ff67268762b3df3114c5b063774f1b28ea904 Attributes:map[build_version:Linuxserver.io version:- 2.0.0.5344-ls15 Build-date:- 2021-03-09T20:26:39+00:00 com.docker.compose.config-hash:445b8fad5c0a9c62345ff6f8025d818c4b1e5f4638b7ea4b4f3eb4e2d4399b22 com.docker.compose.container-number:1 com.docker.compose.oneoff:False com.docker.compose.project:sonarr com.docker.compose.project.config_files:docker-compose.yml com.docker.compose.project.working_dir:/root/docker-compose/sonarr com.docker.compose.service:sonarr com.docker.compose.version:1.29.2 image:ghcr.io/linuxserver/sonarr:5.14-version-2.0.0.5344 maintainer:sparklyballs name:sonarr sonarr.http.routers.sonarr.rule:Host(`sonarr.domain.net`) sonarr.http.routers.sonarr.tls:true sonarr.http.routers.sonarr.tls.certresolver:letsencrypt]} Scope: Time:1626187184 TimeNano:1626187184559657690}" providerName=docker
time="2021-07-13T14:39:44Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"owncloud\":{\"service\":\"owncloud-owncloud\",\"rule\":\"Host(`owncloud.domain.net`)\",\"tls\":{\"certResolver\":\"letsencrypt\"}},\"plex\":{\"service\":\"plex\",\"rule\":\"Host(`plex.domain.net`)\",\"tls\":{\"certResolver\":\"letsencrypt\"}},\"sonarr-sonarr\":{\"service\":\"sonarr-sonarr\",\"rule\":\"Host(`sonarr-sonarr.domain.net`)\"},\"traefik\":{\"service\":\"traefik\",\"rule\":\"Host(`traefik.domain.net`)\",\"tls\":{\"certResolver\":\"letsencrypt\"}},\"transmission\":{\"service\":\"transmission\",\"rule\":\"Host(`transmission.domain.net`)\",\"tls\":{\"certResolver\":\"letsencrypt\"}}},\"services\":{\"owncloud-owncloud\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.17.0.4:80\"}],\"passHostHeader\":true}},\"plex\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.17.0.6:32400\"}],\"passHostHeader\":true}},\"sonarr-sonarr\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.17.0.2:8989\"}],\"passHostHeader\":true}},\"traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.17.0.5:8080\"}],\"passHostHeader\":true}},\"transmission\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.17.0.3:9091\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
time="2021-07-13T14:39:44Z" level=debug msg="No entryPoint defined for this router, using the default one(s) instead: [web websecure]" routerName=sonarr-sonarr
time="2021-07-13T14:39:44Z" level=debug msg="Creating middleware" middlewareType=Pipelining entryPointName=web routerName=sonarr-sonarr@docker serviceName=sonarr-sonarr middlewareName=pipelining
time="2021-07-13T14:39:44Z" level=debug msg="Creating load-balancer" serviceName=sonarr-sonarr entryPointName=web routerName=sonarr-sonarr@docker
time="2021-07-13T14:39:44Z" level=debug msg="Creating server 0 http://172.17.0.2:8989" routerName=sonarr-sonarr@docker serverName=0 serviceName=sonarr-sonarr entryPointName=web
time="2021-07-13T14:39:44Z" level=debug msg="Added outgoing tracing middleware sonarr-sonarr" middlewareName=tracing middlewareType=TracingForwarder entryPointName=web routerName=sonarr-sonarr@docker

Any help would be really appreciated.
Thanks a lot !

Ok it is now solved !

That was cause sonarr container labels was using treafik word instead of traefik. That's my bad !

Regards,
JD

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.