Skip to content

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

Open
@ignoreswing

Description

@ignoreswing

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 59f34ea
  • Ubuntu 22.04.1 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions