coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
34.5k stars 1.88k forks source link

[Bug]: traefix migration not working #437

Closed narduin closed 2 years ago

narduin commented 2 years ago

Is there an existing issue for this?

Description

I installed a fresh coolify instance this morning v2.8.2. All worked great. I saw the v2.9.1 update and installed it. All seemed ok for a bit.

However, coolify was no accessible through the fqdn anymore. docker ps showed coollabsio/coolify-haproxy-tcp-alpine:latest but no mention of traefik.

I tried to remove and add the fqdn again but it did not change, I tried to go back to haproxy but it did not work. I then saw that the Use Coolify Proxy? setting was unchecked in the local docker destination.

When trying to activate it, I got a different error depending on what proxy was selected.

traefik

Error: Command failed: DOCKER_HOST="unix:///var/run/docker.sock" docker run -restart always -add-host 'host.docker.internal:host-gateway' -add-host 'host.docker.internal:172.17.0.1' -v coolify-traefik-letsencrypt:/etc/traefik/acme -v /var/run/docker.sock:/var/run/docker.sock -network coolify-infra -p "80:80" -p "443:443" -p "8080:8080" -name coolify-proxy -d traefik:v2.6 -api.insecure=true -entrypoints.web.address=:80 -entrypoints.websecure.address=:443 -providers.docker=true -providers.docker.exposedbydefault=false -providers.http.endpoint=http://coolify:3000/webhooks/traefik/main.json -providers.http.pollTimeout=5s -certificatesresolvers.letsencrypt.acme.httpchallenge=true -certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json -certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web -log.level=error docker: Error response from daemon: driver failed programming external connectivity on endpoint coolify-proxy (840cd046907a898127de21b6fd512ef89b029fe6705299753ad586f0b5592c72): Error starting userland proxy: listen tcp4 0.0.0.0:8080: bind: address already in use.

haproxy

Error: Command failed: DOCKER_HOST="unix:///var/run/docker.sock" docker run -restart always -add-host 'host.docker.internal:host-gateway' -add-host 'host.docker.internal:172.17.0.1' -v coolify-ssl-certs:/usr/local/etc/haproxy/ssl -network coolify-infra -p "80:80" -p "443:443" -p "8404:8404" -p "5555:5555" -p "5000:5000" -name coolify-haproxy -d coollabsio/coolify-haproxy-alpine:latest docker: Error response from daemon: Conflict. The container name "/coolify-haproxy" is already in use by container "1614bf4bddc638920e15d1b68dda7db95cfcb0a87342ee8149a740361892dfca". You have to remove (or rename) that container to be able to reuse that name. See 'docker run -help'. 

Steps To Reproduce

  1. update to coolify v2.9.1
  2. migrate from haproxy to traefik

Version

2.9.1

andrasbacsai commented 2 years ago

Hey, sorry about that. The problem could be caused by that the old proxy stopping too slowly.

Could you please go to the settings menu and migrate the proxy back to haproxy > wait a minute > then migrate to traefik?

It should solve the issue. Let me know if it does not.

narduin commented 2 years ago

Hi, thanks for the quick response. I tried your steps with a long delay between each but no luck.

I'm still getting this error when I try to enable the proxy in the local docker destination:

Error: Command failed: DOCKER_HOST="unix:///var/run/docker.sock" docker run -restart always -add-host 'host.docker.internal:host-gateway' -add-host 'host.docker.internal:172.17.0.1' -v coolify-traefik-letsencrypt:/etc/traefik/acme -v /var/run/docker.sock:/var/run/docker.sock -network coolify-infra -p "80:80" -p "443:443" -p "8080:8080" -name coolify-proxy -d traefik:v2.6 -api.insecure=true -entrypoints.web.address=:80 -entrypoints.websecure.address=:443 -providers.docker=true -providers.docker.exposedbydefault=false -providers.http.endpoint=http://coolify:3000/webhooks/traefik/main.json -providers.http.pollTimeout=5s -certificatesresolvers.letsencrypt.acme.httpchallenge=true -certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json -certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web -log.level=error docker: Error response from daemon: driver failed programming external connectivity on endpoint coolify-proxy (28a489ca7e80a71933d301790e44c34510429b6f366aba546964b9e5d7614fbc): Error starting userland proxy: listen tcp4 0.0.0.0:8080: bind: address already in use. 

docker ps still does not show any traefik container.

andrasbacsai commented 2 years ago

Hmm, it looks like something is running on port 8080 on your server?

andrasbacsai commented 2 years ago

I released a fix; could you please check it now? You can always reach your Coolify dashboard with IP and on port 3000.

narduin commented 2 years ago

It's all fixed! I just had to update and then enable the proxy in the local docker destination and it just worked! Awesome work thanks a lot!

edit: the v2.9.2 fixed this issue, updating now to v2.9.3