traefik: Backend stickiness not working
Do you want to request a feature or report a bug?
Bug
What did you do?
Using traefik 1.7.0 rc3, and the load balancer stickiness setting, it is not applying the stickiness when proxying two IIS web servers that are using Windows Authentication. The windows authentication piece sends two 401 requests to the backend server to establish the “session” but traefik is sending the two requests to the two different backend servers. I have verified in the logs that it says "Sticky session with cookie " and so I think the configuration is being read correctly by traefik. Could traefik not be inserting the cookie on 401 requests?
What did you expect to see?
Expected to see the multiple requests from the same client directed to the same backend server
What did you see instead?
Multiple requests from the same client went to different backend servers
Output of traefik version
: (What version of Traefik are you using?)
Version: v1.7.0-rc3
Codename: maroilles
Go version: go1.10.3
Built: 2018-08-01_01:37:51PM
OS/Arch: linux/amd64
What is your environment & configuration (arguments, toml, provider, platform, …)?
[backends.XXX]
[backends.XXX.loadbalancer]
method = "wrr"
[backends.XXX.loadbalancer.stickiness]
cookieName = "__trae_proxy"
[backends.XXX.healthcheck]
path = "/"
interval = "5s"
[backends.XXX.servers.test01]
url = "http://test01:80"
[backends.XXX.servers.test0]
url = "http://test02:80"
If applicable, please paste the log output at DEBUG level (--logLevel=DEBUG
switch)
time="2018-08-16T13:04:49-05:00" level=debug msg="Creating backend test"
time="2018-08-16T13:04:49-05:00" level=debug msg="Creating load-balancer drr"
time="2018-08-16T13:04:49-05:00" level=debug msg="Sticky session with cookie __trae_proxy"
time="2018-08-16T13:04:49-05:00" level=debug msg="Creating server test02 at http://test02:80 with weight 0"
time="2018-08-16T13:04:49-05:00" level=debug msg="Creating server test01 at http://test01:80 with weight 0"
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (6 by maintainers)
I have the same problem. Backend stickyness as described in the documentation does not work with 1.7, while it works with 1.6 with the same configuration.
linked to #3975
If it helps to track down the issue, I’ve just tried to deploy our app in JBoss EAP 7 and I can confirm the behaviour reported by @seeruk .
Using the new stickiness property
traefik.backend.loadbalancer.stickiness=true
does NOT work. Switching totraefik.backend.loadbalancer.sticky=true
makes Traefik show the cookie name in the log and session stickiness works as expected.This issue though doesn’t seem to affect the Swarm mode example shown in the official Swarm example. I tried it and it works as expected (using
curl
at least).Adding more info to the thread, the issue persists on v1.7.4
Config toml
compose file
(It does not work regardless those commented lines are uncommented or not)
Observation
I deployed the compose file, with 1
whoami
container, I can see the cookie in my browser.Clean the cookie, docker service scale to 2, no cookie.
Confirmed that this is a regression. Sticky sessions work as expected in 1.6.5.