No ports work for Traefik

I am using Proxmox to host a server. I cam creating a new Alpine LXC container to place the traefik binary. I am using Ansible to build the Alpine container and I am using Ansible to install traefik in that container. I am using the latest version 2.9.6
I have all of this working. Traefik, however, is saying Error while starting server: accept tcp [::]:80: use of closed network connection entryPointName=web for any port I use. have tried from 8081 18080 to 65080 and it always repeats the same error.
I am able to connect to port 80 however in this container from a different machine.
Proxmox server has net.ipv4.ip_forward=1 set

How do I get traefik to work?

traefik.yml.j2

---
entryPoints:
  web:
    address: :80

providers:
  file:
    directory: /etc/traefik/config
    watch: true

api:
  dashboard: false
  insecure: false

serversTransport:
  insecureSkipVerify: true

Log looks like this, I have to stop the command because nothing ever happens

INFO[0000] Configuration loaded from file: /etc/traefik/traefik.yml 
^CERRO[2023-01-05T18:19:15Z] accept tcp [::]:80: use of closed network connection  entryPointName=web
ERRO[2023-01-05T18:19:15Z] close tcp [::]:80: use of closed network connection  entryPointName=web

I setcap with Ansible

    - name: Set port binding capability on Traefik
      community.general.capabilities:
        path: /bin/traefik
        capability: cap_net_bind_service+ep
        state: present

I have also done it manually and it still does not work
setcap CAP_NET_BIND_SERVICE=+eip /bin/traefik

Additionally, I know that Traefik works this way because I've gotten it to work with k8s using this guide: k3s in LXC on Proxmox ยท GitHub
I don't understand why I can't use traefik on any port for this container I've built

Other troubleshooting I've tred
Traefik container run ls | nc -l -p 80

On Proxmox host

nmap 192.168.4.199 -p 80
Starting Nmap 7.80 ( https://nmap.org ) at 2023-01-05 12:30 CST
Nmap scan report for 192.168.4.199
Host is up (0.000038s latency).

PORT   STATE SERVICE
80/tcp open  http
MAC Address: 9A:F1:9A:F5:E0:D6 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.13 seconds

Port 80 is already used, so Traefik can not use it again.

Yes I opened that port with ls | nc -l -p 80 and checked the container from host nmap 192.168.4.199 -p 80 ? I could have done something wrong though

Again, any port it gives the error

traefik:~# traefik
INFO[0000] Configuration loaded from file: /etc/traefik/traefik.yml 
^CERRO[2023-01-05T19:50:36Z] accept tcp [::]:80: use of closed network connection  entryPointName=web
ERRO[2023-01-05T19:50:36Z] close tcp [::]:80: use of closed network connection  entryPointName=web
ERRO[2023-01-05T19:50:36Z] accept tcp [::]:18080: use of closed network connection  entryPointName=test
ERRO[2023-01-05T19:50:36Z] close tcp [::]:18080: use of closed network connection  entryPointName=test

Your issue has been mentioned before (1, 2) without a solution.

There is a post on stackoverflow that hints to a post about health checks not working and Traefik being killed, resulting in that message.

Ah okay, I did the same mistake that other user then. When running it from binary it doesn't have any output (I thought there was some error and immediately closed it). This is expected. If I had more verbose logs I would have noticed it's running - I interpreted that closing message to mean it couldn't access those ports

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.