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

Terraform crash due to govmomi property collector issue on dvportgroups #952

Closed
sofixa opened this issue Jan 23, 2020 · 5 comments
Closed
Labels
bug Type: Bug crash Impact: Crash dependencies Type: Dependencies upstream/govmomi Upstream: vmware/govmomi

Comments

@sofixa
Copy link

sofixa commented Jan 23, 2020

Terraform Version

Terraform v0.12.19
+ provider.aws v2.29.0
+ provider.gitlab v2.5.0
+ provider.solidfire (unversioned)
+ provider.vault v2.3.0
+ provider.vsphere v1.15.0 (same with v0.14.0 or master)

Against two 6.7.0.21000 vCenters

Affected Resource(s)

Please list the resources as a list, for example:

  • vsphere_distributed_port_group (i think)

Terraform Configuration Files

locals {
  context = {
    pa2_hosts            = data.vsphere_host.esxi_hosts_pa2[*]
    pa3_hosts            = data.vsphere_host.esxi_hosts_pa3[*]
    pa2_pool_id          = data.vsphere_resource_pool.pa2_pool.id
    pa3_pool_id          = data.vsphere_resource_pool.pa3_pool.id
    pa2_dc_id            = data.vsphere_datacenter.pa2.id
    pa3_dc_id            = data.vsphere_datacenter.pa3.id
    pa2_dvswitch_prod_id = data.vsphere_distributed_virtual_switch.pa2-dvs-prod.id
    pa2_dvswitch_adm_id  = data.vsphere_distributed_virtual_switch.pa2-dvs-adm.id
    pa3_dvswitch_prod_id = data.vsphere_distributed_virtual_switch.pa3-dvs-prod.id
    pa3_dvswitch_adm_id  = data.vsphere_distributed_virtual_switch.pa3-dvs-adm.id
  }
}

module "prod" {
  source    = "./module-network"
  vlan_id   = 655
  vlan_name = "655  - Prod"

  providers = {
    vsphere.pa2   = vsphere.pa2
    vsphere.pa3   = vsphere.pa3
    solidfire.pa2 = solidfire.pa2
    solidfire.pa3 = solidfire.pa3
  }

  context = local.context

}

#module-network:
root@1802d5ac77d5:/home/main# cat module-network/network.tf
resource "vsphere_distributed_port_group" "pa2-vlan" {
  provider                         = vsphere.pa2
  count                            = var.site == "pa2" || var.site == "pam" ? 1 : 0
  name                             = var.vlan_name
  distributed_virtual_switch_uuid  = var.vswitch == "Production" ? var.context.pa2_dvswitch_prod_id : var.context.pa2_dvswitch_adm_id
  vlan_id                          = var.vlan_id
  active_uplinks                   = ["${var.vswitch == "Production" ? "lag-prod" : "lag-adm" }"]
  block_override_allowed           = var.block_override_allowed
  netflow_override_allowed         = var.netflow_override_allowed
  security_policy_override_allowed = var.security_policy_override_allowed
  shaping_override_allowed         = var.shaping_override_allowed
  traffic_filter_override_allowed  = var.traffic_filter_override_allowed
  uplink_teaming_override_allowed  = var.uplink_teaming_override_allowed
  vlan_override_allowed            = var.vlan_override_allowed
}

resource "vsphere_distributed_port_group" "pa3-vlan" {
  provider                         = vsphere.pa3
  count                            = var.site == "pa3" || var.site == "pam" ? 1 : 0
  name                             = var.vlan_name
  distributed_virtual_switch_uuid  = var.vswitch == "Production" ? var.context.pa3_dvswitch_prod_id : var.context.pa3_dvswitch_adm_id
  vlan_id                          = var.vlan_id
  active_uplinks                   = ["${var.vswitch == "Production" ? "lag-prod" : "lag-adm" }"]
  block_override_allowed           = var.block_override_allowed
  netflow_override_allowed         = var.netflow_override_allowed
  security_policy_override_allowed = var.security_policy_override_allowed
  shaping_override_allowed         = var.shaping_override_allowed
  traffic_filter_override_allowed  = var.traffic_filter_override_allowed
  uplink_teaming_override_allowed  = var.uplink_teaming_override_allowed
  vlan_override_allowed            = var.vlan_override_allowed
}

Debug Output

The debug output is 796655 lines so i'll only provide the relevant part:

^[[0m^[[1mmodule.-prod-front.vsphere_distributed_port_group.pa2-vlan[0]: Refreshing state... [id=dvportgroup-2991]^[[0m
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere:
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere: goroutine 97 [running]:
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere: reflect.Value.Addr(0x1573440, 0xc000636700, 0x16, 0x1c24700, 0x159f340, 0x16)
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere:     /usr/local/go/src/reflect/value.go:258 +0x96
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x159f340, 0xc0006366c0, 0x194, 0xc000636640, 0xc0006366c0, 0x194)
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:347 +0x2f43
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x147f7c0, 0xc00069c1a8, 0x197, 0xc000636640, 0xc00069c1a8, 0x197)
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:442 +0x241d
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc0004535e0, 0x179dee0, 0xc00069c180, 0x199, 0x0, 0x0, 0x0, 0xc000636640, 0x1, ...)
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x179dee0, 0xc00069c180, 0x199, 0xc0006362c0, 0xc00069c180, 0x199)
2020-01-23T16:38:31.935Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x1481380, 0xc000636060, 0x197, 0xc0006362c0, 0xc000636060, 0x197)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:442 +0x241d
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc000453440, 0x17647a0, 0xc000636040, 0x199, 0x0, 0x0, 0x0, 0xc0006362c0, 0xffffffffff01, ...)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x1532580, 0xc00043c170, 0x196, 0xc000636000, 0xc00043c170, 0x196)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc000453220, 0x165acc0, 0xc00043c120, 0x199, 0x0, 0x0, 0x0, 0xc000636000, 0x203001, ...)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x165acc0, 0xc00043c120, 0x199, 0xc0004ddc80, 0x199, 0x165acc0)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x159f2c0, 0xc0004ddd00, 0x194, 0xc0004ddc80, 0xc0004ddd00, 0x194)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:335 +0x2ebb
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x147f780, 0xc000453168, 0x197, 0xc0004ddc80, 0xc000453168, 0x197)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:442 +0x241d
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc0005f0e40, 0x165a0e0, 0xc000453160, 0x199, 0x0, 0x0, 0x0, 0xc0004ddc80, 0xffffffffff01, ...)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x15732c0, 0xc000764630, 0x196, 0xc0004ddb00, 0xc000764630, 0x196)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc0006c17c0, 0x17d7240, 0xc000764600, 0x199, 0x0, 0x0, 0x0, 0xc0004ddb00, 0x1, ...)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x17d7240, 0xc000764600, 0x199, 0xc000438dc0, 0x199, 0x17d7240)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x15900c0, 0xc000124110, 0x194, 0xc000438dc0, 0xc000124110, 0x194)
2020-01-23T16:38:31.936Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:335 +0x2ebb
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc0006d22e0, 0x180a760, 0xc0001240e0, 0x199, 0x0, 0x0, 0x0, 0xc000438dc0, 0x1, ...)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x180a760, 0xc0001240e0, 0x199, 0xc0004389c0, 0x199, 0x180a760)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x1560440, 0xc000764590, 0x194, 0xc0004389c0, 0xc000764590, 0x194)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:335 +0x2ebb
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc0005f1ce0, 0x165b120, 0xc000764580, 0x199, 0x0, 0x0, 0x0, 0xc0004389c0, 0x1, ...)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x165b120, 0xc000764580, 0x199, 0xc000438800, 0xc000764580, 0x199)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x1481480, 0xc0007243e0, 0x197, 0xc000438800, 0xc0007243e0, 0x197)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:442 +0x241d
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc0005f1be0, 0x1736720, 0xc0007243c0, 0x199, 0x0, 0x0, 0x0, 0xc000438800, 0x153c501, ...)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x1736720, 0xc0007243c0, 0x199, 0xc000438640, 0xc0007243c0, 0x199)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x1484880, 0xc000452140, 0x197, 0xc000438640, 0xc000452140, 0x197)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:442 +0x241d
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc0005f1b80, 0x1605e80, 0xc000452140, 0x199, 0x0, 0x0, 0x0, 0xc000438640, 0xffffffffffff, ...)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x14585c0, 0xc0008eb228, 0x196, 0xc000438540, 0xc0008eb228, 0x196)
2020-01-23T16:38:31.937Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc0004e2d60, 0x16c49c0, 0xc0008eb220, 0x199, 0x0, 0x0, 0x0, 0xc000438540, 0x7, ...)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x1513c60, 0xc00074cee8, 0x194, 0xc000438400, 0xc00074cee8, 0x194)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshalPath(0xc000560000, 0xc00076c520, 0x16c6e80, 0xc00074cec0, 0x199, 0x0, 0x0, 0x0, 0xc000438400, 0xbf8290d974b26341, ...)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:716 +0x633
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).unmarshal(0xc000560000, 0x16c6e80, 0xc00074cec0, 0x199, 0xc000438300, 0x199, 0x0)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:547 +0x1097
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).DecodeElement(0xc000560000, 0x1430ec0, 0xc00074cec0, 0x0, 0xc000438080, 0x377b663e)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:133 +0x12b
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/xml.(*Decoder).Decode(...)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/xml/read.go:121
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/soap.(*Client).RoundTrip.func1(0xc0009f0000, 0x8132861c5, 0x283ada0)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/soap/client.go:574 +0xe8
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/soap.(*Client).Do(0xc00060eb40, 0x1c0bd00, 0xc000133ef0, 0xc000230b00, 0xc00028eeb8, 0x0, 0x0)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/soap/client.go:497 +0x2b6
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/soap.(*Client).RoundTrip(0xc00060eb40, 0x1c0bcc0, 0xc00042f020, 0x1be9a20, 0xc0008eb200, 0x1be9a20, 0xc0008eb220, 0xc000500380, 0x7f51732c08b8)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/soap/client.go:562 +0x926
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/session.(*keepAlive).RoundTrip(0xc00060c640, 0x1c0bcc0, 0xc00042f020, 0x1be9a20, 0xc0008eb200, 0x1be9a20, 0xc0008eb220, 0x203001, 0xc0008eb220)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/session/keep_alive.go:113 +0x7a
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25.(*Client).RoundTrip(0xc0000d6840, 0x1c0bcc0, 0xc00042f020, 0x1be9a20, 0xc0008eb200, 0x1be9a20, 0xc0008eb220, 0x40, 0x167a5c0)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/client.go:89 +0x80
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/vim25/methods.RetrieveProperties(0x1c0bcc0, 0xc00042f020, 0x1be8480, 0xc0000d6840, 0xc00074ce80, 0x0, 0x0, 0xc00074ce00)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/vim25/methods/methods.go:13479 +0xb8
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/property.(*Collector).RetrieveProperties(0xc00028f460, 0x1c0bcc0, 0xc00042f020, 0x0, 0x0, 0x0, 0x0, 0xc00074ce40, 0x1, 0x1, ...)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/property/collector.go:122 +0xf6
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/property.(*Collector).Retrieve(0xc00028f460, 0x1c0bcc0, 0xc00042f020, 0xc00028f440, 0x1, 0x1, 0xc0008eb1e0, 0x2, 0x2, 0x15a95a0, ...)
2020-01-23T16:38:31.938Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/property/collector.go:172 +0x3e5
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/property.(*Collector).RetrieveOne(...)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/property/collector.go:210
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: github.com/vmware/govmomi/object.Common.Properties(0xc0002ee6f0, 0x27, 0xc0000d6840, 0x1862464, 0x1b, 0xc000889430, 0xf, 0x1c0bcc0, 0xc00042f020, 0x1862464, ...)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/vmware/govmomi@v0.20.3/object/common.go:105 +0x18a
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/dvportgroup.Properties(0xc00074cdc0, 0x0, 0x0, 0x0)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /home/terraform-provider-vsphere/vsphere/internal/helper/dvportgroup/distributed_port_group_helper.go:107 +0x272
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: github.com/terraform-providers/terraform-provider-vsphere/vsphere.resourceVSphereDistributedPortGroupRead(0xc0002d64d0, 0x1526040, 0xc000413ce0, 0xc0002d64d0, 0x0)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /home/terraform-provider-vsphere/vsphere/resource_vsphere_distributed_port_group.go:120 +0x227
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: github.com/hashicorp/terraform/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000630680, 0xc000488550, 0x1526040, 0xc000413ce0, 0xc000133500, 0xc000488550, 0x0)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/hashicorp/terraform@v0.12.18/helper/schema/resource.go:455 +0x119
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: github.com/hashicorp/terraform/helper/plugin.(*GRPCProviderServer).ReadResource(0xc000606178, 0x1c0bd00, 0xc0004559e0, 0xc000488460, 0xc000606178, 0xc0004559e0, 0xc000679a58)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/hashicorp/terraform@v0.12.18/helper/plugin/grpc_provider.go:525 +0x3d8
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: github.com/hashicorp/terraform/internal/tfplugin5._Provider_ReadResource_Handler(0x17e5120, 0xc000606178, 0x1c0bd00, 0xc0004559e0, 0xc000488410, 0x0, 0x1c0bd00, 0xc0004559e0, 0xc000786000, 0x4d9)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/github.com/hashicorp/terraform@v0.12.18/internal/tfplugin5/tfplugin5.pb.go:3153 +0x217
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: google.golang.org/grpc.(*Server).processUnaryRPC(0xc000503500, 0x1c19ea0, 0xc000580c00, 0xc000174d00, 0xc0005ea480, 0x282ceb0, 0x0, 0x0, 0x0)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/google.golang.org/grpc@v1.21.1/server.go:998 +0x46a
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: google.golang.org/grpc.(*Server).handleStream(0xc000503500, 0x1c19ea0, 0xc000580c00, 0xc000174d00, 0x0)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/google.golang.org/grpc@v1.21.1/server.go:1278 +0xd97
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000142130, 0xc000503500, 0x1c19ea0, 0xc000580c00, 0xc000174d00)
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/google.golang.org/grpc@v1.21.1/server.go:717 +0xbb
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: created by google.golang.org/grpc.(*Server).serveStreams.func1
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere:     /go/pkg/mod/google.golang.org/grpc@v1.21.1/server.go:715 +0xa1
2020-01-23T16:38:31.939Z [DEBUG] plugin.terraform-provider-vsphere: 2020/01/23 16:38:31 [DEBUG] Reading tags for object "dvportgroup-2675"
2020-01-23T16:38:31.947Z [DEBUG] plugin: plugin process exited: path=/home/main/.terraform/plugins/linux_amd64/terraform-provider-vsphere pid=3018 error="exit status 2"

Expected Behavior

After an upgrade to 0.12 and a refactor of the modules to pass most shared data sources as parameters instead of having them in each module (to save time and resources), i'm doing a plan

Actual Behavior

which fails on the refresh stage (even a simple refresh results in the same). It's always on refreshing dvportgroups, random ones, and after the crash the rest of the refreshes fail with rpc error: code = Canceled desc = context canceled probably because the provider-vsphere died.
This is a project working perfectly (albeit slowly on 0.11) with slight refactoring (but nothing that should be seen during the refresh)

Steps to Reproduce

Not 100% sure, but basically:

  • have a lot of distributed virtual portgroups
  • refresh them

Potentially the fact they were created by 0.11 on an older provider version could change something, not sure.

Important Factoids

It's a huge project, and we have a similarly created dvportgroups on other, smaller projects, and they work fine (but they were created with 0.12, and are on a completely different group of vCenters, with slightly different versions, so maybe that changes something).

Since it seems like a basic govmomi issue, similar to the ones patched by #840 , i tried applying the same logic by limiting the returned properties by the properties collector, but that changes nothing (probably because those are the only two properties available for the type):

-       if err := pg.Properties(ctx, pg.Reference(), nil, &props); err != nil {
+       if err := pg.Properties(ctx, pg.Reference(), []string{"key", "config"}, &props); err != nil {

References

Basically the same thing, but for network_interface:

Thanks,
Adrian

@sofixa
Copy link
Author

sofixa commented Jan 24, 2020

FYI, i found that vCenter responds with a bad XML, which causes the panic. More details here, on the govmomi issue. Still hunting why exactly does vCenter respond badly and then stop responding (without saying anything in the logs), and why is this happening since moving to terraform 0.12 and terraform-provider-vsphere 1.14/1.15.

@aareet aareet added crash Impact: Crash bug Type: Bug labels Jan 27, 2020
@koikonom
Copy link
Contributor

Hi @sofixa,

Unfortunately, as you noticed yourself, even if we limit the properties we ask the Collector to return you'd still get the same issue. Until this is resolved upstream we can't do much.

I was looking at the govmomi issue you linked and looked at the logs you attached and I noticed this bit:

2020-01-24T16:25:18.818Z warning rhttpproxy[53281] [Originator@6876 sub=Default] SSL Handshake failed for stream <SSL(<io_obj p:0x00007f4bf4056550, h:30, <TCP '10.xx.xx.15 : 443'>, <TCP '10.xx.xx.136 : 48764'>>)>: N7Vmacore3Ssl12SSLExceptionE(SSL Exception: error:140000DB:SSL routines:SSL routines:short read: The connection was closed by the remote end during handshake.)

Is there a change you have some kind of firewall or proxy between the host running terraform and vsphere ? Could it be possible that the connection gets dropped because of its size and we only get back half of the response?

If you do have something in place can you try reproducing the issue by running terraform from a host in the same network as vsphere?

@koikonom koikonom added the waiting-response Status: Waiting on a Response label Jan 28, 2020
@sofixa
Copy link
Author

sofixa commented Jan 29, 2020

Hi @koikonom , thanks for the response.

IMHO the SSL Handshake failed for stream error comes because the provider has crashed, since it's later (1ms :D ) than the crash.

I tried running terraform from a machine on the same vlan as both vCenters, outside of docker as well, just in case. I've also updated the vCenters to the latest 6.7 version, still no dice :(

@ghost ghost removed the waiting-response Status: Waiting on a Response label Jan 29, 2020
@bill-rich bill-rich added the dependencies Type: Dependencies label Apr 4, 2020
@bill-rich
Copy link
Contributor

I'm going to close this one out since its an upstream issue. Once it is fixed in govmomi, we'll pull in the new version. Thanks @sofixa for keeping on getting the info to the govmomi team!

@bill-rich bill-rich added the upstream/govmomi Upstream: vmware/govmomi label Apr 13, 2020
@ghost
Copy link

ghost commented May 14, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators May 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug crash Impact: Crash dependencies Type: Dependencies upstream/govmomi Upstream: vmware/govmomi
Projects
None yet
Development

No branches or pull requests

4 participants