# Everytime I enable the api/dashboard, everything stops working

**URL:** <https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449>\
**Category:** Traefik v2\
**Tags:** dashboard-api, docker\
**Created:** [April 26, 2024, 4:16am UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449 "2024-04-26T04:16:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![CaptainPalapa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/captainpalapa/32/8612_2.png) [@CaptainPalapa](https://community.traefik.io/u/CaptainPalapa)\
**Post date:** [April 26, 2024, 4:16am UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/1 "2024-04-26T04:16:46Z")

</div>

**Does anyone have any idea why I'm experiencing this symptom? Appreciate any help you can offer. Thanks much, in advance.**

Complete newbie here. I have finally gotten a simple test page to work with Traefik. I have been trying, for about 4 hours now, to just grok it all, get simple things running, and get the dashboard loaded. Its' this latter that I'm currently struggling with. Not only does the dashboard not come up, but my single page test site stops working.

I'm running a separate console just for `tail` on the log file. When I uncomment the `api` lines in the traefik.yml file, I can tell it's not going to work as soon as the `docker compose up` finishes. I'll get this line in the logs (going to very much shorten it):

```auto
time="2024-04-26T04:06:25Z" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"custom\":{\"address\":\":8080\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"readTimeout\":\"1m0s\",\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"http2\":{\"maxConcurrentStreams\":250},\"udp\".....

```

... and then I get nothing else. With the `api` config entries commented out, I get a whole bunch of stuff (I have debug logging turned on, obviously), this is just a portion. (You can see the last part of the JSON content log entry there.

![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/8/827be6bfe510a30cc0875b4c1a5994e529b1db7e.png)

(_Please note: There's a different domain name, just using "[myserver.com](http://myserver.com)" in config and images._)

Here's the good:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/3/3622c70be064601001a8491bb354e71c1e05061c.png)

Here's the docker-compose:

```auto
services:
  reverse-proxy:
    image: traefik:v2.11

    # Commented this out, seems like it can find it just fine.
    #command: --configFile=/etc/traefik/traefik.yml
    # Tried to add here as command flags vs. being in the config file.
    #command: --configFile=/etc/traefik/traefik.yml --api.dashboard=true --api.insecure=true --providers.docker
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config/traefik.yml:/etc/traefik/traefik.yml:ro
      - ./config/certs/:/etc/traefik/certs/
      - ./log/traefik/:/var/log/traefik/
      - ./data/acme.json:/acme/acme.json
    networks:
      - traefik

  nginx_test:
    image: nginx
    # ports:
    # - 80:80
    networks:
      - traefik
    volumes:
      - ./html:/usr/share/nginx/html:ro
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik"

      - "traefik.http.routers.nginx-http.rule=Host(`test1.myserver.com`)"
      #- "traefik.http.routers.web.rule=Host(`host1.example.com`) || Host(`host2.example.com`) || Host(`host3.random.com`)"
      - "traefik.http.routers.nginx-http.entrypoints=web"
      - "traefik.http.routers.nginx-http.service=nginx-http-service"
      - "traefik.http.services.nginx-http-service.loadbalancer.server.port=80"

      # Have tried with and without this section
      # - "traefik.http.routers.traefik-dashboard.rule=Host(`test2.myserver.com`)"
      # - "traefik.http.routers.traefik-dashboard.entrypoints=web"
      # - "traefik.http.services.traefik-dashboard.loadbalancer.server.port=8080"
      # - "traefik.http.routers.traefik-dashboard.service=traefik-dashboard"

    depends_on:
      - reverse-proxy

networks:
  traefik:
    external: true

```

Here's the traefik.yml:

```auto
entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"
  custom:
    address: ":8080"

# --------------------------------------------------
# If I uncomment these, it completely stops working
# --------------------------------------------------
# api:
# dashboard: true
# insecure: true
# --------------------------------------------------

log:
  level: DEBUG
  format: common
  filePath: /var/log/traefik/traefik.log

certificatesResolvers:
  dwo-resolver:
    acme:
      email: nobody@example.com
      storage: acme.json
      httpChallenge:
        entryPoint: web

providers:
  docker:
    exposedByDefault: false
  file:
    directory: /etc/traefik/
    watch: true

```

---

<div class="post-metadata">

**Author:** ![CaptainPalapa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/captainpalapa/32/8612_2.png) [@CaptainPalapa](https://community.traefik.io/u/CaptainPalapa)\
**Post date:** [April 26, 2024, 4:18am UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/2 "2024-04-26T04:18:53Z")

</div>

As a side note, I likely won't have Traefik's docker-compose merged with other containers, long-term, right now I'm just trying to do a simple config to get my head around the tool.

Also, I have stopped every other docker container. There is nothing but this docker-compose file powering anything. I know web ports can be easy to have conflicts in. (I'm not a programming rookie, 30 years of that, but just... new'ish to docker, and most certainly to Traefik.)

---

<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:** [April 26, 2024, 7:55am UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/3 "2024-04-26T07:55:03Z")

</div>

It takes some time to get used to Traefik static and dynamic config.

`providers.file` is only need for additional dynamic config files, not for `traefik.yml`. You use additional dynamic config files not shown?

Maybe compare to [simple Traefik example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-traefik-dashboard-letsencrypt).

---

<div class="post-metadata">

**Author:** ![CaptainPalapa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/captainpalapa/32/8612_2.png) [@CaptainPalapa](https://community.traefik.io/u/CaptainPalapa)\
**Post date:** [April 26, 2024, 2:28pm UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/4 "2024-04-26T14:28:15Z")

</div>

No, I don't. Let me remove that block. I did start with the simple example, but (for whatever reason, maybe other stuff of my own) it didn't seem to work well, or it didn't fit what I was looking to do.

```auto
# providers:
# docker:
# exposedByDefault: false
# file:
# directory: /etc/traefik/
# watch: true

```

Disabled that section, same result. Any other ideas? I will try, again, to set up the basic example under another stack.

---

<div class="post-metadata">

**Author:** ![CaptainPalapa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/captainpalapa/32/8612_2.png) [@CaptainPalapa](https://community.traefik.io/u/CaptainPalapa)\
**Post date:** [April 26, 2024, 3:21pm UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/5 "2024-04-26T15:21:39Z")

</div>

@bluepuma77 Started to post this in the Issues on the repo, but the realized, it's YOUR repo, so... here might be better than to clog up the repo issues... 🙂 Also, had a "4 link max" so modified some of the outputs... .com is now |com and https:// is now xttps|

* * *

I was able to use your example to get the Dashboard running. I set it up on test1.myserver|com. ("myserver|com" obviously being something else). I replaced the two "whoami.example|com" values with my test3.myserver|com (so one with "www." and one without. And I changed the email address.

**Results:**

1. Dashboard at test1.myserver|com works, but get a warning that the cert is invalid, but at least comes up.
2. Site test3... (the whoami setup) hhmmm, okay, was going to say it didn't come up, but a hard refresh (CTRL+F5) brought it up. (Must not have been ready the first time I tried it.) But it also has a cert issue.

**Log shows:**

```auto
traefik-1 | 2024-04-26T14:52:13Z ERR Unable to obtain ACME certificate for domains error="cannot get ACME client get directory at 'xttps|acme-v02.api.letsencrypt.org/directory': Get \"xttps|acme-v02.api.letsencrypt.org/directory\": dial tcp: lookup acme-v02.api.letsencrypt.org on 127.0.0.11:53: read udp 127.0.0.1:36851->127.0.0.11:53: i/o timeout" ACME CA=xttps|acme-v02.api.letsencrypt.org/directory acmeCA=xttps|acme-v02.api.letsencrypt.org/directory domains=["test1.myserver|com"] providerName=myresolver.acme routerName=mydashboard@docker rule=Host(`test1.myserver|com`)

```

(Two of these, ports 36851 on one and 58165 on another.)

Your question above to the OP was "did you create the necessary DNS entries?", however, .... the readme at: [traefik-best-practice/docker-traefik-dashboard-letsencrypt/README.md at main · bluepuma77/traefik-best-practice · GitHub](https://github.com/bluepuma77/traefik-best-practice/blob/main/docker-traefik-dashboard-letsencrypt/README.md) doesn't indicate what, if any, DNS entries to be created. Using my imagination, I have test1, test2 and test created and pinging. **Are there OTHER DNS entries I should be creating?**

Appreciate any additional insight, not just for me, but for the future lookers here! 🙂

I was able to use this example to get the Dashboard running. I set it up on test1.myserver|com. ("myserver|com" obviously being something else). I replaced the two "whoami.example|com" values with my test3.myserver|com (so one with "www." and one without. And I changed the email address.

Results:

1. Dashboard at test1.myserver|com works, but get a warning that the cert is invalid, but at least comes up.
2. Site test3... (the whoami setup) hhmmm, okay, was going to say it didn't come up, but a hard refresh (CTRL+F5) brought it up. (Must not have been ready the first time I tried it.) But it also has a cert issue.

Log shows:

```auto
traefik-1 | 2024-04-26T14:52:13Z ERR Unable to obtain ACME certificate for domains error="cannot get ACME client get directory at 'xttps|acme-v02.api.letsencrypt.org/directory': Get \"xttps|acme-v02.api.letsencrypt.org/directory\": dial tcp: lookup acme-v02.api.letsencrypt.org on 127.0.0.11:53: read udp 127.0.0.1:36851->127.0.0.11:53: i/o timeout" ACME CA=xttps|acme-v02.api.letsencrypt.org/directory acmeCA=xttps|acme-v02.api.letsencrypt.org/directory domains=["test1.myserver|com"] providerName=myresolver.acme routerName=mydashboard@docker rule=Host(`test1.dwoserver|com`)

```

(Two of these, ports 36851 on one and 58165 on another.)

Your question to the OP in the repo Issues was "did you create the necessary DNS entries?", however, .... the [**readme**](https://github.com/bluepuma77/traefik-best-practice/blob/main/docker-traefik-dashboard-letsencrypt/README.md) doesn't indicate what, if any, DNS entries should be created. Using my imagination, I have test1, test2 and test created and pinging. **Are there OTHER DNS entries I should be creating?**

Appreciate any additional insight, not just for me, but for the future lookers here! 🙂

**Couple other errors I'm getting in log output / stdout:**

```auto

traefik-1 | 2024-04-26T14:54:36Z ERR Error while Peeking first byte error="read tcp 192.168.128.2:80->192.168.128.1:48484: i/o timeout"` *(More than one of these, port number fluctuates, 34088, 48484)*

traefik-1 | 2024-04-26T15:02:09Z WRN Error checking new version error="Get \"xttps|update.traefik.io/repos/traefik/traefik/releases\": dial tcp: lookup update.traefik.io on 127.0.0.11:53: read udp 127.0.0.1:58289->127.0.0.11:53: i/o timeout"

```

---

<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:** [April 26, 2024, 6:08pm UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/6 "2024-04-26T18:08:41Z")

</div>

If you disable all `providers`, then there are no `routers` and no `services`. So only 404.

---

<div class="post-metadata">

**Author:** ![CaptainPalapa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/captainpalapa/32/8612_2.png) [@CaptainPalapa](https://community.traefik.io/u/CaptainPalapa)\
**Post date:** [April 26, 2024, 8:31pm UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/7 "2024-04-26T20:31:49Z")

</div>

Just FYI, I have another big ol post with some good, some bad results. But the system has disabled it until staff reviews it. Grrr.

---

<div class="post-metadata">

**Author:** ![CaptainPalapa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/captainpalapa/32/8612_2.png) [@CaptainPalapa](https://community.traefik.io/u/CaptainPalapa)\
**Post date:** [April 27, 2024, 2:30pm UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/8 "2024-04-27T14:30:09Z")

</div>

The big post I worked on finally cleared, it's above your "disable all providers" entry.

---

<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:** [April 27, 2024, 9:23pm UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/9 "2024-04-27T21:23:51Z")

</div>

You need DNS entries for the domains you want to use, and they need to point to your Traefik server IP.

Error with port 53 indicates you have an issue with your DNS server. Any special network setup or firewalls?

---

<div class="post-metadata">

**Author:** ![CaptainPalapa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/captainpalapa/32/8612_2.png) [@CaptainPalapa](https://community.traefik.io/u/CaptainPalapa)\
**Post date:** [April 27, 2024, 9:47pm UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/10 "2024-04-27T21:47:26Z")

</div>

I'll discontinue posting in this thread. I have TWO working docker stack setup now from various sources around the web. Part of my problem might be partly how I build things in tech: I do one thing and I test it. I add another thing, and test it. Relying on others fully-built examples removes that ability from me. With _working_ examples, though, I'm able to snapshot them and tear them apart, and learn what each line or group of lines in a config does and how it affects the runtime.

I need to find a nice YouTube video that says "let's do (A), here's what happens, now let's add (B) and this is how it's different". Or do my own for others once I grasp it all.

Appreciate the help, everyone. Especially you, @bluepuma77 , you are a frequent contributor here! 🙂

---

<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:** [April 28, 2024, 6:41am UTC](https://community.traefik.io/t/everytime-i-enable-the-api-dashboard-everything-stops-working/22449/11 "2024-04-28T06:41:31Z")

</div>

The [simple Traefik example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-traefik-dashboard-letsencrypt) is a working minimum setup with best practices, so I usually recommend people to start from there and add their additional config piece by piece.
