Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HAProxy Socket API "get acl" error: "Missing ACL identifier and/or key"

I am trying to use HAProxy's socket API. Specifically, I am trying to read/get the value of an acl using the documentation here.

The error that I keep getting when attempting to run that command is: "Missing ACL identifier and/or key"

I found one forum online where the user seemed to be having the same problem.

I have several acl rules defined in my haproxy.cfg file. I cannot retrieve the values of any of them. Here is an example acl similar to the one that I want to retrieve:

acl is_blue always_false

This acl is being used as a flag to use in my condition statements. I will toggle it between always_false and always_true to signify which environment is "live" (blue or green). Please don't get hung up on this type of acl, as I cannot retrieve ANY of my acls - not just this one.

The forum sited above mentioned that I need to use and Id when trying to use 'get acl', but that doesn't work either. I tried to modify the acl, giving it a specific unique id like this:

acl is_blue always_false -u 10

No love.

Has anyone successfully used 'get acl' with HAProxy's socket API? I have found no examples online that have worked for me and I cannot get past this issue.

like image 974
Terry Yoder Avatar asked Feb 26 '26 16:02

Terry Yoder


1 Answers

Sorry to dig up an old question but according to this https://github.com/haproxy/haproxy/blob/e18db9e984e69e3802868bac10ce0703ce31e7d0/doc/management.txt the "get acl" command is used to check whether an ACL matches a certain pattern.

So if I have this ACL:

{  req.cook(SITEID) -m beg test } 

Then I get this:

 get acl #5 test
 type=beg, case=sensitive, match=yes, idx=tree, pattern="test"
like image 50
JoeS Avatar answered Feb 28 '26 07:02

JoeS