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

Azure RM VM with Subnets issue #10744

Closed
dennisrd587 opened this issue Dec 15, 2016 · 2 comments
Closed

Azure RM VM with Subnets issue #10744

dennisrd587 opened this issue Dec 15, 2016 · 2 comments

Comments

@dennisrd587
Copy link

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v0.7.13

Affected Resource(s)

azurerm_subnet

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

### Debug Output
Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

### Panic Output
I've attached the crash log

### Expected Behavior
I'm attempting to build out a small environment in Azure

- Vnet with subnets

- resource group

- storage account

- Windows server

### Actual Behavior
I've tried to work around this by commenting out the subnets, and it seems to get past the "terramark plan", but when I uncomment them, I get the crash log

### Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
1. `terraform plan`

### Important Factoids
Trying to build in an Azure RM EA subscription

### References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
- GH-1234
[crash.log.txt](https://github.com/hashicorp/terraform/files/653739/crash.log.txt)
@tombuildsstuff
Copy link
Contributor

Hi @dennisrd587

Thanks for reporting this bug - apologies for the delayed response here!

I've been able to reproduce this issue using the following Terraform config:

resource "azurerm_resource_group" "test" {
  name     = "bug10744"
  location = "West Europe"
}

resource "azurerm_virtual_network" "test" {
  name                = "bug10744vn"
  address_space       = ["10.0.0.0/16"]
  location            = "${azurerm_resource_group.test.location}"
  resource_group_name = "${azurerm_resource_group.test.name}"
}

resource "azurerm_subnet" "test" {
  name                 = "bug10744sn"
  resource_group_name  = "${azurerm_resource_group.test.name}"
  virtual_network_name = "${azurerm_virtual_network.test.name}"
  address_prefix       = "10.0.2.0/24"
}

resource "azurerm_network_interface" "test" {
  name                = "bug10744nic"
  location            = "${azurerm_resource_group.test.location}"
  resource_group_name = "${azurerm_resource_group.test.name}"

  ip_configuration {
    name                          = "testconfiguration1"
    subnet_id                     = "${azurerm_subnet.test.id}"
    private_ip_address_allocation = "dynamic"
  }
}

resource "azurerm_storage_account" "test" {
  name                = "bug10744sa"
  resource_group_name = "${azurerm_resource_group.test.name}"
  location            = "${azurerm_resource_group.test.location}"
  account_type        = "Standard_LRS"
}

resource "azurerm_storage_container" "test" {
  name                  = "vhds"
  resource_group_name   = "${azurerm_resource_group.test.name}"
  storage_account_name  = "${azurerm_storage_account.test.name}"
  container_access_type = "private"
}

resource "azurerm_virtual_machine" "test" {
  name                  = "bug10744vm"
  location              = "${azurerm_resource_group.test.location}"
  resource_group_name   = "${azurerm_resource_group.test.name}"
  network_interface_ids = ["${azurerm_network_interface.test.id}"]
  vm_size               = "Standard_F2"

  storage_image_reference {
    publisher = "MicrosoftWindowsServer"
    offer     = "WindowsServer"
    sku       = "2012-Datacenter"
    version   = "latest"
  }

  storage_os_disk {
    name          = "bug10744disk1"
    vhd_uri       = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/bug10744disk1.vhd"
    caching       = "ReadWrite"
    create_option = "FromImage"
  }

  os_profile {
    computer_name  = "bug10744vm"
    admin_username = "testadmin"
    admin_password = "Password1234!"
  }

  os_profile_windows_config {}
}

When attempting a plan, the following Stack Trace is thrown, which matches what you've reported in Terraform 0.7.13:

2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: panic: interface conversion: interface {} is nil, not map[string]interface {}
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: goroutine 76 [running]:
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/builtin/providers/azurerm.resourceArmVirtualMachineStorageOsProfileWindowsConfigHash(0x0, 0x0, 0xc4203cb798)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine.go:868 +0x3b9
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc4203cb780, 0x0, 0x0, 0x1965f40, 0xc4201cb2c0)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x3d
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc4203cb780, 0x0, 0x0, 0xc42037fc00, 0x0, 0xc4203cbae0)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/set.go:167 +0x81
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*ConfigFieldReader).readSet(0xc420481920, 0xc4204ab500, 0x1, 0x1, 0xc42037fc20, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/field_reader_config.go:289 +0x3b0
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*ConfigFieldReader).readField(0xc420481920, 0xc4204ab500, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/field_reader_config.go:115 +0x93c
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*ConfigFieldReader).ReadField(0xc420481920, 0xc4204ab500, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, ...)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/field_reader_config.go:27 +0xe3
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*MultiLevelFieldReader).ReadFieldExact(0xc420495b60, 0xc4204ab500, 0x1, 0x1, 0x1a6210d, 0x6, 0x0, 0x0, 0x0, 0x0, ...)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/field_reader_multi.go:31 +0xef
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*ResourceData).get(0xc420108930, 0xc4204ab500, 0x1, 0x1, 0xc4204ab512, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/resource_data.go:475 +0x13a
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*ResourceData).getChange(0xc420108930, 0x1a7531e, 0x19, 0xc420451201, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/resource_data.go:451 +0x135
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*ResourceData).diffChange(0xc420108930, 0x1a7531e, 0x19, 0xc42037b860, 0xc4206dd618, 0xc420108930, 0x1, 0x0)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/resource_data.go:428 +0x61
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.schemaMap.diffSet(0xc4201cb3b0, 0x1a7531e, 0x19, 0xc42037fc20, 0xc4206dd618, 0xc420108930, 0x1a19a00, 0x0, 0x0)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/schema.go:915 +0x5d
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.schemaMap.diff(0xc4201cb3b0, 0x1a7531e, 0x19, 0xc42037fc20, 0xc420495960, 0xc420108930, 0x111a400, 0x0, 0x0)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/schema.go:678 +0x4b1
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.schemaMap.Diff(0xc4201cb3b0, 0xc420016500, 0xc420481380, 0x0, 0x0, 0xa)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/schema.go:389 +0x1c2
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*Resource).Diff(0xc4201dbd40, 0xc420016500, 0xc420481380, 0x17, 0xc420392178, 0x1)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/resource.go:211 +0x15b
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/helper/schema.(*Provider).Diff(0xc4201d60e0, 0xc420016370, 0xc420016500, 0xc420481380, 0x23004b0, 0x0, 0xc42001f300)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/helper/schema/provider.go:255 +0x84
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Diff(0xc4201c63a0, 0xc420495040, 0xc4204c3040, 0x0, 0x0)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/Users/tharvey/code/src/github.com/hashicorp/terraform/plugin/resource_provider.go:499 +0x57
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: reflect.Value.call(0xc42027f0e0, 0xc42024e750, 0x13, 0x1a6033d, 0x4, 0xc420233f20, 0x3, 0x3, 0x0, 0xc4204a66c0, ...)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:434 +0x91f
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: reflect.Value.Call(0xc42027f0e0, 0xc42024e750, 0x13, 0xc420211f20, 0x3, 0x3, 0xc4203421e0, 0xc420211f48, 0xc420211f48)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/usr/local/Cellar/go/1.8/libexec/src/reflect/value.go:302 +0xa4
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: net/rpc.(*service).call(0xc420353880, 0xc420353840, 0xc420359a48, 0xc42029f700, 0xc42028e800, 0x18ed440, 0xc420495040, 0x16, 0x18ed480, 0xc4204c3040, ...)
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/usr/local/Cellar/go/1.8/libexec/src/net/rpc/server.go:387 +0x144
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: created by net/rpc.(*Server).ServeCodec
2017/04/18 20:41:06 [DEBUG] plugin: terraform-provider-azurerm: 	/usr/local/Cellar/go/1.8/libexec/src/net/rpc/server.go:481 +0x404

After some further investigation - it looks like this is limited to the os_profile_windows_config block, as the os_profile_linux_config block has required properties.

I'm looking into this issue at the moment, and I hope to open a PR shortly :)

Thanks!

@ghost
Copy link

ghost commented Apr 10, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants