Bug 2212246

Summary: haproxy stats still showing status as OPEN after disabling frontend
Product: Red Hat Enterprise Linux 9 Reporter: Nghia Le <trongnghia203>
Component: haproxyAssignee: Ryan O'Hara <rohara>
Status: CLOSED ERRATA QA Contact: Juraj Hrdlica <jhrdlica>
Severity: high Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bstinson, jhrdlica, jwboyer
Target Milestone: rcKeywords: Bugfix, Triaged, Upgrades, Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: haproxy-2.4.22-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:35:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nghia Le 2023-06-05 02:51:05 UTC
Description of problem:

haproxy.17 - it still showing status as OPEN after disabling frontend


Version-Release number of selected component (if applicable): 2.4.17



How reproducible: it is reproducible in CentOS Stream 8, 9 with haproxy.17


Steps to Reproduce:

1. disable frontend
[root@haproxy:~] echo "disable frontend main-ssl" | sudo socat stdio /var/lib/haproxy/stats2

2. checking status
[root@haproxy:~] echo 'show stat -1 1 -1' | sudo socat stdio /var/lib/haproxy/stats2 | grep main-ssl,FRONTEND

Actual results:
main-ssl,FRONTEND,,,2,4,3000,15,249689726,395411913,0,0,0,,,,,OPEN,,,,,,,,,2,2,0,,,,0,0,0,1,,,,,,,,,,,0,0,0,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,tcp,,0,1,96,,0,0,0,,,,,,,,,,,0,,,,,,,-,2,13,81,0,0,0,0,0,0,0,0,0,0,0,0,0,


Expected results:
main-ssl,FRONTEND,,,2,4,3000,15,249689726,395411913,0,0,0,,,,,STOP,,,,,,,,,2,2,0,,,,0,0,0,1,,,,,,,,,,,0,0,0,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,tcp,,0,1,96,,0,0,0,,,,,,,,,,,0,,,,,,,-,2,13,81,0,0,0,0,0,0,0,0,0,0,0,0,0,


Additional info: This bug is reported in the github project of the component https://github.com/haproxy/haproxy/issues/1626, it's already fixed in newer version 2.4, 2.5, 2.6 and later. But it has not been rebuild rpm package to CentOS Stream 9 repository

Comment 1 Ryan O'Hara 2023-06-07 15:42:32 UTC
I rebased haproxy for RHEL 9.3 (rhbz#2196530), so this will be fixed in the next release. I have not had time to test it yet, but I did confirm that all code changes required for the fix are present.

Comment 2 Nghia Le 2023-06-12 08:02:08 UTC
I was able to download haproxy-2.4.22-1.el9 from https://kojihub.stream.centos.org/koji/buildinfo?buildID=33526 and test it.

###
[root@jbalancer01:~] echo "disable frontend main-ssl" | sudo socat stdio /var/lib/haproxy/stats2

[root@jbalancer01:~] echo 'show stat -1 1 -1' | sudo socat stdio /var/lib/haproxy/stats2 | grep main-ssl,FRONTEND
main-ssl,FRONTEND,,,0,0,3000,0,0,0,0,0,0,,,,,PAUSED,,,,,,,,,2,2,0,,,,0,0,0,0,,,,,,,,,,,0,0,0,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,tcp,,0,0,0,,0,0,0,,,,,,,,,,,0,,,,,,,,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
###

As the result, haproxy stats now showing status "PAUSED" after disabling, instead of "STOP" as before, but it would be the new behavior changed in haproxy repository, and it's acceptable.

Thanks Ryan O'Hara for the fix.

Comment 4 Nghia Le 2023-07-04 04:13:56 UTC
Hi Ryan, may I ask when package haproxy.22 released to upstream repo, please? I've observed the https://pkgs.org/search/?q=haproxy, but it doesn't seem like the new version released there.

Thanks

Comment 7 Juraj Hrdlica 2023-07-11 08:15:18 UTC
Verified for haproxy-2.4.22-1.el9.x86_64

# cat /etc/haproxy/haproxy.cfg
global
  stats socket /var/lib/haproxy/stats2 mode 660 level admin expose-fd listeners

frontend my_frontend
  timeout connect 300
  timeout client  300
  timeout server  300
  bind *:80
  mode tcp

# systemctl start haproxy
# echo "show stat" | socat stdio /var/lib/haproxy/stats2 | grep my_frontend
my_frontend,FRONTEND,,,0,0,262129,0,0,0,0,0,0,,,,,OPEN,,,,,,,,,1,2,0,,,,0,0,0,0,,,,,,,,,,,0,0,0,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,tcp,,0,0,0,,0,0,0,,,,,,,,,,,0,,,,,,,,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
# echo "disable frontend my_frontend" | socat stdio /var/lib/haproxy/stats2
# echo "show stat" | socat stdio /var/lib/haproxy/stats2 | grep my_frontend
my_frontend,FRONTEND,,,0,0,262129,0,0,0,0,0,0,,,,,PAUSED,,,,,,,,,1,2,0,,,,0,0,0,0,,,,,,,,,,,0,0,0,,,0,0,0,0,,,,,,,,,,,,,,,,,,,,,tcp,,0,0,0,,0,0,0,,,,,,,,,,,0,,,,,,,,,-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

Comment 9 errata-xmlrpc 2023-11-07 08:35:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: haproxy security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6496