# No valid configuration found in file

**URL:** <https://community.traefik.io/t/no-valid-configuration-found-in-file/20383>\
**Category:** Traefik v2\
**Tags:** file\
**Created:** [November 7, 2023, 9:31am UTC](https://community.traefik.io/t/no-valid-configuration-found-in-file/20383 "2023-11-07T09:31:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew\_wrigley](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@andrew\_wrigley](https://community.traefik.io/u/andrew_wrigley)\
**Post date:** [November 7, 2023, 9:31am UTC](https://community.traefik.io/t/no-valid-configuration-found-in-file/20383/1 "2023-11-07T09:31:56Z")

</div>

I am trying to specify a dynamic configuration using a file. Whatever I try including the examples from the website I get:  
No valid configuration found in file  
Then traefik exits with a code 1.

The current file is:  
[http]  
# Add the router  
[http.routers]  
[http.routers.router0]  
entryPoints = ["web"]  
middlewares = ["my-basic-auth"]  
service = "service-foo"  
rule = "Path(`/foo`)"

# Add the middleware  
[http.middlewares]  
[http.middlewares.my-basic-auth.basicAuth]  
users = ["test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",  
"test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"]  
usersFile = "etc/traefik/.htpasswd"

# Add the service  
[http.services]  
[http.services.service-foo]  
[http.services.service-foo.loadBalancer]  
[[http.services.service-foo.loadBalancer.servers]]  
url = "[http://foo/](http://foo/)"  
[[http.services.service-foo.loadBalancer.servers]]  
url = "[http://bar/](http://bar/)"

What am I doing wrong ?

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [November 7, 2023, 5:41pm UTC](https://community.traefik.io/t/no-valid-configuration-found-in-file/20383/2 "2023-11-07T17:41:55Z")

</div>

Please format your config with 3 backticks before and after or select code and press `</>` .

---

<div class="post-metadata">

**Author:** ![andrew\_wrigley](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@andrew\_wrigley](https://community.traefik.io/u/andrew_wrigley)\
**Post date:** [November 8, 2023, 9:11am UTC](https://community.traefik.io/t/no-valid-configuration-found-in-file/20383/3 "2023-11-08T09:11:43Z")

</div>

The issue here was, I had called my dynamic file, /etc/traefik/traefik.yml which by coincidence is the default name for the static file. So traefik was starting and trying to parse the dynamic config file as a static config file and falling over.
