dataplaneapi icon indicating copy to clipboard operation
dataplaneapi copied to clipboard

Adding the same IP to runtime ACL file returns 500 instead of expected 409

Open ignoreswing opened this issue 1 year ago • 1 comments

Steps to Reproduce

  1. [POST] /services/haproxy/runtime/acl_file_entries

    • Add a new IP (192.168.50.2) to the runtime ACL file.
    • Initially, it responds with HTTP status code 201:
      curl --location 'https://192.168.30.169:5566/v2/services/haproxy/runtime/acl_file_entries?acl_id=4' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Basic aGFwcm94eTpQQHNzdzByZA==' \
      --data '{
        "value": "192.168.50.2"
      }'
      
  2. Send the above API request again.

    • It returns a 500 error with the following message:
      {
          "code": 500,
          "message": "cannot add ACL files entry for 4: already exists"
      }
      

Expected Behavior

According to the documentation, in this case, where the specified resource already exists, it should respond with status code 409.

Actual Behavior

It returns a 500 error.

Your Environment

  • HAProxy version 2.8.9
  • HAProxy Data Plane API v2.9.3 build 59f34ea1
  • Ubuntu 22.04.1 LTS

ignoreswing avatar May 22 '24 09:05 ignoreswing

We will fix this in the following releases.

mjuraga avatar May 09 '25 12:05 mjuraga