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 import azurerm_virtual_machine results in panic error #2359

Closed
mlcooper opened this issue Nov 19, 2018 · 1 comment
Closed

terraform import azurerm_virtual_machine results in panic error #2359

mlcooper opened this issue Nov 19, 2018 · 1 comment

Comments

@mlcooper
Copy link

mlcooper commented Nov 19, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

[coopem67@localhost bi-virtual-machines]$ terraform -v
Terraform v0.11.10
+ provider.azurerm v1.19.0

Affected Resource(s)

  • azurerm_virtual_machine

Terraform Configuration Files

Please note I made my Azure subscription ID all zeros; I had the correct ID in the command I ran.

terraform import -var-file=../storage.key -var-file=../tfvars/bi-prod.tfvars azurerm_virtual_machine.main[0] /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/BusinessIntelligence/providers/microsoft.compute/VirtualMachines/biprodintrunvm01

Debug Output

Debug gist

Panic Output

panic: runtime error: invalid memory address or nil pointer dereference
2018-11-19T14:14:53.080-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x1cc194d]
2018-11-19T14:14:53.080-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: 
2018-11-19T14:14:53.080-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: goroutine 46 [running]:
2018-11-19T14:14:53.080-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmVirtualMachineRead(0xc000528700, 0x2156020, 0xc0005be000, 0xc000528700, 0x0)
2018-11-19T14:14:53.080-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_virtual_machine.go:732 +0x5bd
2018-11-19T14:14:53.081-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc0003878f0, 0xc0004101e0, 0x2156020, 0xc0005be000, 0xc0003aca78, 0x4c2201, 0x1dfbba0)
2018-11-19T14:14:53.081-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:352 +0x160
2018-11-19T14:14:53.081-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc00039e930, 0xc000410190, 0xc0004101e0, 0xc000588a80, 0x18, 0x7f670a9c5000)
2018-11-19T14:14:53.081-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:308 +0x92
2018-11-19T14:14:53.081-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc00041dc80, 0xc000713440, 0xc0007136c0, 0x0, 0x0)
2018-11-19T14:14:53.082-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:549 +0x4e
2018-11-19T14:14:53.082-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: reflect.Value.call(0xc0002d38c0, 0xc00000d160, 0x13, 0x218cf71, 0x4, 0xc000928f18, 0x3, 0x3, 0xc0004a5440, 0x532061696c617274, ...)
2018-11-19T14:14:53.082-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: 	/opt/goenv/versions/1.11.1/src/reflect/value.go:447 +0x449
2018-11-19T14:14:53.083-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: reflect.Value.Call(0xc0002d38c0, 0xc00000d160, 0x13, 0xc000800718, 0x3, 0x3, 0x6145206164616e61, 0x736557222c227473, 0x2c22322053552074)
2018-11-19T14:14:53.083-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: 	/opt/goenv/versions/1.11.1/src/reflect/value.go:308 +0xa4
2018-11-19T14:14:53.083-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: net/rpc.(*service).call(0xc0004a5740, 0xc000410f00, 0xc0003620f0, 0xc000362110, 0xc0000c6800, 0xc000123ce0, 0x1dfbb60, 0xc000713440, 0x16, 0x1dfbba0, ...)
2018-11-19T14:14:53.084-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: 	/opt/goenv/versions/1.11.1/src/net/rpc/server.go:384 +0x14e
2018-11-19T14:14:53.084-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: created by net/rpc.(*Server).ServeCodec
2018-11-19T14:14:53.084-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.19.0_x4: 	/opt/goenv/versions/1.11.1/src/net/rpc/server.go:481 +0x47e
2018/11/19 14:14:53 [ERROR] root: eval: *terraform.EvalRefresh, err: azurerm_virtual_machine.main: unexpected EOF
2018/11/19 14:14:53 [ERROR] root: eval: *terraform.EvalSequence, err: azurerm_virtual_machine.main: unexpected EOF

Expected Behavior

I expected that terraform would import this first of two Azure VM's

Actual Behavior

Error: azurerm_virtual_machine.main[0] (import id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/BusinessIntelligence/providers/microsoft.compute/VirtualMachines/biprodintrunvm01): 1 error(s) occurred:

* import azurerm_virtual_machine.main[0] result: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/BusinessIntelligence/providers/microsoft.compute/VirtualMachines/biprodintrunvm01: azurerm_virtual_machine.main: unexpected EOF

See debug gist

Steps to Reproduce

terraform import -var-file=../storage.key -var-file=../tfvars/bi-prod.tfvars azurerm_virtual_machine.main[0] /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/BusinessIntelligence/providers/microsoft.compute/VirtualMachines/biprodintrunvm01

Important Factoids

I'm running in West US. This VM is one of two in an Azure Availability Set. There is no auto-scaling of any type configured.

References

  • #0000
@ghost
Copy link

ghost commented Mar 5, 2019

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 Mar 5, 2019
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