2.3 - Errors on container start: Is this someting to worry about?

Recently got a fresh Traefik v2 configuration up-and-running in Docker and everything is working, however I'm getting some strange error messages in the logs whenever I start the Traefik container:

time="2020-11-03T15:13:13Z" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=web
time="2020-11-03T15:13:13Z" level=error msg="Error while starting server: accept tcp [::]:80: use of closed network connection" entryPointName=web
time="2020-11-03T15:13:13Z" level=error msg="accept tcp [::]:443: use of closed network connection" entryPointName=websecure
time="2020-11-03T15:13:13Z" level=error msg="Error while starting server: accept tcp [::]:443: use of closed network connection" entryPointName=websecure
time="2020-11-03T15:13:13Z" level=error msg="accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
time="2020-11-03T15:13:13Z" level=error msg="Error while starting server: accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
time="2020-11-03T15:13:13Z" level=error msg="Error while starting server: http: Server closed" entryPointName=web
time="2020-11-03T15:13:13Z" level=error msg="Error while starting server: http: Server closed" entryPointName=websecure
time="2020-11-03T15:13:13Z" level=error msg="Error while starting server: http: Server closed" entryPointName=traefik
time="2020-11-03T15:13:27Z" level=info msg="Configuration loaded from file: /traefik.toml"

Traefik is forwarding connections properly to all my containers and I can access the dashboard, but I don't like error messages in my logs.

Does anyone know what might be the cause of these errors? Any idea how to resolve?

Configuration files below:

docker-compose.yml

version: '3'

services:
  reverse-proxy:
    container_name: traefik2.3
    image: traefik:v2.3
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock'
      - "$PWD/traefik.toml:/traefik.toml"
      - "$PWD/acme.json:/acme.json"
      - "$PWD/tls-options.toml:/tls-options.toml"
    labels:
      - "traefik.http.routers.dashboard.rule=Host(`traefik.[DOMAIN]`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.middlewares=auth"
      - "traefik.http.middlewares.auth.basicauth.users=[CREDENTIALS]/"
    networks:
      - web
    restart: unless-stopped

networks:
  web:
    external: true

traefik.toml

[global]
  checkNewVersion = true

[entryPoints]
  [entryPoints.web]
    address = ":80"

    [entryPoints.web.http]
    [entryPoints.web.http.redirections]
      [entryPoints.web.http.redirections.entryPoint]
        to = "websecure"
        scheme = "https"

  [entryPoints.websecure]
    address = ":443"

      [entryPoints.websecure.http.tls]
        certResolver = "leresolver"
        options = "raydefault@file"


[certificatesResolvers.leresolver.acme]
  email = "[EMAIL]"
  storage = "acme.json"
  [certificatesResolvers.leresolver.acme.tlsChallenge]

[log]

# Enable API and dashboard
[api]
  dashboard = true

# Enable ping
[ping]

# Enable Docker configuration backend
[providers.docker]
  endpoint = "unix:///var/run/docker.sock"
  exposedByDefault = true
  network = "web"
  watch = true

[providers.file]
  filename = "/tls-options.toml"
  watch = "true"

Thank you!

2 Likes

Hey there I am having a similar issue as well so I am highlighting it here in case it may help you and myself find a resolution quicker and as a bump for your thread since its a related issue.

~$ docker service logs -f traefik_traefik | grep -i error
traefik_traefik.1.o7wrc931rv1z@ninjaserver    | time="2020-11-09T05:09:28Z" level=error msg="accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
traefik_traefik.1.o7wrc931rv1z@ninjaserver    | time="2020-11-09T05:09:28Z" level=error msg="close tcp [::]:8080: use of closed network connection" entryPointName=traefik
traefik_traefik.1.o7wrc931rv1z@ninjaserver    | time="2020-11-09T05:09:28Z" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=http
traefik_traefik.1.o7wrc931rv1z@ninjaserver    | time="2020-11-09T05:09:28Z" level=error msg="close tcp [::]:80: use of closed network connection" entryPointName=http
traefik_traefik.1.o7wrc931rv1z@ninjaserver    | time="2020-11-09T05:09:28Z" level=error msg="close tcp [::]:443: use of closed network connection" entryPointName=https
traefik_traefik.1.o7wrc931rv1z@ninjaserver    | time="2020-11-09T05:09:28Z" level=error msg="accept tcp [::]:443: use of closed network connection" entryPointName=https

I don't seem to have dashboard access but it seems the issues may be similar. I have shared my original configuration on separate thread for reference if it helps.

Did you ever find out what is causing those errors? I have the same issue, errors but I can reach everything behind Traefik.

time="2021-02-20T08:10:30-06:00" level=error msg="accept tcp [::]:443: use of closed network connection" entryPointName=websecure
time="2021-02-20T08:10:30-06:00" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=web
time="2021-02-20T08:10:30-06:00" level=error msg="Error while starting server: http: Server closed" entryPointName=web
time="2021-02-20T08:10:30-06:00" level=error msg="Error while starting server: http: Server closed" entryPointName=web
time="2021-02-20T08:10:30-06:00" level=error msg="Error while starting server: http: Server closed" entryPointName=websecure
time="2021-02-20T08:10:30-06:00" level=error msg="Error while starting server: http: Server closed" entryPointName=websecure
time="2021-02-20T08:10:30-06:00" level=error msg="close tcp [::]:443: use of closed network connection" entryPointName=websecure
time="2021-02-20T08:10:30-06:00" level=error msg="close tcp [::]:80: use of closed network connection" entryPointName=web

Comment for bump :smiley:
Same on my side.

I have solved this issue.
To do that I have done few things (so not sure what was the root cause):

  • changed challenge method from TLS to HTTP,
  • changed configuration source from flags to a yaml file - for ease of change
  • slight change in networking,

As each set up is different I would recommend to just go through below repo and compare general assumptions, as I did,

Traefik Dockerized

Good luck!

Hi,
could you please explain what "slight changes" you've done in networking?
I'm asking because changes TLS to HTTP and flags to yaml doesn't help. Also, I have the same config in terms of networking as you've published on Github but I still have the same errors in the log file.

I think Traefik tries to start on ipv6 interface and it fails of course. Maybe I'm wrong.

1 Like

I'd like to know too - I'm having the same issues all of a sudden and can't see what is causing it.

Hi! I just encountered this issue and the root cause was the readiness and liveness probes checking /ping on the traefik port. Basically what the error message means is, that those listening sockets have been externally closed, in my case due to the pod being terminated because it did not become ready.

The actual root cause was related to this:

where the most important point is, that mixing cli and yaml configuration will not work, as yaml will always supersede the command line flags

Hope this helps someone.

1 Like