RavinderReddyF5 / terraform-provider-bigip-version0.12

Terraform resources that can configure F5 BIGIP products
Mozilla Public License 2.0
0 stars 0 forks source link

[CLOSED] Changing name in 'bigip_ltm_profile_http2' causes Terraform Crash #154

Open RavinderReddyF5 opened 4 years ago

RavinderReddyF5 commented 4 years ago

Issue by marianne-butaye Thursday Jun 27, 2019 at 15:15 GMT Originally opened as https://github.com/terraform-providers/terraform-provider-bigip/issues/123


I know that the 'name' cannot be updated on the F5 device (I usually use lifecycle's ignore_change on both 'name' and 'partition' to remedy to that); but this comportment is different than other resources in this case.

When I change the 'name' of the resource (without lifecycle use), other resources succeed the apply phase even when the F5 device cannot change this property; but the 'bigip_ltm_profile_http2' resource produces a Terraform Crash.

Below are the steps to reproduce this error: 1st terraform apply

data.null_data_source.http2_profiles: Refreshing state...
data.vault_generic_secret.f5_key: Refreshing state...

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  + bigip_ltm_profile_http2.http2_profiles
      id:                                <computed>
      activation_modes.#:                "1"
      activation_modes.2795781147:       "always"
      concurrent_streams_per_connection: "10"
      connection_idle_timeout:           "30"
      defaults_from:                     "/Common/http2"
      header_table_size:                 "4096"
      name:                              "/Common/NewYork_http2_TF"

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

bigip_ltm_profile_http2.http2_profiles: Creating...
  activation_modes.#:                "0" => "1"
  activation_modes.2795781147:       "" => "always"
  concurrent_streams_per_connection: "" => "10"
  connection_idle_timeout:           "" => "30"
  defaults_from:                     "" => "/Common/http2"
  header_table_size:                 "" => "4096"
  name:                              "" => "/Common/NewYork_http2_TF"
bigip_ltm_profile_http2.http2_profiles: Creation complete after 2s (ID: /Common/NewYork_http2_TF)

Apply complete! Resources: 1 added, 0 changed, 0 destroyed

2nd terraform apply & CRASH

data.null_data_source.http2_profiles: Refreshing state...
data.vault_generic_secret.f5_key: Refreshing state...
bigip_ltm_profile_http2.http2_profiles: Refreshing state... (ID: /Common/NewYork_http2_TF)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ bigip_ltm_profile_http2.http2_profiles
      name: "/Common/NewYork_http2_TF" => "/Common/NewYork_http3_TF"

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

bigip_ltm_profile_http2.http2_profiles: Modifying... (ID: /Common/NewYork_http2_TF)
  name: "/Common/NewYork_http2_TF" => "/Common/NewYork_http3_TF"

Error: Error applying plan:

1 error(s) occurred:

* bigip_ltm_profile_http2.http2_profiles: 1 error(s) occurred:

* bigip_ltm_profile_http2.http2_profiles: unexpected EOF

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

panic: interface conversion: interface {} is nil, not int
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: 
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: goroutine 124 [running]:
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: github.com/terraform-providers/terraform-provider-bigip/bigip.resourceBigipLtmProfileHttp2Update(0xc00041dc00, 0x101c620, 0xc0000a2910, 0x24, 0x1a7ad80)
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4:        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-bigip/bigip/resource_bigip_ltm_profile_http2.go:102 +0x5af
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: github.com/terraform-providers/terraform-provider-bigip/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc0001fab80, 0xc0000a32c0, 0xc00056d8e0, 0x101c620, 0xc0000a2910, 0x40b801, 0xc000012b80, 0x4c238c)
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4:        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-bigip/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:292 +0x262
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: github.com/terraform-providers/terraform-provider-bigip/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc0001fb880, 0xc0000a3270, 0xc0000a32c0, 0xc00056d8e0, 0xc00012b880, 0x18, 0x7fc1fb02c6c0)
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4:        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-bigip/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:285 +0x9c
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: github.com/terraform-providers/terraform-provider-bigip/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc0005b9380, 0xc00056d4c0, 0xc00002f180, 0x0, 0x0)
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4:        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-bigip/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:530 +0x57
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: reflect.Value.call(0xc00008cd20, 0xc000172978, 0x13, 0x101e49e, 0x4, 0xc000012f18, 0x3, 0x3, 0xc000152340, 0xc00025d800, ...)
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4:        /opt/goenv/versions/1.11.5/src/reflect/value.go:447 +0x454
2019-06-27T16:58:08.897+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: reflect.Value.Call(0xc00008cd20, 0xc000172978, 0x13, 0xc00052af18, 0x3, 0x3, 0x0, 0x0, 0x100000001)
2019-06-27T16:58:08.898+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4:        /opt/goenv/versions/1.11.5/src/reflect/value.go:308 +0xa4
2019-06-27T16:58:08.898+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: net/rpc.(*service).call(0xc0001536c0, 0xc0004b0e60, 0xc000423560, 0xc000423570, 0xc000481500, 0xc0005b9860, 0xe2f500, 0xc00056d4c0, 0x16, 0xe2f540, ...)
2019-06-27T16:58:08.898+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4:        /opt/goenv/versions/1.11.5/src/net/rpc/server.go:384 +0x14e
2019-06-27T16:58:08.898+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4: created by net/rpc.(*Server).ServeCodec
2019-06-27T16:58:08.898+0200 [DEBUG] plugin.terraform-provider-bigip_v0.12.3_x4:        /opt/goenv/versions/1.11.5/src/net/rpc/server.go:481 +0x47e
2019/06/27 16:58:08 [TRACE] root: eval: *terraform.EvalWriteState
2019/06/27 16:58:08 [TRACE] root: eval: *terraform.EvalApplyProvisioners
2019/06/27 16:58:08 [TRACE] root: eval: *terraform.EvalIf
2019/06/27 16:58:08 [TRACE] root: eval: *terraform.EvalWriteState
2019/06/27 16:58:08 [TRACE] root: eval: *terraform.EvalWriteDiff
2019/06/27 16:58:08 [TRACE] root: eval: *terraform.EvalApplyPost
2019-06-27T16:58:08.900+0200 [DEBUG] plugin: plugin process exited: path=/home/Z21MBUTA/Documents/F5-CONFIG/.terraform/plugins/linux_amd64/terraform-provider-bigip_v0.12.3_x4
2019/06/27 16:58:08 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

* bigip_ltm_profile_http2.http2_profiles: unexpected EOF
2019/06/27 16:58:08 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

* bigip_ltm_profile_http2.http2_profiles: unexpected EOF
2019/06/27 16:58:08 [TRACE] [walkApply] Exiting eval tree: bigip_ltm_profile_http2.http2_profiles
2019/06/27 16:58:08 [TRACE] dag/walk: upstream errored, not walking "provider.bigip (close)"
2019/06/27 16:58:08 [TRACE] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
2019/06/27 16:58:08 [TRACE] dag/walk: upstream errored, not walking "root"
2019/06/27 16:58:08 [TRACE] Preserving existing state lineage "782781e0-3bfb-5f30-961e-6a7e58077bea"
2019/06/27 16:58:08 [TRACE] Preserving existing state lineage "782781e0-3bfb-5f30-961e-6a7e58077bea"
2019/06/27 16:58:08 [TRACE] Preserving existing state lineage "782781e0-3bfb-5f30-961e-6a7e58077bea"
2019/06/27 16:58:08 [TRACE] Preserving existing state lineage "782781e0-3bfb-5f30-961e-6a7e58077bea"
2019/06/27 16:58:08 [DEBUG] plugin: waiting for all plugin processes to complete...
2019-06-27T16:58:08.909+0200 [WARN ] plugin: error closing client during Kill: err="connection is shut down"
2019-06-27T16:58:08.910+0200 [DEBUG] plugin.terraform-provider-null_v2.1.2_x4: 2019/06/27 16:58:08 [ERR] plugin: plugin server: accept unix /tmp/plugin689839021: use of closed network connection
2019-06-27T16:58:08.910+0200 [DEBUG] plugin.terraform-provider-vault_v1.9.0_x4: 2019/06/27 16:58:08 [ERR] plugin: plugin server: accept unix /tmp/plugin998800964: use of closed network connection
2019-06-27T16:58:08.913+0200 [DEBUG] plugin: plugin process exited: path=/home/Z21MBUTA/Documents/F5-CONFIG/.terraform/plugins/linux_amd64/terraform-provider-null_v2.1.2_x4
2019-06-27T16:58:08.914+0200 [DEBUG] plugin: plugin process exited: path=/home/Z21MBUTA/Documents/F5-CONFIG/.terraform/plugins/linux_amd64/terraform-provider-vault_v1.9.0_x4

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Here is my Terraform version info:

Terraform v0.11.13
+ provider.bigip v0.12.3
+ provider.null v2.1.2
+ provider.vault v1.9.0

The crash also causes the loss of the state regarding this resource (marked as not created yet after crash even though is still exists on the F5 device).

RavinderReddyF5 commented 4 years ago

Comment by mdditt2000 Tuesday Jul 02, 2019 at 22:37 GMT


Jira TER-19

RavinderReddyF5 commented 4 years ago

Comment by RavinderReddyF5 Monday Jul 15, 2019 at 09:45 GMT


@marianne-butaye

I fixed Issue, hope this solves your Problem.

1st time Terraform Apply

root@terraformclient:~/Go_Workspace/src/github.com/terraform-providers/terraform-provider-bigip# terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # bigip_ltm_profile_http2.test-http2 will be created
  + resource "bigip_ltm_profile_http2" "test-http2" {
      + activation_modes                  = [
          + "alpn",
        ]
      + concurrent_streams_per_connection = 30
      + connection_idle_timeout           = 80
      + defaults_from                     = "/Common/http2"
      + header_table_size                 = 3800
      + id                                = (known after apply)
      + name                              = "/Common/test-http2"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

bigip_ltm_profile_http2.test-http2: Creating...
bigip_ltm_profile_http2.test-http2: Creation complete after 0s [id=/Common/test-http2]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Terraform Show

root@terraformclient:~/Go_Workspace/src/github.com/terraform-providers/terraform-provider-bigip# terraform show
# bigip_ltm_profile_http2.test-http2:
resource "bigip_ltm_profile_http2" "test-http2" {
    activation_modes                  = [
        "alpn",
    ]
    concurrent_streams_per_connection = 30
    connection_idle_timeout           = 80
    defaults_from                     = "/Common/http2"
    header_table_size                 = 3800
    id                                = "/Common/test-http2"
    name                              = "/Common/test-http2"
}

2 nd time Terraform apply with Name Change

root@terraformclient:~/Go_Workspace/src/github.com/terraform-providers/terraform-provider-bigip# terraform apply
bigip_ltm_profile_http2.test-http2: Refreshing state... [id=/Common/test-http2]

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # bigip_ltm_profile_http2.test-http2 will be updated in-place
  ~ resource "bigip_ltm_profile_http2" "test-http2" {
        activation_modes                  = [
            "alpn",
        ]
        concurrent_streams_per_connection = 30
        connection_idle_timeout           = 80
        defaults_from                     = "/Common/http2"
        header_table_size                 = 3800
        id                                = "/Common/test-http2"
      ~ name                              = "/Common/test-http2" -> "/Common/test-http2-new"
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

bigip_ltm_profile_http2.test-http2: Modifying... [id=/Common/test-http2]
bigip_ltm_profile_http2.test-http2: Modifications complete after 0s [id=/Common/test-http2]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Note: this Will not Change Profile Name on BIG-IP

RavinderReddyF5 commented 4 years ago

Comment by scshitole Tuesday Jul 16, 2019 at 16:10 GMT


126 fixes this problem