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

Fix empty IP for backend when dnsrr in Docker swarm mode #2869

Closed
caseycs opened this issue Feb 16, 2018 · 1 comment
Closed

Fix empty IP for backend when dnsrr in Docker swarm mode #2869

caseycs opened this issue Feb 16, 2018 · 1 comment
Assignees
Labels
area/provider/docker/swarm kind/bug/confirmed a confirmed bug (reproducible). priority/P2 need to be fixed in the future status/5-frozen-due-to-age
Milestone

Comments

@caseycs
Copy link
Contributor

caseycs commented Feb 16, 2018

Do you want to request a feature or report a bug?

I'd like to report a bug.

What did you do?

I made a fresh ubuntu setup, applied the last updates(apt-get update && apt dist-upgrade):

ubuntu@ubuntu-xenial:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.3 LTS
Release:	16.04
Codename:	xenial
ubuntu@ubuntu-xenial:~$ uname -a
Linux ubuntu-xenial 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Then I installed latest docker:

ubuntu@ubuntu-xenial:~$ docker --version
Docker version 17.12.0-ce, build c97c6d6

And configured it to swarm mode:

sudo docker swarm init

Started 4 instances of simple service:

sudo docker service create --name nginx \
  --endpoint-mode dnsrr \
  --label traefik.frontend.rule=Host:test.test.nl \
  --label traefik.port=80 \
  nginx:alpine \
  && sudo docker service scale nginx=4

Downloaded last traefik release binary - 1.5.2.

Made a config file:

debug = true
[entryPoints]
    [entryPoints.http]
    address = ":80"

[docker]
endpoint = "unix:///var/run/docker.sock"
watch = true
swarmmode = true

Then I run traefik:

ubuntu@ubuntu-xenial:~$ sudo ./traefik_linux-amd64 -c traefik.toml
INFO[2018-02-16T10:23:10Z] Using TOML configuration file /home/ubuntu/traefik.toml
INFO[2018-02-16T10:23:10Z] Traefik version v1.5.2 built on 2018-02-12_10:56:31AM

What did you expect to see?

I expected to see correct container ip addresses as backend endpoints.

What did you see instead?

Creating server server-nginx-1 at http://:80

...
DEBU[2018-02-16T10:23:10Z] Configuration received from provider docker: {"backends":{"backend-nginx":{"servers":{"server-nginx-1":{"url":"http://:80","weight":0},"server-nginx-2":{"url":"http://:80","weight":0},"server-nginx-3":{"url":"http://:80","weight":0},"server-nginx-4":{"url":"http://:80","weight":0}},"loadBalancer":{"method":"wrr"}}},"frontends":{"frontend-Host-test-test-nl-0":{"entryPoints":["http"],"backend":"backend-nginx","routes":{"route-frontend-Host-test-test-nl-0":{"rule":"Host:test.test.nl"}},"passHostHeader":true,"priority":0,"basicAuth":[]}}}
DEBU[2018-02-16T10:23:10Z] Creating frontend frontend-Host-test-test-nl-0
DEBU[2018-02-16T10:23:10Z] Wiring frontend frontend-Host-test-test-nl-0 to entryPoint http
DEBU[2018-02-16T10:23:10Z] Creating route route-frontend-Host-test-test-nl-0 Host:test.test.nl
DEBU[2018-02-16T10:23:10Z] Creating backend backend-nginx
DEBU[2018-02-16T10:23:10Z] Creating load-balancer wrr
DEBU[2018-02-16T10:23:10Z] Creating server server-nginx-1 at http://:80 with weight 0
DEBU[2018-02-16T10:23:10Z] Creating server server-nginx-2 at http://:80 with weight 0
DEBU[2018-02-16T10:23:10Z] Creating server server-nginx-3 at http://:80 with weight 0
DEBU[2018-02-16T10:23:10Z] Creating server server-nginx-4 at http://:80 with weight 0...

Output of traefik version: (What version of Traefik are you using?)

ubuntu@ubuntu-xenial:~$ ./traefik_linux-amd64 version
Version:      v1.5.2
Codename:     cancoillotte
Go version:   go1.9.4
Built:        2018-02-12_10:56:31AM
OS/Arch:      linux/amd64

What is your environment & configuration (arguments, toml, provider, platform, ...)?

debug = true
[entryPoints]
    [entryPoints.http]
    address = ":80"

[docker]
endpoint = "unix:///var/run/docker.sock"
watch = true
swarmmode = true

If applicable, please paste the log output in debug mode (--debug switch)

ubuntu@ubuntu-xenial:~$ sudo ./traefik_linux-amd64 -c traefik.toml  --debug
INFO[2018-02-16T10:25:27Z] Using TOML configuration file /home/ubuntu/traefik.toml
INFO[2018-02-16T10:25:27Z] Traefik version v1.5.2 built on 2018-02-12_10:56:31AM
INFO[2018-02-16T10:25:27Z]
Stats collection is disabled.
Help us improve Traefik by turning this feature on :)
More details on: https://docs.traefik.io/basics/#collected-data

DEBU[2018-02-16T10:25:27Z] Global configuration loaded {"LifeCycle":{"RequestAcceptGraceTimeout":0,"GraceTimeOut":0},"GraceTimeOut":0,"Debug":true,"CheckNewVersion":true,"SendAnonymousUsage":false,"AccessLogsFile":"","AccessLog":null,"TraefikLogsFile":"","TraefikLog":null,"LogLevel":"DEBUG","EntryPoints":{"http":{"Network":"","Address":":80","TLS":null,"Redirect":null,"Auth":null,"WhitelistSourceRange":null,"Compress":false,"ProxyProtocol":null,"ForwardedHeaders":{"Insecure":true,"TrustedIPs":null}}},"Cluster":null,"Constraints":[],"ACME":null,"DefaultEntryPoints":["http"],"ProvidersThrottleDuration":2000000000,"MaxIdleConnsPerHost":200,"IdleTimeout":0,"InsecureSkipVerify":false,"RootCAs":null,"Retry":null,"HealthCheck":{"Interval":30000000000},"RespondingTimeouts":null,"ForwardingTimeouts":null,"Web":null,"Docker":{"Watch":true,"Filename":"","Constraints":null,"Trace":false,"DebugLogGeneratedTemplate":false,"Endpoint":"unix:///var/run/docker.sock","Domain":"","TLS":null,"ExposedByDefault":true,"UseBindPortIP":false,"SwarmMode":true},"File":null,"Marathon":null,"Consul":null,"ConsulCatalog":null,"Etcd":null,"Zookeeper":null,"Boltdb":null,"Kubernetes":null,"Mesos":null,"Eureka":null,"ECS":null,"Rancher":null,"DynamoDB":null,"ServiceFabric":null,"Rest":null,"API":null,"Metrics":null,"Ping":null}
INFO[2018-02-16T10:25:27Z] Preparing server http &{Network: Address::80 TLS:<nil> Redirect:<nil> Auth:<nil> WhitelistSourceRange:[] Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc420606e00} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s
INFO[2018-02-16T10:25:27Z] Starting provider *docker.Provider {"Watch":true,"Filename":"","Constraints":null,"Trace":false,"DebugLogGeneratedTemplate":false,"Endpoint":"unix:///var/run/docker.sock","Domain":"","TLS":null,"ExposedByDefault":true,"UseBindPortIP":false,"SwarmMode":true}
INFO[2018-02-16T10:25:27Z] Starting server on :80
DEBU[2018-02-16T10:25:27Z] Provider connection established with docker 17.12.0-ce (API 1.35)
DEBU[2018-02-16T10:25:27Z] Could not load traefik.frontend.whitelistSourceRange labels
DEBU[2018-02-16T10:25:27Z] Could not load traefik.frontend.entryPoints labels
DEBU[2018-02-16T10:25:27Z] Could not load traefik.frontend.auth.basic labels
DEBU[2018-02-16T10:25:27Z] Validation of load balancer method for backend backend-nginx failed: invalid load-balancing method ''. Using default method wrr.
DEBU[2018-02-16T10:25:27Z] Configuration received from provider docker: {"backends":{"backend-nginx":{"servers":{"server-nginx-1":{"url":"http://:80","weight":0},"server-nginx-2":{"url":"http://:80","weight":0},"server-nginx-3":{"url":"http://:80","weight":0},"server-nginx-4":{"url":"http://:80","weight":0}},"loadBalancer":{"method":"wrr"}}},"frontends":{"frontend-Host-test-test-nl-0":{"entryPoints":["http"],"backend":"backend-nginx","routes":{"route-frontend-Host-test-test-nl-0":{"rule":"Host:test.test.nl"}},"passHostHeader":true,"priority":0,"basicAuth":[]}}}
DEBU[2018-02-16T10:25:27Z] Creating frontend frontend-Host-test-test-nl-0
DEBU[2018-02-16T10:25:27Z] Wiring frontend frontend-Host-test-test-nl-0 to entryPoint http
DEBU[2018-02-16T10:25:27Z] Creating route route-frontend-Host-test-test-nl-0 Host:test.test.nl
DEBU[2018-02-16T10:25:27Z] Creating backend backend-nginx
DEBU[2018-02-16T10:25:27Z] Creating load-balancer wrr
DEBU[2018-02-16T10:25:27Z] Creating server server-nginx-3 at http://:80 with weight 0
DEBU[2018-02-16T10:25:27Z] Creating server server-nginx-4 at http://:80 with weight 0
DEBU[2018-02-16T10:25:27Z] Creating server server-nginx-1 at http://:80 with weight 0
DEBU[2018-02-16T10:25:27Z] Creating server server-nginx-2 at http://:80 with weight 0
INFO[2018-02-16T10:25:27Z] Server configuration reloaded on :80
^CINFO[2018-02-16T10:25:27Z] I have to go... interrupt
INFO[2018-02-16T10:25:27Z] Stopping server gracefully
DEBU[2018-02-16T10:25:27Z] Waiting 0s seconds before killing connections on entrypoint http...
DEBU[2018-02-16T10:25:27Z] Entrypoint http closed
INFO[2018-02-16T10:25:27Z] Server stopped
INFO[2018-02-16T10:25:27Z] Shutting down
@ldez ldez added priority/P2 need to be fixed in the future kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. and removed status/0-needs-triage labels Feb 19, 2018
@mmatur mmatur added kind/bug/confirmed a confirmed bug (reproducible). and removed kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. labels Feb 19, 2018
@traefiker
Copy link
Contributor

Closed by #2887.

@traefiker traefiker added this to the 1.5 milestone Feb 20, 2018
@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.
Labels
area/provider/docker/swarm kind/bug/confirmed a confirmed bug (reproducible). priority/P2 need to be fixed in the future status/5-frozen-due-to-age
Projects
None yet
Development

No branches or pull requests

4 participants