Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to delete AS3 tenant because of irule dependency issue. Continuation of #699 and #602. #896

Open
megamattzilla opened this issue Nov 21, 2024 · 0 comments
Labels
bug Something isn't working untriaged Issue needs to be reviewed for validity

Comments

@megamattzilla
Copy link

Environment

  • Application Services Version: 3.53.0
  • BIG-IP Version: 17.1.1.3

Summary

This issue has been raised in #602 and #699.

When declaring a configuration where one iRule references another iRule (using call command), a race condition happens where you cannot delete the tenant because AS3/TMOS tries to delete the library iRule first- which is invalid and causes a TMOS exception.

AS3 treats all iRules equal when it comes to deletion, so sometimes it will try to delete a library iRule before an iRule that references it. It would be great to have a way to signal to AS3 an iRule that should be deleted last (add schema "isLibrary": true or something) so that a TMOS exception does not occur.

Steps To Reproduce

Steps to reproduce the behavior:

Replicating the issue can be tricky. Something causes TMOS to start deleting library_irule before example_irule which causes the exception. Sometimes on a fresh AS3 install, first repro attempt AS3/TMOS happens to delete example_irule before library_irule which is the required order of operations to avoid the TMOS exception.

I found if I declare iRule library first, then add the rest, it makes it more reliable to quickly repro.

  1. Submit the following declaration:
{
    "class": "AS3",
    "action": "deploy",
    "persist": true,
    "loglevel": "debug",
    "declaration": {
        "class": "ADC",
        "schemaVersion": "3.30.0",
        "id": "123abc",
        "Common": {
            "class": "Tenant",
            "Shared": {
                "class": "Application",
                "template": "shared",
                "library_irule": {
                    "class": "iRule",
                    "iRule": {
                        "text": "proc do_nothing {}"
                    }
                }
            }
        }
    }
}

Should be successful.

  1. Submit the following declaration:
{
    "class": "AS3",
    "action": "deploy",
    "persist": true,
    "loglevel": "debug",
    "declaration": {
        "class": "ADC",
        "schemaVersion": "3.30.0",
        "id": "123abc",
        "Common": {
            "class": "Tenant",
            "Shared": {
                "class": "Application",
                "template": "shared",
                "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 {}"
                    }
                }
            }
        }
    }
}

Should be successful.

  1. try deleting the tenant:
curl -u <bigip username> -X DELETE https://<bigip mgmt ip>/mgmt/shared/appsvcs/declare/example_tenant
  1. AS3 Response:
{
    "results": [
        {
            "code": 200,
            "message": "success",
            "lineCount": 16,
            "host": "localhost",
            "tenant": "Common",
            "runTime": 4120,
            "declarationId": "1732204758704"
        },
        {
            "code": 422,
            "message": "declaration failed",
            "response": "01070265:3: The rule (/Common/Shared/library_irule) cannot be deleted because it is in use by a rule (/Common/Shared/example_irule).",
            "host": "localhost",
            "tenant": "Common",
            "runTime": 3633,
            "declarationId": "1732204758704"
        }
    ]
}

Expected Behavior

Would expect AS3 to delete the tenant.

Actual Behavior

AS3 fails to delete the tenant because it tries to delete library_irule before example_irule which is not a valid order of operations. It would be great to have a way to signal to AS3 an iRule that should be deleted last so that a TMOS exception does not occur.

@megamattzilla megamattzilla added bug Something isn't working untriaged Issue needs to be reviewed for validity labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Issue needs to be reviewed for validity
Projects
None yet
Development

No branches or pull requests

1 participant