Command traefik error: failed to decode configuration from flags: field not found, node: resolvers:

Hi all,

Trying to learn Traefik 2.0 and setup Let's Encrypt with DNS challenge. Run into the above error when I try to bring up traefik. I am using only single file "docker-compose.yml" attached below.

version: "3.3"

services:
  traefik:
    image: "traefik:v2.0.2"
    command:
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      - --providers.docker
      - --api
      #- --api.dashboard
      - --certificatesresolvers.leresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
      - --certificatesresolvers.leresolver.acme.email=admin@domain.com
      - --certificatesresolvers.leresolver.acme.storage=/acme.json
      - --certificatesresolvers.leresolver.acme.dnschallenge.provider=route53
      - --certificatesResolvers.leresolver.acme.dnsChallenge.resolvers:="1.1.1.1:53,8.8.8.8:53"
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./acme.json:/acme.json"
    labels:
      # global redirect to https
      - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.http-catchall.entrypoints=web"
      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"

      # middleware redirect
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
   
    
    environment:
      - "AWS_SECRET_ACCESS_KEY=XXX"
      - "AWS_ACCESS_KEY_ID=XXX"
      - "AWS_HOSTED_ZONE_ID=XXX"

  my-app:
    image: containous/whoami:v1.3.0
    labels:
      - "traefik.http.routers.my-app.rule=Host(`domain.com`)"
      - "traefik.http.routers.my-app.middlewares=auth"
      - "traefik.http.routers.my-app.entrypoints=websecure"
      - "traefik.http.routers.my-app.tls=true"
      - "traefik.http.routers.my-app.tls.certresolver=leresolver"
      - "traefik.http.routers.my-app.tls.domain[0].main=domain.com"
      - "traefik.http.routers.my-app.tls.domain[0].sans=*.domain.com"
      - "traefik.http.middlewares.auth.basicauth.users=user:xxx"

Hi @durian, based on the error message mentioning resolvers:, have a look at your label

- --certificatesResolvers.leresolver.acme.dnsChallenge.resolvers:="1.1.1.1:53,8.8.8.8:53"

there is a trailing column (:) on the key which should not be there . Can you try with

- --certificatesResolvers.leresolver.acme.dnsChallenge.resolvers="1.1.1.1:53,8.8.8.8:53"

please?

Hi Dduportal,

Thank you! That resolve the errors.

1 Like