Docker instance of Traefik shutting down on it's own

Hey there, i'm setting up my homelab with Traefik, simple reverse proxy from subdomain to internal ports through a docker network, but when i leave my instance of Traefik up for a long-ish period of time it stops itself out of nowhere, here are my docker-compose for traefik, a service i'm running that is proxied by traefik for example of usage and the log at shutdown moment:

Traefik:

version: '3'
services:
  traefik:
    image: "traefik:latest"
    container_name: "traefik"
    command:
      - "--log.level=DEBUG"
      - "--api.dashboard=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.network=reverseproxy-nw"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      
      #- "--entrypoints.websecure.address=:443"

      # cert resolver
      #- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
      #- "--certificatesresolvers.myresolver.acme.caserver=https://acme-v02.api.letsencrypt.org/directory"
      #- "--certificatesresolvers.myresolver.acme.email=email@example.com"
      #- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
    ports:
      - "443:443"
      - "80:80"
      - "8080:8080"
    volumes:
      - "/home/gustavo/aplications/traefik/letsencrypt:/letsencrypt"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.dashboard.rule=Host(`traefik.domain.com`)"
      - "traefik.http.routers.dashboard.entrypoints=web"
      - "traefik.http.services.dashboard.loadbalancer.server.port=8080"
    networks:
      - reverseproxy-nw
    
networks:
  reverseproxy-nw:
    name: reverseproxy-nw
    external: true

PS: Commented lines are for enabling SSL certificates once i can lay down the foundation and iron out all the "unwanted behaviours".

Portainer:

version: '3.3'
services:
    portainer:
        labels:
            - "traefik.http.routers.portainer.rule=Host(`portainer.domain.com`)"
            - "traefik.http.routers.portainer.entrypoints=web"
            - "traefik.http.services.portainer.loadbalancer.server.port=9000"
            - "traefik.enable=true"
        container_name: portainer
        command: -H unix:///var/run/docker.sock
        ports:
            - '8000:8000'
            - '9000:9000'
        restart: always
        volumes:
            - '/var/run/docker.sock:/var/run/docker.sock'
            - './portainer_data:/data'
        image: portainer/portainer-ce
        environment:
            - VIRTUAL_HOST=portainer.domain.com
            - VIRTUAL_PORT=9000
        networks:
            - reverseproxy-nw

networks:
  reverseproxy-nw:
    external: true

Logs for the moment of shutdown:

time="2023-01-03T17:34:12Z" level=error msg="Error while Peeking first byte: read tcp 172.25.0.3:80->200.71.120.196:42276: read: connection timed out"
time="2023-01-03T17:59:52Z" level=debug msg="'499 Client Closed Request' caused by: context canceled"
time="2023-01-03T18:32:27Z" level=info msg="I have to go..."
time="2023-01-03T18:32:27Z" level=info msg="Stopping server gracefully"
time="2023-01-03T18:32:28Z" level=debug msg="Waiting 10s seconds before killing connections." entryPointName=traefik
time="2023-01-03T18:32:28Z" level=debug msg="Waiting 10s seconds before killing connections." entryPointName=web
time="2023-01-03T18:32:28Z" level=error msg="accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
time="2023-01-03T18:32:28Z" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=web
time="2023-01-03T18:32:28Z" level=error msg="close tcp [::]:80: use of closed network connection" entryPointName=web
time="2023-01-03T18:32:28Z" level=debug msg="Entry point web closed" entryPointName=web
time="2023-01-03T18:32:28Z" level=error msg="close tcp [::]:8080: use of closed network connection" entryPointName=traefik
time="2023-01-03T18:32:28Z" level=debug msg="Entry point traefik closed" entryPointName=traefik
time="2023-01-03T18:32:28Z" level=info msg="Server stopped"
time="2023-01-03T18:32:28Z" level=info msg="Shutting down"

I've placed a few lines before so it shows that there are no prior messages that would explain that behaviour.

I've tried to understand what is causing it from the code but my go skills are questionable at best :confused:.

Can you make sure to run the latest release, either by using a release tag or running a docker pull on the latest image.

If the problem still exists, I would open an issue on GitHub.

1 Like

Thanks for the reply, I forgot about placing the version being used, currently the image is on version 2.9.6.

I thought about opening an issue on GitHub but wanted to make sure it wasn't something obvious I was missing :sweat_smile:. I'll go ahead and open one, thanks!