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

Crash when attempting to change tags on an azurerm_virtual_machine_scale_set #13959

Closed
cberner opened this issue Apr 25, 2017 · 5 comments
Closed

Comments

@cberner
Copy link

cberner commented Apr 25, 2017

Terraform Version

0.9.3

Affected Resource(s)

  • azurerm_virtual_machine_scale_set

Terraform Configuration Files

resource "azurerm_resource_group" "testrg" {
  name = "cberner-testrg"
  location = "eastus"
}

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

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

resource "azurerm_storage_account" "testsa" {
  name                = "randomstring18hfjas983"
  resource_group_name = "${azurerm_resource_group.testrg.name}"

  location     = "eastus"
  account_type = "Standard_LRS"
}

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

resource "azurerm_virtual_machine_scale_set" "test" {
  name = "test_ss"
  location = "${azurerm_resource_group.testrg.location}"
  resource_group_name = "${azurerm_resource_group.testrg.name}"
  upgrade_policy_mode = "Manual"

  tags {
    test_tag = "value2"
  }

  sku {
    name = "Standard_D1_v2"
    tier = "Standard"
    capacity = 0
  }

  os_profile {
    computer_name_prefix = "test"
    admin_username = "ubuntu"
    admin_password = "Secret1234!"
  }

  os_profile_linux_config {
    disable_password_authentication = true

    ssh_keys {
      path = "/home/ubuntu/.ssh/authorized_keys"
      key_data = "${file("id_rsa.pub")}"
    }
  }

  storage_profile_image_reference {
     publisher = "Canonical"
     offer     = "UbuntuServer"
     sku       = "14.04.2-LTS"
     version   = "latest"
   }
 
   storage_profile_os_disk {
     caching           = "ReadWrite"
     create_option     = "FromImage"
     name = "osdisktest"
     vhd_containers = ["${azurerm_storage_account.testsa.primary_blob_endpoint}${azurerm_storage_container.test.name}"]
   }

   network_profile {
     name = "nic"
     primary = true

     ip_configuration {
       name = "primary"
       subnet_id = "${azurerm_subnet.test.id}"
    }
  }

  lifecycle {
    # Ideally, we would just ignore sku.capacity, storage_profile_os_disk.image, and os_profile.custom_data
    # but that doesn't seem to work
    ignore_changes = ["sku", "storage_profile_image_reference"]
  }
}

Expected Behavior

Tags should have been updated without crashing

Actual Behavior

Terraform crashed

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. Edit the tags of the Scale Set
  3. terraform apply
@grubernaut
Copy link
Contributor

Hi @cberner, can you please post the output of crash.log, either in a gist or a comment? Thanks.

@cberner
Copy link
Author

cberner commented Apr 25, 2017

Unfortunately no, crash.log appears to contain sensitive authorization information. If there's a piece of it that you need I can certainly post that.

This part looks particularly relevant:

2017/04/25 16:08:24 [DEBUG] plugin: terraform: panic: interface conversion: interface {} is nil, not map[string]interface {}
2017/04/25 16:08:24 [DEBUG] plugin: terraform:
2017/04/25 16:08:24 [DEBUG] plugin: terraform: goroutine 257 [running]:
2017/04/25 16:08:24 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/azurerm.expandAzureRmVirtualMachineScaleSetOsProfileLinuxConfig(0xc420306af0, 0x5aea5b9, 0x17, 0x58b93a0)
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine_scale_set.go:1085 +0x54c
2017/04/25 16:08:24 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/azurerm.expandAzureRMVirtualMachineScaleSetsOsProfile(0xc420306af0, 0xc4209f9860, 0x0, 0x0)
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine_scale_set.go:1000 +0x46a
2017/04/25 16:08:24 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/azurerm.resourceArmVirtualMachineScaleSetCreate(0xc420306af0, 0x546f940, 0xc420652000, 0x0, 0x0)
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine_scale_set.go:430 +0x36f
2017/04/25 16:08:24 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc4207a3800, 0xc420694050, 0xc4207de7e0, 0x546f940, 0xc420652000, 0x1, 0x28, 0xc42052b3b0)
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/resource.go:192 +0x378
2017/04/25 16:08:24 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc420528e70, 0xc420694000, 0xc420694050, 0xc4207de7e0, 0x96e8c20, 0x0, 0x0)
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/provider.go:242 +0x9b
2017/04/25 16:08:24 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc42072c900, 0xc4207de040, 0xc420a28af0, 0x0, 0x0)
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/gopath/src/github.com/hashicorp/terraform/plugin/resource_provider.go:488 +0x57
2017/04/25 16:08:24 [DEBUG] plugin: terraform: reflect.Value.call(0xc420168ae0, 0xc4201c6ba0, 0x13, 0x5a870f9, 0x4, 0xc4205e3f20, 0x3, 0x3, 0x0, 0xc42047b6f8, ...)
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/go/src/reflect/value.go:434 +0x91f
2017/04/25 16:08:24 [DEBUG] plugin: terraform: reflect.Value.Call(0xc420168ae0, 0xc4201c6ba0, 0x13, 0xc42047b720, 0x3, 0x3, 0xc42047b7c0, 0x139349e, 0xc420bdd1a0)
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/go/src/reflect/value.go:302 +0xa4
2017/04/25 16:08:24 [DEBUG] plugin: terraform: net/rpc.(*service).call(0xc4209eafc0, 0xc4209eaf80, 0xc420844040, 0xc4205a0600, 0xc42045cec0, 0x4c76ea0, 0xc4207de040, 0x16, 0x4c76ee0, 0xc420a28af0, ...)
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/go/src/net/rpc/server.go:387 +0x144
2017/04/25 16:08:24 [DEBUG] plugin: terraform: created by net/rpc.(*Server).ServeCodec
2017/04/25 16:08:24 [DEBUG] plugin: terraform:  /opt/go/src/net/rpc/server.go:481 +0x404

@grubernaut
Copy link
Contributor

@cberner, that's exactly the piece we need, thanks.

@grubernaut
Copy link
Contributor

@cberner this was fixed in #13464, and should be released in v0.9.4 shortly. Thanks!

@ghost
Copy link

ghost commented Apr 13, 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 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants