hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.53k stars 4.61k forks source link

Terraform crashes when you pass null value to availability zone - azure #8232

Closed UnixArena closed 4 years ago

UnixArena commented 4 years ago

Community Note

Terraform (and AzureRM Provider) Version

Affected Resource(s)

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Panic Output

azurerm_virtual_machine.main: Creating...\n\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\nTerraform crashed! This is always indicative of a bug within Terraform.\nA crash log has been placed at \"crash.log\" relative to your current\nworking directory. It would be immensely helpful if you could please\nreport the crash with Terraform[1] so that we can fix this.\n\nWhen reporting bugs, please include your terraform version. That\ninformation is available on the first line of crash.log. You can also\nget it by running 'terraform --version' on the command line.\n\nSECURITY WARNING: the \"crash.log\" file that was created may contain \nsensitive information that must be redacted before it is safe to share \non the issue tracker.\n\n[1]: https://github.com/hashicorp/terraform/issues\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\nstderr: \nError: rpc error: code = Unavailable desc = transport is closing\n\n\npanic: interface conversion: interface {} is nil, not string\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: goroutine 211 [running]:\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure.ExpandZones(0xc000678610, 0x1, 0x1, 0x3eb10c0)\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure/zones.go:54 +0x1e4\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/compute.resourceArmVirtualMachineCreateUpdate(0xc000cc7490, 0x4002a60, 0xc000300280, 0x0, 0x0)\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/compute/virtual_machine_resource.go:654 +0x338\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Resource).Apply(0xc000236480, 0xc00017e910, 0xc00071cdc0, 0x4002a60, 0xc000300280, 0x4029e01, 0xc0013890b8, 0xc0014181e0)\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:310 +0x365\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Provider).Apply(0xc00061e700, 0xc001353a10, 0xc00017e910, 0xc00071cdc0, 0xc001389118, 0xc00000f708, 0x402c040)\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/provider.go:294 +0x99\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(GRPCProviderServer).ApplyResourceChange(0xc000617008, 0x4ea8020, 0xc0013bdaa0, 0xc000cc6e70, 0xc000617008, 0xc0013bdaa0, 0xc001213b78)\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:885 +0x8b4\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x44051c0, 0xc000617008, 0x4ea8020, 0xc0013bdaa0, 0xc0000d9260, 0x0, 0x4ea8020, 0xc0013bdaa0, 0xc000517400, 0xb45)\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3305 +0x217\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: google.golang.org/grpc.(Server).processUnaryRPC(0xc0005c2480, 0x4ee5780, 0xc0005c2d80, 0xc000da8800, 0xc0007d4330, 0x7d2bc80, 0x0, 0x0, 0x0)\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1024 +0x501\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: google.golang.org/grpc.(Server).handleStream(0xc0005c2480, 0x4ee5780, 0xc0005c2d80, 0xc000da8800, 0x0)\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1313 +0xd3d\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: google.golang.org/grpc.(Server).serveStreams.func1.1(0xc000ad36e0, 0xc0005c2480, 0x4ee5780, 0xc0005c2d80, 0xc000da8800)\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:722 +0xa1\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: created by google.golang.org/grpc.(Server).serveStreams.func1\n2020-08-24T13:01:54.678Z [DEBUG] plugin.terraform-provider-azurerm_v2.24.0_x5: \t/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:720 +0xa1\n2020-08-24T13:01:54.681Z [DEBUG] plugin: plugin process exited: path=/tmp/awx_1462_ge90inqc/project/Playbooks/IaaS_VM/.terraform/plugins/linux_amd64/terraform-provider-azurerm_v2.24.0_x5 pid=923 error=\"exit status 2\"\n2020/08/24 13:01:54 [DEBUG] azurerm_virtual_machine.main: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing\n2020/08/24 13:01:54 [TRACE] : eval: terraform.EvalMaybeTainted\n2020/08/24 13:01:54 [TRACE] EvalMaybeTainted: azurerm_virtual_machine.main encountered an error during creation, so it is now marked as tainted\n2020/08/24 13:01:54 [TRACE] : eval: terraform.EvalWriteState\n2020/08/24 13:01:54 [TRACE] EvalWriteState: removing state object for azurerm_virtual_machine.main\n2020/08/24 13:01:54 [TRACE] : eval: terraform.EvalApplyProvisioners\n2020/08/24 13:01:54 [TRACE] EvalApplyProvisioners: azurerm_virtual_machine.main has no state, so skipping provisioners\n2020/08/24 13:01:54 [TRACE] : eval: terraform.EvalMaybeTainted\n2020/08/24 13:01:54 [TRACE] EvalMaybeTainted: azurerm_virtual_machine.main encountered an error during creation, so it is now marked as tainted\n2020/08/24 13:01:54 [TRACE] : eval: terraform.EvalWriteState\n2020/08/24 13:01:54 [TRACE] EvalWriteState: removing state object for azurerm_virtual_machine.main\n2020/08/24 13:01:54 [TRACE] : eval: terraform.EvalIf\n2020/08/24 13:01:54 [TRACE] : eval: terraform.EvalIf\n2020/08/24 13:01:54 [TRACE] : eval: terraform.EvalWriteDiff\n2020/08/24 13:01:54 [TRACE] : eval: terraform.EvalApplyPost\n2020/08/24 13:01:54 [ERROR] : eval: terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing\n2020/08/24 13:01:54 [ERROR] : eval: terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing\n2020/08/24 13:01:54 [TRACE] [walkApply] Exiting eval tree: azurerm_virtual_machine.main\n2020/08/24 13:01:54 [TRACE] vertex \"azurerm_virtual_machine.main\": visit complete\n2020/08/24 13:01:54 [TRACE] dag/walk: upstream of \"azurerm_backup_protected_vm.main\" errored, so skipping\n2020/08/24 13:01:54 [TRACE] dag/walk: upstream of \"meta.count-boundary (EachMode fixup)\" errored, so skipping\n2020/08/24 13:01:54 [TRACE] dag/walk: upstream of \"provider.azurerm (close)\" errored, so skipping\n2020/08/24 13:01:54 [TRACE] dag/walk: upstream of \"root\" errored, so skipping\n2020/08/24 13:01:54 [TRACE] statemgr.Filesystem: reading latest snapshot from terraform.tfstate\n2020/08/24 13:01:54 [TRACE] statemgr.Filesystem: read snapshot with lineage \"fd28c42c-682e-7407-de9d-03a8f10e8383\" serial 1\n2020/08/24 13:01:54 [TRACE] statemgr.Filesystem: no original state snapshot to back up\n2020/08/24 13:01:54 [TRACE] statemgr.Filesystem: state has changed since last snapshot, so incrementing serial to 2\n2020/08/24 13:01:54 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate\n2020/08/24 13:01:54 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info\n2020/08/24 13:01:54 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock\n2020-08-24T13:01:54.688Z [DEBUG] plugin: plugin exited\n\n"

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

ghost commented 4 years ago

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!