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 crash while trying to import remote existing resources to state for Azure #1196

Closed
ghost opened this issue May 3, 2018 · 3 comments · Fixed by #1208
Closed

Terraform crash while trying to import remote existing resources to state for Azure #1196

ghost opened this issue May 3, 2018 · 3 comments · Fixed by #1208

Comments

@ghost
Copy link

ghost commented May 3, 2018

This issue was originally opened by @bardhi232 as hashicorp/terraform#17986. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

0.11.7

Terraform Configuration Files

...

Debug Output

Crash Output

[root@u185178-fatbardh-hysa test3]# /home/centos/proxychains/proxychains4 terraform import azurerm_virtual_network.tvn /subscriptions/SUBSCRIPTION_ID/resourceGroups/fhy-test-rs/providers/Microsoft.Network/virtualnetworks/test-vnet/subnets/sub3
[proxychains] config file found: /usr/local/etc/proxychains.conf
[proxychains] preloading /home/centos/proxychains/libproxychains4.so
azurerm_virtual_network.tvn: Importing from ID "/subscriptions/SUBSCRIPTION_ID/resourceGroups/fhy-test-rs/providers/Microsoft.Network/virtualnetworks/test-vnet/subnets/sub3"...
azurerm_virtual_network.tvn: Import complete!
  Imported azurerm_virtual_network (ID: /subscriptions/SUBSCRIPTION_ID/resourceGroups/fhy-test-rs/providers/Microsoft.Network/virtualnetworks/test-vnet/subnets/sub3)
azurerm_virtual_network.tvn: Refreshing state... (ID: /subscriptions/7174e288-bcac-4aee-94e8-...virtualnetworks/test-vnet/subnets/sub3)
 
Error: azurerm_virtual_network.tvn (import id: /subscriptions/SUBSCRIPTION_ID/resourceGroups/fhy-test-rs/providers/Microsoft.Network/virtualnetworks/test-vnet/subnets/sub3): 1 error(s) occurred:
 
* import azurerm_virtual_network.tvn result: /subscriptions/SUBSCRIPTION_ID/resourceGroups/fhy-test-rs/providers/Microsoft.Network/virtualnetworks/test-vnet/subnets/sub3: azurerm_virtual_network.tvn: unexpected EOF
 
 
panic: runtime error: invalid memory address or nil pointer dereference
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x459078]
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4:
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: goroutine 38 [running]:
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmVirtualNetworkRead(0xc42012ec40, 0x1bf5460, 0xc4203b4000, 0xc42012ec40, 0x0)
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_virtual_network.go:165 +0x290
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc4203f2540, 0xc42005c370, 0x1bf5460, 0xc4203b4000, 0xc4203fe980, 0xb9ca01, 0x800203f2a80)
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:354 +0x17e
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc4203f2a80, 0xc42005c320, 0xc42005c370, 0x7f470dcfa000, 0x0, 0x18)
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:308 +0x9a
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc4202b1260, 0xc4205955c0, 0xc420595800, 0x0, 0x0)
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:549 +0x4e
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: reflect.Value.call(0xc4203667e0, 0xc42000d098, 0x13, 0x1c363e5, 0x4, 0xc42063af20, 0x3, 0x3, 0xc42010b700, 0xc42010b720, ...)
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4:   /usr/local/go/src/reflect/value.go:434 +0x905
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: reflect.Value.Call(0xc4203667e0, 0xc42000d098, 0x13, 0xc420777f20, 0x3, 0x3, 0xc42010b860, 0xc42010b880, 0xc42010b8a0)
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4:   /usr/local/go/src/reflect/value.go:302 +0xa4
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: net/rpc.(*service).call(0xc4201e1c00, 0xc42005db30, 0xc420361768, 0xc4200a5280, 0xc4202b1e40, 0x1940d00, 0xc4205955c0, 0x16, 0x1940d40, 0xc420595800, ...)
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4:   /usr/local/go/src/net/rpc/server.go:381 +0x142
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4: created by net/rpc.(*Server).ServeCodec
2018-05-02T09:13:20.530Z [DEBUG] plugin.terraform-provider-azurerm_v1.3.3_x4:   /usr/local/go/src/net/rpc/server.go:475 +0x36b
2018-05-02T09:13:20.530Z [DEBUG] plugin: plugin process exited: path=/root/.terraform.d/plugins/linux_amd64/terraform-provider-azurerm_v1.3.3_x4
2018-05-02T09:13:20.530Z [WARN ] plugin: error closing client during Kill: err="connection is shut down"
2018-05-02T09:13:20.532Z [DEBUG] plugin: plugin process exited: path=/root/.terraform.d/plugins/linux_amd64/terraform-provider-random_v1.2.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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Expected Behavior

Actual Behavior

Steps to Reproduce

terraform import azurerm_virtual_network.tvn /subscriptions/SUBSCRIPTION_ID/resourceGroups/fhy-test-rs/providers/Microsoft.Network/virtualnetworks/test-vnet/subnets/sub3

Additional Context

References

@ghost ghost added bug crash labels May 3, 2018
@tombuildsstuff tombuildsstuff added this to the 1.5.0 milestone May 6, 2018
tombuildsstuff added a commit that referenced this issue May 7, 2018
* Removing crash points from `azurerm_virtual_network`

Fixes #1196

* Fixing issues raised during code review
@katbyte
Copy link
Collaborator

katbyte commented May 14, 2018

Hi @bardhi232,

Just a heads up that we have released v1.5.0 of the provider that includes this fix 🙂

@kenorb
Copy link

kenorb commented Jul 29, 2019

Similar issue at hashicorp/terraform/issues/22235 with azurerm_v1.32

@ghost
Copy link
Author

ghost commented Jul 30, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 30, 2019
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.

3 participants