I recently built a new docker traefik instance (v2.10.1) on another server. The traefik.yml's are identical. However, on the new server it won't load the config.yml. I get the following error below. The error says, "Line 43," is where the problem is at however, that has nothing to do with file providers section of traefik.yml. That line is the "https" in entrypoints section. So not sure where it got the line error from.
The server starts, but it doesn't use the config because of the error. Everything looks right to me so I'm not sure what I'm missing...
error:
level=error msg="Error while building configuration (for the first time): yaml: line 43: did not find expected '-' indicator" providerName=file
Per Traefik documentation there is no "-" indicator required. This works on my other server...which is why I don't understand why its asking for a "-" on this one.
Docs:
providers:
file:
filename: /path/to/config/dynamic_conf.yml
My traefik.yml
# STATIC CONFIG (restart traefik to update)
# shows you a log msg if a newer image tag can be used
global:
checkNewVersion: true
# log default is ERROR, but WARN is more helpful
log:
level: WARN
# level: INFO
# level: DEBUG
# enable dashboard on 8080 with NO AUTH
api:
insecure: true
dashboard: true
# enable ping so the `traefik healthcheck` works
ping: {}
# auto-proxy containers if they have proper labels
# and also use this file for dynamic config (tls)
providers:
docker:
exposedByDefault: false
watch: true
file:
filename: /config.yml
watch: true
# listen on 80/443, and redirect all 80 to 443 via 301
entryPoints:
http:
address: ":80"
http:
redirections:
entryPoint:
to: https
scheme: https
Permanent: true
https:
address: ":443"