[MDEV-19669] proxy_protocol_networks does not evaluate/parse properly Created: 2019-06-01 Updated: 2019-11-27 Resolved: 2019-11-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.3.15 |
| Fix Version/s: | 10.3.21, 10.4.11, 10.5.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Joachim Tingvold | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | proxy | ||
| Environment: |
Ubuntu 18.04.2 LTS, MariaDB-1:10.3.15+maria~bionic |
||
| Description |
|
Hi, proxy_protocol_networks does not seem to work properly in my setup. I have one working setup, and one non-working setup. The setups are equal, except hostnames and IP-addresses. Working setup;
Non-working setup:
All hosts are running Ubuntu 18.04.2 LTS. All within the same subnet (172.20.20.0/24). All ha*-nodes are running haproxy. The non-ha-nodes are running MariaDB Galera cluster. I have the following in my.cnf on all MariaDB nodes;
A snippet of the haproxy.cfg;
The Proxy Protocol works as expected on the 'demo' cluster. However, on the 'prod' cluster, having the exact same configuration (including the proxy_protocol_networks config above), haproxy cannot connect, complaining as following; Server mysql_cluster/db-prod-01 is DOWN, reason: Layer7 wrong status, code: 0, info: "#HY000Proxy header is not accepted from 172.20.20.38", check duration: 0ms. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. That IP is within the 172.20.20.0/24 range specified. If I explicitly list the IP (without CIDR notation) in the config, it works as expected;
The order of the 172.20.20.0/24 does not matter (i.e. it's not because it was bad parsing due to being the last entry in the list, or similar). |
| Comments |
| Comment by Mathew Winstone [ 2019-08-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have the same problem.
I have
In server.cnf on both clusters. And my haproxy config is
The above cluster works but the following config does not
The only thing different is the IP addresses. Note that if I set the proxy_protocol_networks to "*" then it works fine in either case. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nicolas Payart [ 2019-11-25 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Same problem on a MariaDB 10.3.20 server behind HAProxy 2.0.9 with Proxy Protocol setup (send-proxy-v2)
So the subnet mask is /24 (255.255.255.0) Setting exact IP is ok
|