# Non-existent resolver: using docker + letsencrypt in static config

**URL:** <https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962>\
**Category:** Traefik v2\
**Tags:** letsencrypt-acme, docker\
**Created:** [November 15, 2019, 9:30am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962 "2019-11-15T09:30:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkrenn](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@dkrenn](https://community.traefik.io/u/dkrenn)\
**Post date:** [November 15, 2019, 9:30am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/1 "2019-11-15T09:30:23Z")

</div>

There is a certificate resolver defined in the static config, but it so not found in the dynamic docker config:

```auto
level=error msg="the router testr uses a non-existent resolver: le"

```

Here comes a somehow minimal example: the static config `traefik.yml`:

```auto
entryPoints:
  web:
    address: ':80'
  web-secure:
    address: ':443'
  traefik:
    address: ':8080'

providers:
  docker:
    watch: true
    exposedByDefault: false

api:
  insecure: true
  dashboard: true
  debug: true

certificateResolvers:
  le:
    acme:
      email: daniel@sbgg.ac.at
      storage: /var/lib/letsencrypt/acme.json
      httpChallenge:
        entryPoint: web
      domains:
        - main: something.sbgg.ac.at

log:
  level: DEBUG

```

Here the full `docker-compose`:

```auto
version: '3'

services:
  traefik:
    image: traefik:v2.0.5
    ports:
    - 80:80
    - 443:443
    - 8080:8080 # traefik GUI
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    - ./traefik.yml:/etc/traefik/traefik.yml
    - /srv/data/letsencrypt:/var/lib/letsencrypt/
    restart: always
    networks:
      - webgateway
      
  nginx:
    image: nginx
    ports:
      - 8000:80 # need this
    volumes:
      - /home/user/html/:/usr/share/nginx/html:ro
    restart: always
    labels:
      # traefik basic
      - "traefik.enable=true"
      - "traefik.docker.network=webgateway"
      # traefik actual router
      - "traefik.http.routers.testr.entrypoints=web-secure"
      - "traefik.http.routers.testr.rule=PathPrefix(`/me`)"
      - "traefik.http.routers.testr.tls=true"
      - "traefik.http.routers.testr.tls.certresolver=le"
      # traefik service
      - "traefik.http.services.tests.loadbalancer.server.port=8000"

networks:
  webgateway:
    driver: bridge

```

I have no idea why it doesn't work. Any suggestions?

(This might be related to [Non-existent resolver error with letsencrypt, docker-swarm and traefik v2](https://community.containo.us/t/non-existent-resolver-error-with-letsencrypt-docker-swarm-and-traefik-v2/2070) but the poster there seems to have something working now.)

---

<div class="post-metadata">

**Author:** ![dduportal](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/dduportal/32/4_2.png) [@dduportal](https://community.traefik.io/u/dduportal)\
**Post date:** [November 15, 2019, 10:38am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/2 "2019-11-15T10:38:33Z")

</div>

Hi @dkrenn, there is a typo in your `traefik.yml`: change `certificateResolvers` to `certificatesResolvers` (plural form for the word "certificate").

If it can help further, you can check the reference documentation at any time: [https://docs.traefik.io/v2.0/reference/static-configuration/file/](https://docs.traefik.io/v2.0/reference/static-configuration/file/) (there is a YAML tab).

---

<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:** [November 15, 2019, 10:51am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/3 "2019-11-15T10:51:23Z")

</div>

Hello,

also:

- `domains` cannot be set the `certificatesResolvers` section.
- `- "traefik.http.services.tests.loadbalancer.server.port=8000"` must be `- "traefik.http.services.tests.loadbalancer.server.port=80"` on your nginx container.

---

<div class="post-metadata">

**Author:** ![dkrenn](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@dkrenn](https://community.traefik.io/u/dkrenn)\
**Post date:** [November 15, 2019, 10:56am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/4 "2019-11-15T10:56:49Z")

</div>

Thank you a lot. (Didn't catch this typo, although reading through it a lot.)

---

<div class="post-metadata">

**Author:** ![dkrenn](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@dkrenn](https://community.traefik.io/u/dkrenn)\
**Post date:** [November 15, 2019, 11:14am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/5 "2019-11-15T11:14:56Z")

</div>

> `domains` cannot be set the `certificatesResolvers` section.

Can I set this somewhere else in the static config? (only found the way to specify `Host(...)` in the dynamic docker config, which I do not want as I need this configuration to be independent of the particular host as it is used on different systems.)

---

<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:** [November 15, 2019, 11:16am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/6 "2019-11-15T11:16:56Z")

</div>

It's in the dynamic configuration [https://docs.traefik.io/v2.0/routing/routers/#domains](https://docs.traefik.io/v2.0/routing/routers/#domains)

---

<div class="post-metadata">

**Author:** ![dkrenn](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@dkrenn](https://community.traefik.io/u/dkrenn)\
**Post date:** [November 15, 2019, 11:47am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/7 "2019-11-15T11:47:29Z")

</div>

> [@ldez](#):
>
> - `- "traefik.http.services.tests.loadbalancer.server.port=8000"` must be `- "traefik.http.services.tests.loadbalancer.server.port=80"` on your nginx container.

really? In the `docker-compose.yml` there is

```auto
nginx:
    ports:
      - 8000:80 # need this

```

so I thought port 80 is only inside the container and 8000 is from outside, and that traefik needs to use the port where the container can accessed to and that is the outside port 8000. Am I wrong here?

---

<div class="post-metadata">

**Author:** ![dkrenn](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@dkrenn](https://community.traefik.io/u/dkrenn)\
**Post date:** [November 15, 2019, 11:48am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/8 "2019-11-15T11:48:54Z")

</div>

> [@ldez](#):
>
> It's in the dynamic configuration [Routers | Traefik | v2.0](https://docs.traefik.io/v2.0/routing/routers/#domains)

So, does this imply that there is no way anymore to specify the domain in the static config (like this was the case in traefik:1.7)?

---

<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:** [November 15, 2019, 11:52am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/9 "2019-11-15T11:52:49Z")

</div>

> [@dkrenn](#):
>
> so I thought port 80 is only inside the container and 8000 is from outside, and that traefik needs to use the port where the container can accessed to and that is the outside port 8000. Am I wrong here?

Traefik uses the port inside the container, you don't need to expose it

---

<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:** [November 18, 2019, 10:50pm UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/10 "2019-11-18T22:50:17Z")

</div>

Traefik, would benefit from a config linter, or a log mode where non-existent config values are warned about. There is decent number of issues when stuff is not working because of typo, and traefik silently ignores it.

The workaround currently is to look in the logs the configuration that is dumped there and then compare it with what was provided, it works, but it would be simpler and nicer if there was a mode where traefik would warn about these instances.

---

<div class="post-metadata">

**Author:** ![contractorsagourahil](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@contractorsagourahil](https://community.traefik.io/u/contractorsagourahil)\
**Post date:** [November 10, 2020, 9:26am UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/11 "2020-11-10T09:26:15Z")

</div>

I was facing same problem.. Thank you guys for the solution[.](http://www.contractorsagourahills.com/kitchen.html)

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [November 10, 2020, 10:17pm UTC](https://community.traefik.io/t/non-existent-resolver-using-docker-letsencrypt-in-static-config/2962/12 "2020-11-10T22:17:54Z")

</div>


