Repetitive logs for docker provider - Traefik + Swarm

I'm using Traefik and Docker (in Swarm mode) and I recently managed to add HTTPS support (yeah I'm a newbie) but I can see in the logs that something is not right.

I have the following docker-compose.yml:

version: "3.8"
services:
  traefik:
    image: traefik:v2.4
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    command:
      - --log.level=DEBUG
      - --api.insecure=true
      - --api.dashboard=true
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false
      - --providers.docker.swarmmode=true
      - --providers.docker.network=<STACK_NAME>_traefik-net
      - --entrypoints.websecure.address=:443
      - --certificatesresolvers.resolver.acme.dnschallenge=true
      - --certificatesresolvers.resolver.acme.dnschallenge.provider=lightsail
      - --certificatesresolvers.resolver.acme.email=<MY_EMAIL>
      - --certificatesresolvers.resolver.acme.storage=/opt/traefik/acme.json
    networks:
      - traefik-net
    deploy:
      placement:
          constraints:
              - node.role == manager
     
  http-server:
    image: <MY_IMAGE>
    networks:
      - traefik-net
    deploy:
      labels:
        - traefik.enable=true
        - traefik.http.routers.traefik.entrypoints=websecure
        - "traefik.http.routers.traefik.rule=Host(<MY_HOST>) && Path(`/token`)"
        - traefik.http.routers.traefik.service=http-service
        - traefik.http.services.http-service.loadbalancer.server.port=4443
        - traefik.http.services.http-service.loadbalancer.server.scheme=http
    depends_on:
      - reverse-proxy

networks:
  traefik-net:

and I get this log appearing multiple time consecutivetly:

time="2021-06-28T09:44:29Z" level=debug msg="Filtering disabled container" providerName=docker container=<STACK_NAME>-traefik-q54qcpuxqohxtvb5ogcipxn9f
time="2021-06-28T09:44:29Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"traefik\":{\"entryPoints\":[\"websecure\"],\"service\":\"http-service\",\"rule\":\"Host(<MY_HOST>) \\u0026\\u0026 Path(`/token`)\"}},\"services\":{\"http-service\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.166.6:4443\"}],\"passHostHeader\":true}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
time="2021-06-28T09:44:29Z" level=info msg="Skipping same configuration" providerName=docker

Furthermore, I cannot access the /token route and I receive a 404 error. So here are my questions:

  • Is my container's configuration get registered multiple time? is it normal?
  • Is there anything obvious (that I can see) that leads to the 404 error ? is it linked to the previous question ?
1 Like

Hi @Clement-Jean

It does not look like you have mounted your docker socket or provided a tcp endpoint.

for the sake of simplicity I didn't include the Environment variables, I did mount the docker socket. However I'm not sure about what's your point about TCP endpoint, could you tell me more about it ?

Hello @Clement-Jean,

You have providers.docker.exposedbydefault=false set, so only enabled containers will be visible.

You see the "filtered container" log because you have not enabled the traefik container itself to be routable. This is normal, and not an issue, hence why it is in the debug log.

The configuration is fetched from docker every 15 seconds by default, so the debug log will print the received configuration every 15 seconds.

Finally, the configuration received has not changed in the last 15 seconds, so the configuration update is skipped. This is also normal, and acceptable for info level logging.

You have the websecure entrypoint on port 443, but have not configured TLS on the corresponding router.

Therefore your HTTPS request will 404, as there are no TLS-enabled routers to match the request.

You should add TLS to your router using the Docker - Traefik labels.

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