Command line parameters moved to static file, they are now unrecognized

I moved from Caddy to Traefik configured via command in its docker compose. It worked.

I then decided to move the command line configuration to a configuration file, translating each of them. I ended up with the configuration file below, which seems to be only partially parsed:

  • the routers and services are started (which means the file itself is visible to Traefik)
  • ... but the entrypoints are not

I am sure this is a simple mistake from my side in organizing the file - I would appreciate any help with that.
Additionally, the dashboard is not available anymore.

The config file:

global:
  sendAnonymousUsage: true

api:
  insecure: true
  dashboard: true

providers:
  docker:
    exposedByDefault: true
    
certificatesresolvers:
  letsencrypt:
    acme:
      dnschallenge:
        provider: ovh
      email: XXX
      storage: /config/acme.json

entryPoints:
  # http:
  #   forwardedHeaders:
  #     trustedIPs: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7
  #     insecure: false
  #   proxyProtocol:
  #     trustedIPs: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7
  #     insecure: false
  web:
    address: :80
    http:
      redirections:
        entrypoint:
          to: websecure
          scheme: http
  websecure:
    address: :443
    http:
      tls:
        certResolver: letsencrypt
        domains:
          - main: swtk.eu
            sans:
              - "*.swtk.eu"
      middlewares:
        - authelia@docker

http:
  
  routers:
    hass:
      rule: Host(`hass.swtk.eu`)
      service: hass
      entrypoints:
        - websecure

  services:
    hass:
      loadBalancer:
        servers:
          - url: http://192.168.10.2:8123

The error logs after restarting the container:

More details on: https://doc.traefik.io/traefik/contributing/data-collection/
2024-07-17T13:01:58+02:00 INF github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:73 > Starting provider aggregator aggregator.ProviderAggregator
2024-07-17T13:01:58+02:00 DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:228 > Starting TCP Server entryPointName=http
2024-07-17T13:01:58+02:00 INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:202 > Starting provider *file.Provider
2024-07-17T13:01:58+02:00 DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:203 > *file.Provider provider configuration config={"filename":"/config/config.yml","watch":true}
2024-07-17T13:01:58+02:00 DBG github.com/traefik/traefik/v3/pkg/provider/file/file.go:122 > add watcher on: /config
2024-07-17T13:01:58+02:00 DBG github.com/traefik/traefik/v3/pkg/provider/file/file.go:122 > add watcher on: /config/config.yml
2024-07-17T13:01:58+02:00 INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:202 > Starting provider *traefik.Provider
2024-07-17T13:01:58+02:00 DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:203 > *traefik.Provider provider configuration config={}
2024-07-17T13:01:58+02:00 INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:202 > Starting provider *acme.ChallengeTLSALPN
2024-07-17T13:01:58+02:00 DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:203 > *acme.ChallengeTLSALPN provider configuration config={}
2024-07-17T13:01:58+02:00 DBG github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:227 > Configuration received config={"http":{"routers":{"hass":{"entryPoints":["websecure"],"rule":"Host(`hass.swtk.eu`)","service":"hass"}},"services":{"hass":{"loadBalancer":{"passHostHeader":true,"responseForwarding":{"flushInterval":"100ms"},"servers":[{"url":"http://192.168.10.2:8123"}]}}}},"tcp":{},"tls":{},"udp":{}} providerName=file
2024-07-17T13:01:58+02:00 DBG github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:227 > Configuration received config={"http":{"serversTransports":{"default":{"maxIdleConnsPerHost":200}},"services":{"noop":{}}},"tcp":{"serversTransports":{"default":{"dialKeepAlive":"15s","dialTimeout":"30s"}}},"tls":{},"udp":{}} providerName=internal
2024-07-17T13:01:58+02:00 DBG github.com/traefik/traefik/v3/pkg/tls/tlsmanager.go:321 > No default certificate, fallback to the internal generated certificate tlsStoreName=default
2024-07-17T13:01:58+02:00 ERR github.com/traefik/traefik/v3/pkg/config/runtime/runtime_http.go:32 > EntryPoint doesn't exist entryPointName=websecure routerName=hass@file
2024-07-17T13:01:58+02:00 ERR github.com/traefik/traefik/v3/pkg/config/runtime/runtime_http.go:48 > No valid entryPoint for this router routerName=hass@file

The docker compose

  traefik:
    image: traefik:latest
    command:
      - --log.level=DEBUG
      - --providers.file.filename=/config/config.yml
    ports:
      - 80:80
      - 443:443
      - 18080:8080
    environment:
      - OVH_ENDPOINT=https://eu.api.ovh.com/v1
      - OVH_APPLICATION_KEY=XXX
      - OVH_APPLICATION_SECRET=XXX
      - OVH_CONSUMER_KEY=XXX
      - TZ=Europe/Paris
    volumes:
      - traefik:/config
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/localtime:/etc/localtime:ro

You need to understand the difference between static and dynamic config. Static config is in traefik.yml or command:, dynamic config is different, either in separate dynamic config file loaded via providers.file in static config, or automatic via providers.docker

Ahhhh, OK, thanks! I thought that "static" means "file" and "dynamic" means "via (for instance) docker labels".

From what you are saying, there are directives that belong to the "static config" file and others that belong to another "static config" dynamic file. And in addition the docker labels.

Thanks a lot - I will look at the docs to see where this is documented.

This is a bit weird - I removed the command entries, set XDG_CONFIG_HOME and the configuration - as it was- worked.

I have to read more about that at Traefik Configuration Documentation - Traefik, though the wording is rather difficult to grok.

Maybe check some Traefik examples.

I will actually do a writeup about my mistakes and post it somewhere :slight_smile:

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