RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1754085 - tcp-check expect gets Layer7 timeout with 1.5.18-9.el7 but not with 1.5.18-8.el7
Summary: tcp-check expect gets Layer7 timeout with 1.5.18-9.el7 but not with 1.5.18-8.el7
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: haproxy
Version: 7.7
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Ryan O'Hara
QA Contact: Brandon Perkins
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-20 19:48 UTC by Curtis Taylor
Modified: 2021-08-30 12:48 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-08 21:11:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 4455211 0 None None None 2019-09-30 19:46:14 UTC

Comment 3 Kevin Bentlage 2019-09-25 22:25:10 UTC
I'm having the same issues since the latest update (1.5.18-9.el7). I'am using the tcp-checks for a high available redis cluster which is not working after this update.

When reverted back to 1.5.18-8.el7 it's working again.

Comment 4 Ryan O'Hara 2019-09-26 15:08:58 UTC
I'm not convinced this is a bug. Please see rhbz#1677420. Note that this bug refers to multiple tcp-checks and only the last tcp-check is ignored/invalidated. The last tcp-check was never actually checked and therefore always returned 'success'. If I recall, this also applied to single tcp-check configurations. The single tcp-check is also the last, and it was never validated. In short, it appeared the tcp-check was working when it was not. Consider this a false positive. Now that it has been fixed, users may (correctly) see failed tcp-checks that they previously seemed to work correctly.

All this said, I'm happy to investigate if we can prove that haproxy is indeed mishandling tcp-check. In order to determine this, use tcpdump to show the connections are actually happening as expected. If using send/expect, also try to verify the server is responding correctly. If you're seeing a timeout, consider increasing the timeout. Also, it is highly advisable that you specify the port in a 'tcp-check connect' statement.

The upstream bug referenced in comment #2 does not seem applicable here since were are talking about haproxy-1.5.

Comment 6 fabian.wannenmacher 2019-10-08 11:57:59 UTC
Pretty sure this is at last for tcp-check expect string a bug:
haproxy opens the connection, I send the expected string, and haproxy never closes the connection. Even if the server closes it, haproxy keeps the connection open until the timeout happens. (For the three minute timeout after the tcp-fin was received.)

Comment 9 Ryan O'Hara 2019-10-08 16:43:59 UTC
(In reply to Curtis Taylor from comment #0)
> Description of problem:
> haproxy with tcp-check send followed by tcp-check expect gets:
> haproxy[1153]: Server kairosdb_telnet/kaip1.site.com is DOWN, reason: Layer7
> timeout, info: " at step 1 of tcp-check (send)", check duration: 10001ms. 1
> active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining
> in queue.
> 
> Version-Release number of selected component (if applicable):
> haproxy 1.5.18-9.el7
> 
> How reproducible:
> (Customer can.. still working on local reproduction)
> RHEL7.7 haproxy server
> 
> Steps to Reproduce:
> 1. With RHEL7.7 haproxy server
> 2. Listen stanza like:
> listen kairosdb_telnet
>   bind 10.0.0.1:4210 
>   mode tcp
>   balance roundrobin
>   option tcplog
>   option tcp-check
>   tcp-check send version\n
>   tcp-check expect rstring KairosDB \d+\..*
>   server kaip1.site.com 10.0.0.55:4210 check
>   server kaip2.site.com 10.0.0.56:4210 check

There is no 'tcp-check connect' rule. This is required. Upstream documentation [1] states:

"In a tcp-check ruleset a 'connect' is required, it is also mandatory to start
the ruleset with a 'connect' rule. Purpose is to ensure admin know what they
do."

[1] http://cbonte.github.io/haproxy-dconv/1.5/configuration.html#4-tcp-check%20connect

Comment 10 Curtis Taylor 2019-10-08 21:11:10 UTC
Thanks Ryan!  That solved the issue in the case for which I opened this BZ.  

Now an example working listen stanza is:

listen sshapp
  bind 192.168.122.121:2222
  mode tcp
  balance roundrobin
  option tcplog
  option tcp-check
  tcp-check connect port 22
  tcp-check send \n
  tcp-check expect string SSH-2.0-OpenSSH_7.4
  server cutaylor 192.168.100.1:22 check port 22

Since a correct configuration worksforme, I'm closing the BZ.

Comment 11 fabian.wannenmacher 2019-10-09 09:52:23 UTC
Thanks,

So the Red Hat version works like documented.
Adding tcp-check connect helps for me too.
But neither haproxy 2.0 nor haproxy 1.5 from upstream needs this IMHO redundant statement.
So I think it will still break a lot of configurations out there.
Btw: SSH is not a text/line based protocol. It just sends the Version string if you connect: 
tcp-check send \n makes no sense. (Also it dosen't break anything at the moment.)
But maybe some other Red Hat Maintainer patches OpenSSH to remove this undocumented working configuration.

But for me it works too.


Note You need to log in before you can comment on or make changes to this bug.