# Very Strange problem with haproxy

**URL:** <https://forums.percona.com/t/very-strange-problem-with-haproxy/3905>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [November 25, 2014, 9:47am UTC](https://forums.percona.com/t/very-strange-problem-with-haproxy/3905 "2014-11-25T09:47:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brvolpini](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@brvolpini](https://forums.percona.com/u/brvolpini)\
**Post date:** [November 25, 2014, 9:47am UTC](https://forums.percona.com/t/very-strange-problem-with-haproxy/3905/1 "2014-11-25T09:47:23Z")

</div>

Hi,  
I have a problem with load balancing with haproxy to a 3 nodes percona xtradb cluster.  
I made this setting in production and everything works perfect. But now i do exactly the same in Kvm enviroment with debian.

Here is my haproxy.cfg

global  
log 127.0.0.1 local0 notice  
user haproxy  
group haproxy

defaults  
log global  
retries 2  
timeout connect 5000  
timeout server 50000  
timeout client 50000

listen educaedu  
bind 192.168.1.107:3306  
mode tcp  
option mysql-check user haproxy\_check  
balance roundrobin  
server mysql1-dev 192.168.1.104:3306 check  
server mysql2-dev 192.168.1.105:3306 check  
server mysql3-dev 192.168.1.106:3306 check

listen 192.168.1.107 :8080  
mode http  
stats enable  
stats uri /  
stats realm Strictly\ Private  
stats auth haproxy\_root:debian  
stats refresh 5s

The issue is that if I comment the User parameter ( option mysql-check #user haproxy\_check) it seems to work fine. But otherwise don’t work.  
The log tell me this:

Nov 25 11:31:49 localhost haproxy[12575]: Server educaedu/mysql1-dev is DOWN, reason: Layer7 wrong status, code: 0, info: “Access denied for user ‘haproxy\_root’@‘192.168.1.107’ (using password: NO)”, check duration: 0ms. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.  
Nov 25 11:31:50 localhost haproxy[12576]: Server educaedu/mysql2-dev is DOWN, reason: Layer7 wrong status, code: 0, info: “Access denied for user ‘haproxy\_root’@‘192.168.1.107’ (using password: NO)”, check duration: 1ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.  
Nov 25 11:31:50 localhost haproxy[12576]: Server educaedu/mysql3-dev is DOWN, reason: Layer7 wrong status, code: 0, info: “Access denied for user ‘haproxy\_root’@‘192.168.1.107’ (using password: NO)”, check duration: 1ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.  
Nov 25 11:31:50 localhost haproxy[12576]: proxy educaedu has no server available!

and telnet to ip and port tell me this:

root@haproxy-dev:~# telnet 192.168.1.107 3306  
Trying 192.168.1.107…  
Connected to 192.168.1.107.  
Escape character is ‘^]’.  
Connection closed by foreign host.

Connect but close connection instantly.

When I try to connect to mysql this is the message:

root@haproxy-dev:~# mysql -u haproxy\_check -P3306 -h 192.168.1.107 -pdebian  
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0

The user Mysql\_check has admin privileges on databases. My haproxy version is 1.4.25 but i tried with multiple versions.

Thanks in advanced.

Bruno
