Hi Lukas,

On 06/19/17 21:23, Lukas Tribus wrote:
Am 19.06.2017 um 11:27 schrieb Philipp Kolmann:
This config works in 1.5.8 but fails to tcp-check in 1.7.5.

The errors in the logfile look like this:

Jun 19 10:52:57 testha2 haproxy[5042]: Server mail-exchtest-smtp/mbx13a is DOWN, reason: 
Socket error, info: "No port available for the TCP connection", check duration: 
0ms. 3 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in 
queue.

Bug introduced  in 95db2bcfee ("MAJOR: check: find out which port to use
for health check at run time"), the AF check in line 1521 does not trigger
in this case ("tcp-check connect port" configuration).

Partially reverting the check to the old one appears to work, but that's
probably not the correct fix.


diff --git a/src/checks.c b/src/checks.c
index 1af862e..5a34609 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -1518,7 +1518,7 @@ static int connect_conn_chk(struct task *t)
          conn->addr.to = s->addr;
      }
- if ((conn->addr.to.ss_family == AF_INET) || (conn->addr.to.ss_family == AF_INET6)) {
+       if (check->port) {
          int i = 0;
i = srv_check_healthcheck_port(check);
thanks for the patch. I added the changed line and rebuilt the debian Package. Now the Ports come up again.

A quick config workaround, that reduces the check to a single port consist
in adding "port 25" to each server configuration (after the check keyword).

Adding the Port works for the SMTP Setup. For IMAP, where the Port is SSL enabled it still fails:


listen mail-exchtest-imap
        bind 128.130.xx.yy:143 transparent name imap
        bind 128.130.xx.yy:993 transparent name imaps
        mode tcp
log-format %ci:%cp\ [%t]\ %ft\ %s\ %si:%sp\ %Tw/%Tc/%Tt\ %B\ %ts\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq
        #balance roundrobin
        #stick-table type ip size 20k peers testha-cluster
        #stick on src
        maxconn 8765
        option tcp-check
        default-server inter 3s rise 2 fall 3
        tcp-check connect port 143
        tcp-check expect string *\ OK
        tcp-check connect port 993 ssl
        tcp-check expect string *\ OK

server mbx13a 128.130.xx.yy1: maxconn 5000 check ca-file /etc/ssl/certs/ca-certificates.crt port 993 server mbx13b 128.130.xx.yy2: maxconn 5000 check ca-file /etc/ssl/certs/ca-certificates.crt port 993 server mbx13c 128.130.xx.yy3: maxconn 5000 check ca-file /etc/ssl/certs/ca-certificates.crt port 993 server mbx13d 128.130.xx.yy4: maxconn 5000 check ca-file /etc/ssl/certs/ca-certificates.crt port 993


Jun 29 16:11:26 testha2 haproxy[11469]: Server mail-exchtest-imap/mbx13d is DOWN, reason: Socket error, info: "TCPCHK error establishing connection at step 3", check duration: 4ms. 3 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. Jun 29 16:11:26 testha2 haproxy[11469]: Server mail-exchtest-imap/mbx13b is DOWN, reason: Socket error, info: "TCPCHK error establishing connection at step 3", check duration: 4ms. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. Jun 29 16:11:26 testha2 haproxy[11469]: Server mail-exchtest-imap/mbx13a is DOWN, reason: Socket error, info: "TCPCHK error establishing connection at step 3", check duration: 4ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. Jun 29 16:11:26 testha2 haproxy[11469]: Server mail-exchtest-imap/mbx13c is DOWN, reason: Socket error, info: "TCPCHK error establishing connection at step 3", check duration: 4ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. Jun 29 16:11:26 testha2 haproxy[11469]: proxy mail-exchtest-imap has no server available!


Thanks
Philipp



--
-----------------------------------------------------------------------
DI Mag. Philipp Kolmann                  mail: [email protected]
Technische Universitaet Wien                  web: www.zid.tuwien.ac.at
Zentraler Informatikdienst (ZID)                 tel: +43(1)58801-42011
Wiedner Hauptstr. 8-10, A-1040 Wien                        DVR: 0005886
-----------------------------------------------------------------------


Reply via email to