# Gateway timeout after trying to setup letsencrypt

**URL:** <https://community.traefik.io/t/gateway-timeout-after-trying-to-setup-letsencrypt/4307>\
**Category:** Traefik v2\
**Tags:** letsencrypt-acme, docker\
**Created:** [February 9, 2020, 7:13am UTC](https://community.traefik.io/t/gateway-timeout-after-trying-to-setup-letsencrypt/4307 "2020-02-09T07:13:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BharatKalluri](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bharatkalluri/32/1569_2.png) [@BharatKalluri](https://community.traefik.io/u/BharatKalluri)\
**Post date:** [February 9, 2020, 7:13am UTC](https://community.traefik.io/t/gateway-timeout-after-trying-to-setup-letsencrypt/4307/1 "2020-02-09T07:13:26Z")

</div>

My docker-compose.yml

```auto
version: "3.3"

services:

  traefik:
    image: "traefik:v2.0.0-rc3"
    container_name: "traefik"
    networks:
        - web
    ports:
      - "443:443"
      - "8080:8080"
    volumes:
      - "./letsencrypt:/letsencrypt"
      - $PWD/traefik.toml:/traefik.toml
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

networks:
  web:
    external: true

```

traefik.toml contents

```auto
[global]
  checkNewVersion = true
  sendAnonymousUsage = true
[entryPoints]
  [entryPoints.web]
    address = ":80"
  [entryPoints.websecure]
    address = ":443"
[log]
  level = "DEBUG"
[api]
  dashboard = true
  insecure = true
[ping]
[providers.docker]
	endpoint = "unix:///var/run/docker.sock"
	watch = true
	exposedbydefault = false

[certificatesResolvers.le.acme]
  email = "bharatkalluri@protonmail.com"
  storage = "acme.json"
  [certificatesResolvers.le.acme.httpChallenge]
    entryPoint = "web"
  [certificatesResolvers.le.acme.tlsChallenge]

```

and for one subdomain, my docker-compose file is as follows

```auto
version: '3.6'
services:
  app:
    build: .
    labels:
        - traefik.enable=true
        - traefik.startpage.frontend.rule=Host:start.bharatkalluri.in
        - traefik.startpage.protocol=https
        - traefik.startpage.port=8001
        - traefik.http.routers.startpage.rule=Host(`start.bharatkalluri.in`)
        - traefik.http.routers.startpage.tls=true
        - traefik.http.routers.startpage.tls.certresolver=le
    ports:
      - "8001:8001"
    networks:
      - web
      - default

networks:
  web:
    external: true

```

I am sure there is something wrong as the letsencrypt folder is empty. Every time I hit the HTTPS endpoint, I get a message saying `Gateway timeout`. The website works if I hit it directly using IP and port address, Please let me know where the mistake is.

---

<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:** [February 9, 2020, 3:41pm UTC](https://community.traefik.io/t/gateway-timeout-after-trying-to-setup-letsencrypt/4307/2 "2020-02-09T15:41:03Z")

</div>

Hello,

> [@BharatKalluri](#):
>
> image: "traefik:v2.0.0-rc3"

could you use the latest stable version instead of pretty old RC version:

```auto
traefik:v2.1.4

```

* * *

> [@BharatKalluri](#):
>
> ```auto
> labels:
> - traefik.enable=true
> - traefik.startpage.frontend.rule=Host:start.bharatkalluri.in
> - traefik.startpage.protocol=https
> - traefik.startpage.port=8001
> - traefik.http.routers.startpage.rule=Host(`start.bharatkalluri.in`)
> - traefik.http.routers.startpage.tls=true
> - traefik.http.routers.startpage.tls.certresolver=le
> 
> ```

You mixed configuration from v1 and v2 of Traefik.

```auto
    labels:
        - traefik.enable=true
        - traefik.http.routers.startpage.rule=Host(`start.bharatkalluri.in`)
        - traefik.http.routers.startpage.tls=true
        - traefik.http.routers.startpage.tls.certresolver=le
        - traefik.http.routers.startpage.entrypoints=websecure
        - traefik.http.services.startpage.loadbalancer.server.port=8001

```

* * *

You cannot use the TLS challenge and the HTTP at the same time

```auto
[global]
  checkNewVersion = true
  sendAnonymousUsage = true

[entryPoints]

  [entryPoints.web]
    address = ":80"

  [entryPoints.websecure]
    address = ":443"

[log]
  level = "INFO"

[api]
  insecure = true

[ping]

[providers.docker]
  endpoint = "unix:///var/run/docker.sock"
  exposedbydefault = false

[certificatesResolvers.le.acme]
  email = "bharatkalluri@protonmail.com"
  storage = "acme.json"
  [certificatesResolvers.le.acme.tlsChallenge]

```

---

<div class="post-metadata">

**Author:** ![BharatKalluri](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/bharatkalluri/32/1569_2.png) [@BharatKalluri](https://community.traefik.io/u/BharatKalluri)\
**Post date:** [February 10, 2020, 11:12am UTC](https://community.traefik.io/t/gateway-timeout-after-trying-to-setup-letsencrypt/4307/3 "2020-02-10T11:12:22Z")

</div>

Hi @ldez,

Thanks for taking out time to reply!

As you suggested, I have updated all the files as per your suggestion.

docker-compose.yml

```auto
version: "3.3"

services:

  traefik:
    image: "traefik:v2.1.4"
    container_name: "traefik"
    networks:
        - web
    ports:
      - "443:443"
      - "8080:8080"
    volumes:
      - "./letsencrypt:/letsencrypt"
      - $PWD/traefik.toml:/traefik.toml
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

networks:
  web:
    external: true

```

traefik.toml

```auto
[global]
  checkNewVersion = true
  sendAnonymousUsage = true
[entryPoints]
  [entryPoints.web]
    address = ":80"
  [entryPoints.websecure]
    address = ":443"
[log]
  level = "DEBUG"
[api]
  dashboard = true
  insecure = true
[ping]
[providers.docker]
	endpoint = "unix:///var/run/docker.sock"
	watch = true
	exposedbydefault = false

[certificatesResolvers.le.acme]
  email = "bharatkalluri@protonmail.com"
  storage = "acme.json"
  [certificatesResolvers.le.acme.tlsChallenge]

```

My website's docker-compose.yml

```auto
version: "3.6"
services:
  app:
    build: .
    ports:
      - "8001:8001"
    labels:
      - traefik.enable=true
      - traefik.http.routers.startpage.rule=Host(`start.bharatkalluri.in`)
      - traefik.http.routers.startpage.tls=true
      - traefik.http.routers.startpage.tls.certresolver=le
      - traefik.http.services.startpage.loadbalancer.server.port=8001
networks:
  web:
    external: true

```

Now when I hit the IP and port, the website is up. But on https it times out, and on http it fails to connect.

Update: I removed the `network:web` everywhere to test. Now the certificate served for start.bharatkalluri.in is `TRAEFIK DEFAULT CERT` , and if the website still times out (504: Gateway time out).  
Update 2: After digging through logs, I found this `Error creating new order :: too many certificates already issued for exact set of domains: start.bharatkalluri.in: see https://letsencrypt.org/docs/rate-limits/, url: " routerName=startpage@docker rule="Host(`start.bharatkalluri.in`)" providerName=le.acme,` . Apparently I hit the rate limit, although I am not sure how. Even if I live with the default traefik certificate, I still am hitting gateway timeout. Any suggestions as to how I can fix this?
