# Port is missing docker swarm

**URL:** <https://community.traefik.io/t/port-is-missing-docker-swarm/1685>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [September 18, 2019, 2:51pm UTC](https://community.traefik.io/t/port-is-missing-docker-swarm/1685 "2019-09-18T14:51:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fenpaws](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/fenpaws/32/716_2.png) [@fenpaws](https://community.traefik.io/u/fenpaws)\
**Post date:** [September 18, 2019, 2:51pm UTC](https://community.traefik.io/t/port-is-missing-docker-swarm/1685/1 "2019-09-18T14:51:45Z")

</div>

Hello there,

first of all hi!  
This is my first post here and I hope I make it right. I tried to fix this odd issue now for more than 3h and nothing, I searched online and even here. I found people that had the same problem and I tried the fix people provided, but still nothing.

So maybe someone can help me here.

> **This is my traefik docker stack file**
>
> ```auto
> version: "3"
> services:
> traefik:
> image: traefik:2.0.0
> command:
> # defines all entryPoints
> - --entryPoints.web.address=:80
> - --entryPoints.websecure.address=:443
> - --entryPoints.minecraft.address=:25565
> 
> # https/ssl certificat settings
> # - --certificatesResolvers.sample.acme.email="no-reply@fenpa.ws"
> # - --certificatesResolvers.sample.acme.storage="acme.json"
> 
> # used during the challenge
> # - --certificatesResolvers.sample.acme.httpChallenge.entryPoint=web
> 
> # file provider for manuel config
> - --providers.file.filename=/etc/traefik/dynamic_conf.toml
> - --providers.file.watch=true
> 
> # enabled docker provide
> - --providers.docker
> - --providers.docker.swarmMode=true
> - --providers.docker.watch=true
> 
> # api on http
> - --api.insecure=true
> 
> # mettics for Prometheus
> - --metrics.prometheus=true
> - --metrics.prometheus.buckets=0.100000, 0.300000, 1.200000, 5.000000
> environment:
> - TZ=Europe/Berlin
> ports:
> - 80:80
> - 443:443
> - 8080:8080
> volumes:
> - traefic_vol:/etc/traefik/acme
> - /var/run/docker.sock:/var/run/docker.sock
> - /home/docker/dynamic_conf.toml:/etc/traefik/dynamic_conf.toml
> networks:
> - traefik-net
> deploy:
> mode: global
> placement:
> constraints:
> - node.role == manager
> update_config:
> parallelism: 1
> delay: 10s
> restart_policy:
> condition: on-failure
> volumes:
> traefic_vol:
> networks:
> traefik-net:
> external: true
> monitor-net:
> external: true
> 
> ```

> **this is my prometheus docker stack file**
>
> ```auto
> version: "3"
> services:
> prometheus:
> image: prom/prometheus
> labels:
> - traefik.enable=true
> - traefik.http.routers.prometheus.rule=Host(`prometheus.localhost`)
> - traefik.http.routers.prometheus.entrypoints=web
> - traefik.http.routers.prometheus.service=prometheus-backend
> - traefik.http.services.prometheus-backend.loadbalancer.server.port=9090 
> environment:
> - TZ=Europe/Berlin
> networks: 
> - monitor-net
> - traefik-net
> deploy:
> mode: global
> placement:
> constraints:
> - node.role == manager
> update_config:
> parallelism: 1
> delay: 10s
> restart_policy:
> condition: on-failure
> volumes:
> - /home/docker/prometheus.yml:/etc/prometheus/prometheus.yml
> networks:
> traefik-net:
> external: true
> monitor-net:
> external: true
> 
> ```

i try to get this working but everytime I get the error

```auto
level=error msg="port is missing" providerName=docker container=monitoring_prometheus-qec5jl2ef63ly1kbo2k9cuibr

```

what am I doing wrong? idont have any ideas anymore

---

<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 18, 2019, 2:59pm UTC](https://community.traefik.io/t/port-is-missing-docker-swarm/1685/2 "2019-09-18T14:59:17Z")

</div>

Duplicate of:

- [[v2.0-alpha7] docker swarm provider - "port is missing"](https://community.containo.us/t/v2-0-alpha7-docker-swarm-provider-port-is-missing/827)
- [Missing port in traefik v2 swarm mode](https://community.containo.us/t/missing-port-in-traefik-v2-swarm-mode/1386)

---

<div class="post-metadata">

**Author:** ![fenpaws](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/fenpaws/32/716_2.png) [@fenpaws](https://community.traefik.io/u/fenpaws)\
**Post date:** [September 18, 2019, 3:09pm UTC](https://community.traefik.io/t/port-is-missing-docker-swarm/1685/3 "2019-09-18T15:09:42Z")

</div>

Already tried these but thanks, if i missed something please tell me

---

<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 18, 2019, 3:17pm UTC](https://community.traefik.io/t/port-is-missing-docker-swarm/1685/4 "2019-09-18T15:17:29Z")

</div>

In swarm mode, the labels must be placed inside the `deploy` section.

---

<div class="post-metadata">

**Author:** ![fenpaws](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/fenpaws/32/716_2.png) [@fenpaws](https://community.traefik.io/u/fenpaws)\
**Post date:** [September 19, 2019, 6:46am UTC](https://community.traefik.io/t/port-is-missing-docker-swarm/1685/5 "2019-09-19T06:46:59Z")

</div>

Thank you, i try this out today and repot if this worked.
