citrix / terraform-provider-citrixadc

Part of NetScaler Automation Toolkit | https://github.com/netscaler/automation-toolkit
https://registry.terraform.io/providers/citrix/citrixadc
Apache License 2.0
119 stars 59 forks source link

[Bug]: PERSISTENCE TIMEOUT 0 not being honored - see CLOSED ISSUE #1062 - The problem exists in all providers after 1.37.0 #1169

Closed kevinmarino closed 1 week ago

kevinmarino commented 6 months ago

Terraform Core Version

1.8.4

citrixadc Provider Version

1.39.0

Operating system

Windows

Affected Resource(s)

resource "citrixadc_lbvserver" "vip" { name = "VIP" ipv46 = "10.10.10.10" port = 443 servicetype = "SSL" persistencetype = "COOKIEINSERT" timeout = 0 }

Equivalent NetScaler CLI Command

add lb vserver VIP SSL 10.10.10.10 443 -persistenceType COOKIEINSERT -timeout 0

Expected Behavior

The timeout value of the persistence type CookieInsert should be set to 0.

Actual Behavior

After applying the terraform code the cookieinsert persistence value is defaulted to 2. If you try and change the timeout value to 0 it will error out.

Relevant Error/Panic Output Snippet

Terraform will perform the following actions:

  # module.adc-az-vpx-sandbox-1_add_lbvserver_azure_east["VST-HS-SERVICENAME-SERVICECOMPONENT-INT"].citrixadc_lbvserver.module_tf_lbvserver will be updated in-place
  ~ resource "citrixadc_lbvserver" "module_tf_lbvserver" {
        id                                 = "vst-HS-servicename-servicecomponent-INT-M1"
        name                               = "vst-HS-servicename-servicecomponent-INT-M1"
      ~ timeout                            = 2 -> 0
        # (95 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
module.adc-az-vpx-sandbox-1_add_lbvserver_azure_east["VST-HS-SERVICENAME-SERVICECOMPONENT-INT"].citrixadc_lbvserver.module_tf_lbvserver: Modifying... [id=vst-HS-servicename-servicecomponent-INT-M1]
╷
│ Error: [ERROR] netscaler-provider: Error updating lbvserver vst-HS-servicename-servicecomponent-INT-M1
│
│   with module.adc-az-vpx-sandbox-1_add_lbvserver_azure_east["VST-HS-SERVICENAME-SERVICECOMPONENT-INT"].citrixadc_lbvserver.module_tf_lbvserver,
│   on modules\add-lbvserver\main.tf line 13, in resource "citrixadc_lbvserver" "module_tf_lbvserver":
│   13: resource "citrixadc_lbvserver" "module_tf_lbvserver" {

Terraform Configuration Files

terraform { required_providers { citrixadc = { source = "citrix/citrixadc" version = "1.39.0" } } }

provider "citrixadc" { endpoint = "https://10.10.10.5" username = var.adc_admin_username password = var.adc_admin_password insecure_skip_verify = true }

resource "citrixadc_lbvserver" "vip" { name = "VIP" ipv46 = "10.10.10.10" port = 443 servicetype = "SSL" persistencetype = "COOKIEINSERT" timeout = 0 }

Steps to Reproduce

Create a LB Vserver resource with cookieinsert persistence and set a timeout value of 0. Run the apply and validate the timeout is defaulted to 2, re-run the apply to have it update to 0 and get an error.

Debug Output

No response

Panic Output

No response

Important Factoids

See https://github.com/citrix/terraform-provider-citrixadc/issues/1062 - For this previous issue in 1.35.0 which was corrected in 1.37.0 build but has since become a problem again in 1.39.0 build.

References

Previous ISSUE and CLOSED information: https://github.com/citrix/terraform-provider-citrixadc/issues/1062

kevinmarino commented 2 months ago

This issue still exists in 1.40.0 - Is anyone going to update the timeout value of 0 for COOKIEINSERT persistence to work with Terraform again?

kaiAsmOne commented 1 month ago

With the release of 1.40.1 i have finally been able to move further than 1.37.0. I noticed the above mentioned issue came back awhile ago. but it has been a low priority issue waiting for more urgent fixes.

Due to this bug it is not possible to make a cookie become a session cookie.

It would be nice to have this bug fixed because it messes up applications.

kevinmarino commented 1 month ago

Please correct the Timeout value of 0 being an acceptable value. This is necessary for configurations we use for COOKIEINSERT persistence type. You had this working in version 1.37.0 and then decided to break it in all the following versions. This is still an issue in 1.41.0. Considering you had it working I would presume this would be a simple fix.