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 0.12 crash on CTRL-C during updating azurerm resources #3537

Closed
ghost opened this issue May 28, 2019 · 3 comments · Fixed by #10051
Closed

terraform 0.12 crash on CTRL-C during updating azurerm resources #3537

ghost opened this issue May 28, 2019 · 3 comments · Fixed by #10051

Comments

@ghost
Copy link

ghost commented May 28, 2019

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


Terraform Version

$ terraform_0.12.0 version
Terraform v0.12.0
+ provider.azurerm v1.29.0

Terraform Configuration Files

resource "azurerm_resource_group" "redis_resource_group" {
  count    = 25
  name     = "${format("MetroRedisCaches-%02d", count.index)}"
  location = "northeurope"
}

variable "sp_id" {
  default = "<SP_ID>"
}

locals {
  res_group_ids = "${azurerm_resource_group.redis_resource_group.*.id}"
}


resource "azurerm_role_assignment" "redis_permission" {
  count                = "${length(local.res_group_ids)}"
  scope                = "${element(local.res_group_ids, count.index)}"
  role_definition_name = "Contributor"
  principal_id         = "${var.sp_id}"
}

data "azurerm_client_config" "current" {}

output "account_id" {
  value = "${data.azurerm_client_config.current.service_principal_application_id}"
}

Crash Output

See crash.log

Expected Behavior

CTRL-C exits cleanly

Actual Behavior

Terraform crashes on exit with below message

!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!
  on main.tf line 16, in resource "azurerm_role_assignment" "redis_permission":
  16: resource "azurerm_role_assignment" "redis_permission" {

Steps to Reproduce

  1. terraform init
  2. terraform apply
@katbyte
Copy link
Collaborator

katbyte commented Aug 27, 2019

Relevant bits of the crash log:

2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: panic: runtime error: invalid memory address or nil pointer dereference
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x2a0bdc4]
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: 
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: goroutine 2059 [running]:
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: github.com/terraform-providers/terraform-provider-azurerm/azurerm.retryRoleAssignmentsClient.func1(0xc0000c15e0)
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_role_assignment.go:223 +0x1d4
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/resource.Retry.func1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/resource/wait.go:22 +0x4e
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/resource.(*StateChangeConf).WaitForState.func1(0xc0005ea900, 0xc0005aff10, 0xc00015d400, 0xc00090bc20, 0xc00054f1f0, 0xc00054f1e8)
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/resource/state.go:103 +0x29e
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: created by github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/resource.(*StateChangeConf).WaitForState
2019-05-28T17:58:09.548+0300 [DEBUG] plugin.terraform-provider-azurerm_v1.29.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/resource/state.go:80 +0x1b9

@ghost
Copy link
Author

ghost commented Jan 8, 2021

This has been released in version 2.42.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.42.0"
}
# ... other configuration ...

@ghost
Copy link
Author

ghost commented Feb 4, 2021

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 as resolved and limited conversation to collaborators Feb 4, 2021
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.

2 participants