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

Big-IQ bigip_bigiq_as3 tenant resource removal/destruction fails with 500 error Cannot read property 'class' of null #959

Closed
ghazalehca opened this issue Apr 9, 2024 · 1 comment · Fixed by #974
Labels
Backlog issue will be tracked by JIRA in backlog bug
Milestone

Comments

@ghazalehca
Copy link

ghazalehca commented Apr 9, 2024

Environment

Application Services Version: 3.41
Big IP Provider Version: 1.21.0
BIG-IP Version: BIG-IP 17.1.0.2 Build 0.0.2 Point Release 2
Big-IQ Version: 8.3.0 Build 0.0.118

Summary

After creation of resource using bigip_bigiq_as3 ... (i.e., resource "bigip_bigiq_as3" "COMMON"), try destroying same resource by eliminating the resource from the definition.

Plan will say it will be destroyed, however, the deploy will result in the following error:

 Error: status:500, body:{"code":500,"message":"Cannot read property 'class' of null"}

Steps To Reproduce

Steps to reproduce the behavior:

  1. create application using bigip_bigiq_as3 resource where as3_json =
{
  "class": "AS3",
  "action": "deploy",
  "persist": true,
  "declaration": {
    "class": "ADC",
    "target": {
        "address": "10.10.245.157"
    },
    "schemaVersion": "3.41.0",
    "Common": {
      "class": "Tenant",
      "Shared": {
        "class": "Application",
        "template": "shared",
        "constants": {
            "class": "Constants",
            "FLEX_TCP_PROFILE_SETTINGS": {
                "profileTCP": {
                    "ingress": {
                        "bigip": "/Common/Shared/AS3_FLEX_WAN_TCP_PROFILE"
                    },
                    "egress": {
                        "bigip": "/Common/Shared/AS3_FLEX_LAN_TCP_PROFILE"
                    }
                }
            }
        },
        "AS3_DEFAULT_ACCELERATION_PROFILE": {
          "class": "HTTP_Acceleration_Profile",
          "label": "DEFAULT DECLARATION"
        },
        "AS3_DEFAULT_HTTP_COMPRESSION_PROFILE": {
          "class": "HTTP_Compress",
          "label": "DEFAULT DECLARATION"
        },
        "AS3_FLEX_WAN_TCP_PROFILE": {
            "class": "TCP_Profile",
            "remark": "BDP = 100 ms, 1Gbps, doubled",
            "autoProxyBufferSize": false,
            "autoReceiveWindowSize": false,
            "autoSendBufferSize": false,
            "minimumRto": 200,
            "proxyBufferHigh": 25100000,
            "proxyBufferLow": 25000000,
            "pushFlag": "default",
            "receiveWindowSize": 12500000,
            "sendBufferSize": 12500000,
            "synRtoBase": 200
        },
        "AS3_FLEX_LAN_TCP_PROFILE": {
            "class": "TCP_Profile",
            "remark": "BDP = 1 MS, 10Gbps, doubled",
            "autoProxyBufferSize": false,
            "autoReceiveWindowSize": false,
            "autoSendBufferSize": false,
            "minimumRto": 2,
            "proxyBufferHigh": 2600000,
            "proxyBufferLow": 2500000,
            "pushFlag": "default",
            "receiveWindowSize": 1250000,
            "sendBufferSize": 1250000,
            "synRtoBase": 2
        }
      }
    }
  }
}

Example resource code in terraform:

resource "bigip_bigiq_as3" "COMMON" {
  # Tenant for Common Shared Application
  as3_json = file(...from above...)
  bigiq_address    = var.bigiq_ip
  bigiq_user       = var.bigiq_user
  bigiq_password   = var.bigiq_pw
  bigiq_token_auth = false
}

  1. after successfully building the COMMON shared application, remove this resource from the code..
#resource "bigip_bigiq_as3" "COMMON" {
#  # Tenant for Common Shared Application
#  as3_json = file(...from above...)
#  bigiq_address    = var.bigiq_ip
#  bigiq_user       = var.bigiq_user
#  bigiq_password   = var.bigiq_pw
#  bigiq_token_auth = false
#}

this will result in the build plan showing:
image

  1. terraform apply (deploy code).

results in the following deploy error:

image

Expected Behavior

removal of this resource should result in the application and tenant being removed. Note: this is COMMON so it shouldn't be removed. However, the application (shared) should be removed.

Also IMPORTANT note that this behavior is exactly the same if it's a tentant such as:

resource "bigip_bigiq_as3" "tenant" { }

image

Actual Behavior

This is the COMMON tenant (above), so it shouldn't be removed. However, the application (shared) should be removed.

Also IMPORTANT note that this behavior is exactly the same if it's any tentant such as:

resource "bigip_bigiq_as3" "tenant" { ... definition here ... }

and then remove via...

resource "bigip_bigiq_as3" "tenant" { ... definition here ... }

image

In case you were curious if this occurs in other versions, I tested the same by changing the bigip provider to 1.14.0

    bigip = {
      source  = "F5Networks/bigip"
      # version = "~> 1.21.0"
      version = "~> 1.14.0" 
    }

Version 1.14.0 results in a similar error when destroying:

image

One final note is that if you remove a single application out of a multi-application tenant by sending the new declaration without that application (as long as it's not the last one in the declaration), it works just fine removing 1 of the applications.

@ghazalehca ghazalehca added the bug label Apr 9, 2024
@pgouband
Copy link
Collaborator

pgouband commented Apr 10, 2024

Hi,

Thanks for reporting. Added to the backlog and internal tracking ID for this request is: INFRAANO-1532.

@pgouband pgouband added the Backlog issue will be tracked by JIRA in backlog label Apr 10, 2024
@RavinderReddyF5 RavinderReddyF5 added this to the v1.22.1 milestone May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog issue will be tracked by JIRA in backlog bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants