Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not listening on port 80 #432

Closed
WTFKr0 opened this issue Jun 2, 2016 · 7 comments
Closed

Not listening on port 80 #432

WTFKr0 opened this issue Jun 2, 2016 · 7 comments

Comments

@WTFKr0
Copy link
Contributor

WTFKr0 commented Jun 2, 2016

Hi

I use traefik on multiple docker envs without problems, but in one it didn't work
I simplify to your docker-compose example, and this is what happen :

cat docker-compose.yml

version: "2"
services:
  traefik:
    image: traefik
    command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /dev/null:/traefik.toml

  whoami1:
    image: emilevauge/whoami
    labels:
      - "traefik.backend=whoami"
      - "traefik.frontend.rule=Host:whoami.docker.localhost"

  whoami2:
    image: emilevauge/whoami
    labels:
      - "traefik.backend=whoami"
      - "traefik.frontend.rule=Host:whoami.docker.localhost"

docker-compose up -d

Creating network "traefikdemo_default" with the default driver
Creating traefikdemo_traefik_1
Creating traefikdemo_whoami2_1
Creating traefikdemo_whoami1_1
# docker port traefikdemo_traefik_1

80/tcp -> 0.0.0.0:80
8080/tcp -> 0.0.0.0:8080

curl -H Host:whoami.docker.localhost http://127.0.0.1

curl: (56) Recv failure: Connection reset by peer

Service seems to not listen on port 80
traefik listen well on port 8080 : 

curl http://127.0.0.1:8080/api

{"docker":{"backends":{"backend-whoami":{"servers":{"server-traefikdemo_whoami1_1":{"url":"http://172.21.0.2:80","weight":1},"server-traefikdemo_whoami2_1":{"url":"http://172.21.0.4:80","weight":1}}}},"frontends":{"frontend-Host-whoami-docker-localhost":{"backend":"backend-whoami","routes":{"route-frontend-Host-whoami-docker-localhost":{"rule":"Host:whoami.docker.localhost"}},"passHostHeader":true}}}}

I test directly on container IP and it seems the conatiner itself is listening only on port 8080, not 80 :

exec 3<>/dev/tcp/172.21.0.3/80; echo $?

bash: connect: Connection refused
bash: /dev/tcp/172.21.0.3/80: Connection refused
1

exec 3<>/dev/tcp/172.21.0.3/8080; echo $?

0

How can I debug why traefik is not listneing on port 80 ?

Env information :

Docker : Server Version: 1.11.1
docker-compose version 1.7.1, build 0a9ab35
traefik        latest       bf7f4f01be40    2 days ago    19.91 MB

Thanx

@emilevauge
Copy link
Member

Hi @WTFKr0, this has been fixed in #428. I will publish the rc2 soon. Sorry for that regression :/

@WTFKr0
Copy link
Contributor Author

WTFKr0 commented Jun 3, 2016

OK good to hear that !
Thanx

@mjgorman
Copy link

mjgorman commented Jun 8, 2016

@emilevauge Just ran into this issue myself. Looks like the official traefik in dockerhub is still busted. Your emilevauge/traefik is working great. Documentation however all uses the official Traefik and causes massive troubleshooting headaches

@emilevauge
Copy link
Member

@mjgorman the dockerhub version will be updated soon ;) docker-library/official-images#1822

@dakkusingh
Copy link

dakkusingh commented Oct 25, 2017

I have the same issue on Mac, using exactly the same docker-compose as above. Any help?

$ docker-compose down && docker-compose up -d
Stopping docker_traefik_1 ... done
Stopping docker_whoami1_1 ... done
Removing docker_traefik_1 ... done
Removing docker_whoami1_1 ... done
Removing network docker_default
Creating network "docker_default" with the default driver
Creating docker_whoami1_1 ...
Creating docker_traefik_1 ...
Creating docker_whoami1_1
Creating docker_traefik_1 ... done

Port info:

80/tcp -> 0.0.0.0:80
8080/tcp -> 0.0.0.0:8080

Docker image info:

REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
traefik                 latest              83df6581f3d9        5 hours ago         45.6MB
emilevauge/whoami       latest              c68795cb48b2        8 months ago        3.88MB

@timoreimann
Copy link
Contributor

@dakkusingh chances are you are affected by a different problem. Join us on Slack for real time help or create a question on Stackoverflow

If you are really certain that this is a bug (either a new one or a regression), please open a new issue.

@dakkusingh
Copy link

Hi Timo,
Thank you, you are correct, my issue didnt seem to be related to this. Although the symptoms were very similar. This is resolved now.

@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants