# Migrated to v2 in Swarm, can't load dashboard

**URL:** <https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856>\
**Category:** Traefik v2\
**Tags:** docker-swarm, docker\
**Created:** [September 25, 2019, 4:38am UTC](https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856 "2019-09-25T04:38:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrAnderson](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MrAnderson](https://community.traefik.io/u/MrAnderson)\
**Post date:** [September 25, 2019, 4:38am UTC](https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856/1 "2019-09-25T04:38:54Z")

</div>

I've converted my stack to traefik v2 but I can't get a demo service to work and I can't get the traefik dashboard to load. The traefik logs are showing nothing really. Can somebody please tell me what I am doing wrong? My goal is to get the traefik dashboard to load over ssl.

```auto
image: traefik:v2.0
    command: 
      - "--log.level=DEBUG"
      - "--api=true"
      - "--api.dashboard=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.https.address=:443"
      - "--providers.docker.swarmMode=true"
      - "--metrics.prometheus=true"
      - "--accesslog=true"
      - "--ping=true"
    networks:
      - swarm
    ports:
      - "80:80"
      - "8080:8080"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

```

...

```auto
deploy:
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=swarm"
        - "traefik.http.routers.traefik.entrypoints=https"
        - "traefik.http.routers.traefik.rule=Host(`traefik.mydomain.local`)"
        - "traefik.http.services.traefik.loadbalancer.server.port=8080"
        - "traefik.http.routers.traefik.service=api@internal"

```

traefik.yml

```auto
providers:
  file:
    directory: /etc/traefik
    filename: dynamic_conf.yml
    watch: true

```

dynamic\_conf.yml

```auto
tls:
  certificates:
    - certFile: /etc/traefik/certs/wildcard-cert.pem
      keyFile: /etc/traefik/certs/wildcard-key.pem

```

---

<div class="post-metadata">

**Author:** ![Ch1ch1](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ch1ch1/32/710_2.png) [@Ch1ch1](https://community.traefik.io/u/Ch1ch1)\
**Post date:** [September 25, 2019, 7:32am UTC](https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856/2 "2019-09-25T07:32:40Z")

</div>

Hello

```yaml
      - "--api.insecure=true"

```

means that you don't need to expose your dashborad trought traefik

[https://docs.traefik.io/v2.0/operations/api/#insecure](https://docs.traefik.io/v2.0/operations/api/#insecure)

Try removing all the labels and keep --api.insecure  
or  
Remove --api.insecure and keep the labels

---

<div class="post-metadata">

**Author:** ![MrAnderson](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MrAnderson](https://community.traefik.io/u/MrAnderson)\
**Post date:** [September 27, 2019, 5:35pm UTC](https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856/3 "2019-09-27T17:35:33Z")

</div>

Thanks but that didn't work. I could REALLY use a basic working example of a Swarm config. Here's what I have, I could really use some assistance - i've been fighting this for days.

compose:

```auto
services:
  traefik:
    image: traefik:v2.0
    restart: unless-stopped
    command: --providers.docker \
      --providers.docker.swarmMode \
      --providers.docker.exposedByDefault=false \
      --providers.docker.domain=${URLSLUG:-dev}.domain.local \
      --providers.docker.watch \
      --entryPoints.web.address=:80
      --entryPoints.websecure.address=:443
      --log.level=DEBUG
    networks:
      - swarm
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    configs:
      - source: traefik_config
        target: /etc/traefik/traefik.yml
      - source: dynamic_config
        target: /etc/traefik/dynamic_conf.yml
      - source: cert_config
        target: /etc/traefik/certs/wildcard-cert.pem
      - source: key_config
        target: /etc/traefik/certs/wildcard-key.pem
    deploy:
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.traefik-redirect.rule=Host(`traefik.${URLSLUG:-dev}.domain.local`)"
        - "traefik.http.routers.traefik-redirect.entrypoints=web"
        - "traefik.http.routers.traefik-redirect.middlewares=https-redirect"
        - "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
        - "traefik.http.routers.traefik.rule=Host(`traefik.${URLSLUG:-dev}.domain.local`)"
        - "traefik.http.routers.traefik.entrypoints=websecure"
        - "traefik.http.routers.traefik.service=api@internal"
        - "traefik.http.routers.traefik.tls=true"
        - "traefik.http.services.traefik.loadbalancer.server.port=8080"
        - "traefik.docker.network=swarm"
      placement:
        constraints: [node.role==manager]

```

traefik.yml

```auto
providers:
  file:
    directory: /etc/traefik
    filename: dynamic_conf.yml
    watch: true

```

dynamic\_conf.yml

```auto
tls:
  certificates:
    - certFile: /etc/traefik/certs/wildcard-cert.pem
      keyFile: /etc/traefik/certs/wildcard-key.pem

```

and the logs show me nothing. just one entry:

> time="2019-09-27T17:29:42Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"

---

<div class="post-metadata">

**Author:** ![MrAnderson](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MrAnderson](https://community.traefik.io/u/MrAnderson)\
**Post date:** [September 27, 2019, 5:51pm UTC](https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856/4 "2019-09-27T17:51:12Z")

</div>

what i'm seeing is that I cannot connect with https at all, and http throws a 404 on the dashboard url.

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [September 27, 2019, 6:05pm UTC](https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856/5 "2019-09-27T18:05:05Z")

</div>

```auto
    command: --providers.docker \
      --providers.docker.swarmMode \
      --providers.docker.exposedByDefault=false \
      --providers.docker.domain=${URLSLUG:-dev}.domain.local \
      --providers.docker.watch \
      --entryPoints.web.address=:80 \
      --entryPoints.websecure.address=:443 \
      --log.level=DEBUG \
      --providers.file.filename=dynamic_conf.yml

```

and remove `target: /etc/traefik/traefik.yml`

> **[Traefik Configuration Documentation - Traefik](https://doc.traefik.io/traefik/v2.0/getting-started/configuration-overview/)**
>
> Get started with Traefik Proxy. This page will introduce you to the dynamic routing and startup configurations. Read the technical documentation.

> There are three different, **mutually exclusive** (e.g. you can use only one at the same time), ways to define static configuration options in Traefik:

---

<div class="post-metadata">

**Author:** ![MrAnderson](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MrAnderson](https://community.traefik.io/u/MrAnderson)\
**Post date:** [September 27, 2019, 6:31pm UTC](https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856/6 "2019-09-27T18:31:23Z")

</div>

Thanks, I have made this change and I understand the configs now - I thought they were mutually exclusive on a property level. Ok, so with that change in place the service logs this:

> time="2019-09-27T18:27:38Z" level=info msg="Configuration loaded from flags."

the traefik config now looks like:

```auto
    command: --providers.docker \
      --providers.docker.swarmMode \
      --providers.docker.exposedByDefault=false \
      --providers.docker.domain=${URLSLUG:-dev}.domain.local \
      --providers.docker.watch \
      --entryPoints.web.address=:80 \
      --entryPoints.websecure.address=:443 \
      --log.level=DEBUG \
      --providers.file.filename=dynamic_conf.yml

```

and I removed the static yml from the compose. Still nothing though. How do I get it to log more?

---

<div class="post-metadata">

**Author:** ![zespri](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/zespri/32/310_2.png) [@zespri](https://community.traefik.io/u/zespri)\
**Post date:** [September 28, 2019, 12:43am UTC](https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856/7 "2019-09-28T00:43:35Z")

</div>

`-log.level=DEBUG` spits out more on load. If all you seeing is that line above you quoted, you are running with the defaul log level and not `DEBUG`. It suggests that you applied your configuration in one place but looking for logs in another, or that you applied the configuration incorrectly.

---

<div class="post-metadata">

**Author:** ![MrAnderson](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MrAnderson](https://community.traefik.io/u/MrAnderson)\
**Post date:** [September 28, 2019, 8:09pm UTC](https://community.traefik.io/t/migrated-to-v2-in-swarm-cant-load-dashboard/1856/8 "2019-09-28T20:09:48Z")

</div>

I got it working. All I did was convert the flags to a yml file. Thanks for the assistance.
