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

[azurerm] SIGSEGV on vnet import #4169

Closed
ghost opened this issue Aug 28, 2019 · 2 comments
Closed

[azurerm] SIGSEGV on vnet import #4169

ghost opened this issue Aug 28, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 28, 2019

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


Terraform Version

$  terraform --version
Terraform v0.12.5
+ provider.azurerm v1.32.0

Terraform Configuration Files

resource "azurerm_virtual_network_peering" "foo-bar" {
  name                         = "peerUKSX2UKSouthY"
  resource_group_name          = var.resource_group_name
  virtual_network_name         = "uk_south_netmap"
  remote_virtual_network_id    = "/subscriptions/xxx/resourceGroups/foo-bar/providers/Microsoft.Network/virtualNetworks/uk_south"
  allow_virtual_network_access = true
  allow_forwarded_traffic      = false
  allow_gateway_transit        = false
  depends_on                   = ["module.net-uk_south_foo"]
}

Debug Output

Check the log crash below.

Crash Output

 $  terraform import azurerm_virtual_network_peering.peerUKSnm2UKSouth /subscriptions/6fc88d09-cfee-4f23-yyy-xxx/resourceGroups/foo/providers/Microsoft.Network/virtualNetworks/uk_south
azurerm_virtual_network_peering.peerUKSnm2UKSouth: Importing from ID "/subscriptions/6fc88d09-cfee-4f23-yyy-xxx/resourceGroups/foo/providers/Microsoft.Network/virtualNetworks/uk_south"...
azurerm_virtual_network_peering.peerUKSnm2UKSouth: Import prepared!
  Prepared azurerm_virtual_network_peering for import
azurerm_virtual_network_peering.peerUKSnm2UKSouth: Refreshing state... [id=/subscriptions/6fc88d09-cfee-4f23-yyy-xxx/resourceGroups/foo/providers/Microsoft.Network/virtualNetworks/uk_south]

Error: rpc error: code = Unavailable desc = transport is closing


Releasing state lock. This may take a few moments...

$  terraform import azurerm_virtual_network_peering.peerUKSnm2UKSouth /subscriptions/6fc88d09-cfee-4f23-yyy-xxx/resourceGroups/foo/providers/Microsoft.Network/virtualNetworks/uk_south
azurerm_virtual_network_peering.peerUKSnm2UKSouth: Importing from ID "/subscriptions/6fc88d09-cfee-4f23-yyy-xxx/resourceGroups/foo/providers/Microsoft.Network/virtualNetworks/uk_south"...
azurerm_virtual_network_peering.peerUKSnm2UKSouth: Import prepared!
  Prepared azurerm_virtual_network_peering for import
azurerm_virtual_network_peering.peerUKSnm2UKSouth: Refreshing state... [id=/subscriptions/6fc88d09-cfee-4f23-yyy-xxx/resourceGroups/foo/providers/Microsoft.Network/virtualNetworks/uk_south]

Error: rpc error: code = Unavailable desc = transport is closing


panic: runtime error: invalid memory address or nil pointer dereference
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x3856f64]
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: 
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: goroutine 90 [running]:
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmVirtualNetworkPeeringRead(0xc0005c0690, 0x3dfdcc0, 0xc0007de000, 0xc0005c0690, 0x0)
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_virtual_network_peering.go:149 +0x464
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc00074cd00, 0xc000514230, 0x3dfdcc0, 0xc0007de000, 0xc000adc6f0, 0xc000514230, 0x0)
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:447 +0x119
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/plugin.(*GRPCProviderServer).ReadResource(0xc0000c24a0, 0x4586d40, 0xc000adc210, 0xc0010c60c0, 0xc0000c24a0, 0xc000adc210, 0xc000823ba8)
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/plugin/grpc_provider.go:496 +0x334
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/internal/tfplugin5._Provider_ReadResource_Handler(0x3dfe740, 0xc0000c24a0, 0x4586d40, 0xc000adc210, 0xc0005140f0, 0x0, 0x4586d40, 0xc000adc210, 0xc0010f4000, 0x179)
2019-07-29T17:13:02.222+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/internal/tfplugin5/tfplugin5.pb.go:2983 +0x23e
2019-07-29T17:13:02.223+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc00054c600, 0x45cdfa0, 0xc00054cd80, 0xc000a0c000, 0xc0007323c0, 0x7409650, 0x0, 0x0, 0x0)
2019-07-29T17:13:02.223+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:972 +0x470
2019-07-29T17:13:02.223+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc.(*Server).handleStream(0xc00054c600, 0x45cdfa0, 0xc00054cd80, 0xc000a0c000, 0x0)
2019-07-29T17:13:02.223+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1252 +0xda6
2019-07-29T17:13:02.223+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00024e110, 0xc00054c600, 0x45cdfa0, 0xc00054cd80, 0xc000a0c000)
2019-07-29T17:13:02.223+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:691 +0x9f
2019-07-29T17:13:02.223+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: created by github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
2019-07-29T17:13:02.223+0100 [DEBUG] plugin.terraform-provider-azurerm_v1.32.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:689 +0xa1
2019/07/29 17:13:02 [ERROR] <root>: eval: *terraform.EvalRefresh, err: rpc error: code = Unavailable desc = transport is closing
2019/07/29 17:13:02 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2019/07/29 17:13:02 [TRACE] [walkImport] Exiting eval tree: import azurerm_virtual_network_peering.peerUKSnm2UKSouth result
2019/07/29 17:13:02 [TRACE] vertex "import azurerm_virtual_network_peering.peerUKSnm2UKSouth result": visit complete
2019/07/29 17:13:02 [TRACE] vertex "azurerm_virtual_network_peering.peerUKSnm2UKSouth (import id \"/subscriptions/6fc88d09-cfee-4f23-yyy-xxx/resourceGroups/foo/providers/Microsoft.Network/virtualNetworks/uk_south\")": dynamic subgraph encountered errors
2019/07/29 17:13:02 [TRACE] vertex "azurerm_virtual_network_peering.peerUKSnm2UKSouth (import id \"/subscriptions/6fc88d09-cfee-4f23-yyy-xxx/resourceGroups/foo/providers/Microsoft.Network/virtualNetworks/uk_south\")": visit complete
2019/07/29 17:13:02 [TRACE] dag/walk: upstream of "provider.azurerm (close)" errored, so skipping
2019/07/29 17:13:02 [TRACE] dag/walk: upstream of "root" errored, so skipping
2019-07-29T17:13:02.227+0100 [DEBUG] plugin: plugin process exited: path=/Users/kenorb/example/.terraform/plugins/darwin_amd64/terraform-provider-azurerm_v1.32.0_x4 pid=27067 error="exit status 2"
2019-07-29T17:13:02.490+0100 [DEBUG] plugin: plugin exited



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

Crash log: crash.log.gz

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. I've created peering manually in Azure.
  2. I've tried to import it via terraform import azurerm_virtual_network_peering.peerUKSnm2UKSouth /subscriptions/6fc88d09-cfee-4f23-yyy-xxx/resourceGroups/foo/providers/Microsoft.Network/virtualNetworks/uk_south, but I had the error: Error: rpc error: code = Unavailable desc = transport is closing.
  3. So I've retried again, I had Error: rpc error: code = Unavailable desc = transport is closing error again, but this time Terraform crashed.

Additional Context

References

@mbfrahry
Copy link
Member

Hey @kenorb, thanks for taking the time to open this issue. We've found the problem and addressed it in #4180. That should go out in version 1.34.0 of the Azure Provider. Feel free to reopen this issue if you continue to have problems after that release goes out.

@ghost
Copy link
Author

ghost commented Sep 28, 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 Sep 28, 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

1 participant