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 crashed when import azurerm vm with managed os disk #81

Closed
hashibot opened this issue Jun 13, 2017 · 3 comments · Fixed by #426
Closed

Terraform crashed when import azurerm vm with managed os disk #81

hashibot opened this issue Jun 13, 2017 · 3 comments · Fixed by #426

Comments

@hashibot
Copy link

This issue was originally opened by @djatlantic as hashicorp/terraform#14164. It was migrated here as part of the provider split. The original body of the issue is below.


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

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
Terraform v0.9.4

Affected Resource(s)

Please list the resources as a list, for example:

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

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.

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.

terraform import azurerm_virtual_machine.centos7test /subscriptions/xxxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Compute/virtualMachines/centos7test
azurerm_virtual_machine.centos7test: Importing from ID "/subscriptions/xxxxxxxx/resourceGroups/xxxxxx/providers/Microsoft.Compute/virtualMachines/centos7test"...
azurerm_virtual_machine.centos7test: Import complete!
Imported azurerm_virtual_machine (ID: /subscriptions/xxxxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Compute/virtualMachines/centos7test)
azurerm_virtual_machine.centos7test: Refreshing state... (ID: /subscriptions/xxxxxxx-...ft.Compute/virtualMachines/centos7test)
Error importing: 1 error(s) occurred:

  • azurerm_virtual_machine.centos7test (import id: /subscriptions/xxxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.Compute/virtualMachines/centos7test): 1 error(s) occurred:

  • import azurerm_virtual_machine.centos7test result: /subscriptions/xxxxxxxxx/resourceGroups/xxxxxx/providers/Microsoft.Compute/virtualMachines/centos7test: azurerm_virtual_machine.centos7test: unexpected EOF
    panic: runtime error: invalid memory address or nil pointer dereference
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1d53fc9]
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4:
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: goroutine 11 [running]:
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: github.com/hashicorp/terraform/builtin/providers/azurerm.resourceArmVirtualMachineRead(0xc4201f48c0, 0x4a19dc0, 0xc4203d2000, 0x0, 0x7a82560)
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine.go:642 +0x1499
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc4201cafc0, 0xc42072e280, 0x4a19dc0, 0xc4203d2000, 0xc420622660, 0xc420426201, 0x0)
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/resource.go:314 +0x21d
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc4202467e0, 0xc42072e230, 0xc42072e280, 0x7f0bd3f96000, 0x0, 0x0)
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/provider.go:267 +0x91
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc4206570e0, 0xc42069c6f0, 0xc42069c970, 0x0, 0x0)
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: /opt/gopath/src/github.com/hashicorp/terraform/plugin/resource_provider.go:510 +0x4e
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: reflect.Value.call(0xc420018de0, 0xc42000c4c0, 0x13, 0x505c04a, 0x4, 0xc4206b2f20, 0x3, 0x3, 0x0, 0x0, ...)
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: /opt/go/src/reflect/value.go:434 +0x91f
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: reflect.Value.Call(0xc420018de0, 0xc42000c4c0, 0x13, 0xc4205d6720, 0x3, 0x3, 0x0, 0xd4000f, 0xc4205d6720)
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: /opt/go/src/reflect/value.go:302 +0xa4
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: net/rpc.(*service).call(0xc4201bdb80, 0xc4201bdb00, 0xc4204509d8, 0xc420547c80, 0xc4203958c0, 0x41f8dc0, 0xc42069c6f0, 0x16, 0x41f8e00, 0xc42069c970, ...)
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: /opt/go/src/net/rpc/server.go:387 +0x144
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: created by net/rpc.(*Server).ServeCodec
    2017/05/02 16:00:26 [DEBUG] plugin: terraform_0.9.4: /opt/go/src/net/rpc/server.go:481 +0x404
    2017/05/02 16:00:26 [DEBUG] plugin: /home/struong/bin/terraform_0.9.4: plugin process exited
    2017/05/02 16:00:26 [ERROR] root: eval: *terraform.EvalRefresh, err: azurerm_virtual_machine.centos7test: unexpected EOF
    2017/05/02 16:00:26 [ERROR] root: eval: *terraform.EvalSequence, err: azurerm_virtual_machine.centos7test: unexpected EOF
    2017/05/02 16:00:26 [TRACE] [walkImport] Exiting eval tree: import azurerm_virtual_machine.centos7test result: /subscriptions/xxxxxx/resourceGroups/xxxxx/providers/Microsoft.Compute/virtualMachines/centos7test
    2017/05/02 16:00:26 [DEBUG] dag/walk: upstream errored, not walking "provider.azurerm (close)"
    2017/05/02 16:00:26 [WARN] plugin: error closing client during Kill: connection is shut down
    2017/05/02 16:00:26 [DEBUG] plugin: waiting for all plugin processes to complete...

!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 Terraform1 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.

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

@HighwayofLife
Copy link

HighwayofLife commented Sep 29, 2017

I just encountered this crash trying to import an azurevm with a managed disk...
Version:

Terraform v0.10.6
* provider.azurerm: version = "~> 0.2"
* provider.random: version = "~> 1.0"

Command with crash dump:

terraform import -allow-missing-config azurerm_virtual_machine.jenkinsvm /subscriptions/<redacted>/resourceGroups/BuildPipeline/providers/Microsoft.Compute/virtualMachines/jenkinsmaster
azurerm_virtual_machine.jenkinsvm: Importing from ID "/subscriptions/<redacted>/resourceGroups/BuildPipeline/providers/Microsoft.Compute/virtualMachines/jenkinsmaster"...
azurerm_virtual_machine.jenkinsvm: Import complete!
  Imported azurerm_virtual_machine (ID: /subscriptions/<redacted>/resourceGroups/BuildPipeline/providers/Microsoft.Compute/virtualMachines/jenkinsmaster)
azurerm_virtual_machine.jenkinsvm: Refreshing state... (ID: /subscriptions/0155ae7b-d9aa-4d1f-be91-....Compute/virtualMachines/jenkinsmaster)
Error importing: 3 error(s) occurred:

* module.jenkinsvm.provider.azurerm: unexpected EOF
* module.visual_studio_vm.provider.azurerm: unexpected EOF
* azurerm_virtual_machine.jenkinsvm (import id: /subscriptions/<redacted>/resourceGroups/BuildPipeline/providers/Microsoft.Compute/virtualMachines/jenkinsmaster): 1 error(s) occurred:

* import azurerm_virtual_machine.jenkinsvm result: /subscriptions/<redacted>/resourceGroups/BuildPipeline/providers/Microsoft.Compute/virtualMachines/jenkinsmaster: azurerm_virtual_machine.jenkinsvm: unexpected EOF
panic: runtime error: invalid memory address or nil pointer dereference
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1bdc2aa]
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: goroutine 39 [running]:
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: github.com/terraform-providers/terraform-provider-azurerm/azurerm.flattenAzureRmVirtualMachineOsDisk(0xc4202c0e40, 0x1e8499d, 0x17, 0x1e1af60)
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 	/opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_virtual_machine.go:1100 +0x3fa
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmVirtualMachineRead(0xc4201aa380, 0x1d87ec0, 0xc420356000, 0x0, 0x268ca00)
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 	/opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_virtual_machine.go:652 +0x5e5
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc4202ed2c0, 0xc420126280, 0x1d87ec0, 0xc420356000, 0xc4202c9a68, 0xc420303401, 0x80000000018)
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 	/opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:321 +0x199
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc420098930, 0xc4201261e0, 0xc420126280, 0x2a6bd90, 0x0, 0x18)
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 	/opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:284 +0x9a
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc4200ed3e0, 0xc4201464f0, 0xc420146810, 0x0, 0x0)
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 	/opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:510 +0x4e
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: reflect.Value.call(0xc42031e3c0, 0xc42000cab0, 0x13, 0x1e714ba, 0x4, 0xc4202a2f20, 0x3, 0x3, 0x20002, 0xc42028071c, ...)
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 	/usr/local/go/src/reflect/value.go:434 +0x906
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: reflect.Value.Call(0xc42031e3c0, 0xc42000cab0, 0x13, 0xc420280720, 0x3, 0x3, 0x130d99f, 0x1, 0x0)
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 	/usr/local/go/src/reflect/value.go:302 +0xa4
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: net/rpc.(*service).call(0xc420320000, 0xc420086550, 0xc420014af0, 0xc420124700, 0xc4200edf80, 0x1c95920, 0xc4201464f0, 0x16, 0x1c95960, 0xc420146810, ...)
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 	/usr/local/go/src/net/rpc/server.go:381 +0x142
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: created by net/rpc.(*Server).ServeCodec
2017-09-28T17:04:51.231-0700 [DEBUG] plugin.terraform-provider-azurerm_v0.2.0_x4: 	/usr/local/go/src/net/rpc/server.go:475 +0x36b
2017/09/28 17:04:51 [ERROR] root.visual_studio_vm: eval: *terraform.EvalConfigProvider, err: unexpected EOF
2017/09/28 17:04:51 [ERROR] root.visual_studio_vm: eval: *terraform.EvalSequence, err: unexpected EOF
2017/09/28 17:04:51 [ERROR] root.visual_studio_vm: eval: *terraform.EvalOpFilter, err: unexpected EOF
2017/09/28 17:04:51 [ERROR] root.jenkinsvm: eval: *terraform.EvalConfigProvider, err: unexpected EOF
2017/09/28 17:04:51 [ERROR] root.jenkinsvm: eval: *terraform.EvalSequence, err: unexpected EOF
2017/09/28 17:04:51 [ERROR] root.jenkinsvm: eval: *terraform.EvalOpFilter, err: unexpected EOF
2017/09/28 17:04:51 [ERROR] root.jenkinsvm: eval: *terraform.EvalSequence, err: unexpected EOF
2017/09/28 17:04:51 [TRACE] [walkImport] Exiting eval tree: module.jenkinsvm.provider.azurerm
2017/09/28 17:04:51 [ERROR] root.visual_studio_vm: eval: *terraform.EvalSequence, err: unexpected EOF
2017/09/28 17:04:51 [TRACE] dag/walk: upstream errored, not walking "module.jenkinsvm.azurerm_virtual_machine.vm"
2017/09/28 17:04:51 [TRACE] [walkImport] Exiting eval tree: module.visual_studio_vm.provider.azurerm
2017/09/28 17:04:51 [ERROR] root: eval: *terraform.EvalRefresh, err: azurerm_virtual_machine.jenkinsvm: unexpected EOF
2017/09/28 17:04:51 [TRACE] dag/walk: upstream errored, not walking "module.jenkinsvm.azurerm_network_interface.nic"
2017/09/28 17:04:51 [ERROR] root: eval: *terraform.EvalSequence, err: azurerm_virtual_machine.jenkinsvm: unexpected EOF
2017/09/28 17:04:51 [TRACE] dag/walk: upstream errored, not walking "module.visual_studio_vm.azurerm_network_interface.main"
2017/09/28 17:04:51 [TRACE] [walkImport] Exiting eval tree: import azurerm_virtual_machine.jenkinsvm result: /subscriptions/<redacted>/resourceGroups/BuildPipeline/providers/Microsoft.Compute/virtualMachines/jenkinsmaster
2017/09/28 17:04:51 [TRACE] dag/walk: upstream errored, not walking "module.visual_studio_vm.azurerm_virtual_machine.main"
2017/09/28 17:04:51 [TRACE] dag/walk: upstream errored, not walking "provider.azurerm (close)"
2017/09/28 17:04:51 [TRACE] dag/walk: upstream errored, not walking "root"
2017/09/28 17:04:51 [DEBUG] plugin: waiting for all plugin processes to complete...
2017-09-28T17:04:51.234-0700 [WARN ] plugin: error closing client during Kill: err="connection is shut down"
2017-09-28T17:04:51.234-0700 [DEBUG] plugin: plugin process exited: path=/Users/<redacted>/pipeline-azure-terraform/jenkins/.terraform/plugins/darwin_amd64/terraform-provider-azurerm_v0.2.0_x4
2017-09-28T17:04:51.236-0700 [DEBUG] plugin: plugin process exited: path=/Users/<redacted>/pipeline-azure-terraform/jenkins/.terraform/plugins/darwin_amd64/terraform-provider-random_v1.0.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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!

@tombuildsstuff
Copy link
Contributor

Fixed in #426

@ghost
Copy link

ghost commented Apr 1, 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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 1, 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