F5Networks / f5-appsvcs-extension

F5 BIG-IP Application Services 3 Extension
Apache License 2.0
169 stars 54 forks source link

unable to delete AS3 tenant because of irule dependency issue #699

Closed person50002 closed 9 months ago

person50002 commented 1 year ago

Environment

Summary

In a declaration where one irule is referencing another irule, AS3 will fail to delete the tenant with following error "The rule (called_irule) cannot be deleted because it is in use by a rule (calling_irule)". This is probably due to the following documented issue: "Bug ID 767217: Under certain conditions when deleting an iRule, an incorrect dependency error is seen" (https://cdn.f5.com/product/bugtracker/ID767217.html). The problem is that the recommended solution doesn't work when using AS3 because you would have to first create a new AS3 declaration that does not have the calling irule. Then save and reload the config and only them would you be able to delete the whole tenant.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Submit the following declaration:

    {
    "class": "AS3",
    "action": "deploy",
    "declaration": {
    "class": "ADC",
    "schemaVersion": "3.36.0",
    "example_tenant": {
      "class": "Tenant",
      "example_app": {
        "class": "Application",
        "example_service": {
          "class": "Service_HTTP",
          "virtualAddresses": [
            "1.1.1.1"
          ],
          "iRules": [
            "example_irule"
          ]
        },
        "example_irule": {
          "class": "iRule",
          "iRule": {
            "text": "when HTTP_REQUEST {\n  set nothing [call library_irule::do_nothing]\n}"
          }
        },
        "library_irule": {
          "class": "iRule",
          "iRule": {
            "text": "proc do_nothing {}"
          }
        }
      }
    }
    }
    }
  2. Response:

    {
    "results": [
        {
            "code": 200,
            "message": "success",
            "lineCount": 29,
            "host": "localhost",
            "tenant": "example_tenant",
            "runTime": 3213
        }
    ],
    "declaration": {}
    }
  3. try deleting the tenant:

    curl -u <bigip username> -X DELETE https://<bigip mgmt ip>/mgmt/shared/appsvcs/declare/example_tenant
  4. Response:

    {
    "results": [
        {
            "code": 422,
            "message": "declaration failed",
            "response": "01070265:3: The rule (/example_tenant/example_app/library_irule) cannot be deleted because it is in use by a rule (/example_tenant/example_app/example_irule).",
            "host": "localhost",
            "tenant": "example_tenant",
            "runTime": 3508
        }
    ],
    "declaration": {},
    "code": 422
    }

Expected Behavior

Would expect AS3 to delete the tenant

Actual Behavior

AS3 fails to delete the tenant

sunitharonan commented 1 year ago

Thank you @person50002. I have added this issue to our internal product backlog as AUTOTOOL-3714. In order to prioritize and understand the issue better, please reach out to us at automation_toolchain_pm@f5.com

sunitharonan commented 9 months ago

Closing as we haven't heard from you.