weixin_39717598
2020-12-08 18:32 阅读 0

Terraform crash

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


terraform destroy
azurerm_resource_group.test: Refreshing state... (ID: /subscriptions/1f5423b5-ed9c-44b5-b9fa-...sourceGroups/azure-functions-cptest-rg)
azurerm_app_service_plan.test: Refreshing state... (ID: /subscriptions/1f5423b5-ed9c-44b5-b9fa-...arms/azure-functions-test-service-plan)
azurerm_storage_account.test: Refreshing state... (ID: /subscriptions/1f5423b5-ed9c-44b5-b9fa-...e/storageAccounts/functionsapptestsajb)

Error: Error refreshing state: 2 error(s) occurred:

* azurerm_storage_account.test: 1 error(s) occurred:

* azurerm_storage_account.test: azurerm_storage_account.test: unexpected EOF
* azurerm_app_service_plan.test: 1 error(s) occurred:

* azurerm_app_service_plan.test: azurerm_app_service_plan.test: unexpected EOF


panic: runtime error: invalid memory address or nil pointer dereference
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1fdd1a9]
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: 
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: goroutine 74 [running]:
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmAppServicePlanRead(0xc4201d70a0, 0x24674e0, 0xc420429500, 0x0, 0x3113100)
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_app_service_plan.go:174 +0x579
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc42048a600, 0xc4205120f0, 0x24674e0, 0xc420429500, 0xc420150708, 0x1, 0x80000000002)
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_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
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc4201488c0, 0xc4205120a0, 0xc4205120f0, 0x37cb458, 0x0, 0xc420540028)
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_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
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc420534720, 0xc4203f2440, 0xc4203f2650, 0x0, 0x0)
2018-04-11T09:49:14.717-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_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
2018-04-11T09:49:14.718-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: reflect.Value.call(0xc4202a2720, 0xc4202a6090, 0x13, 0x24a8931, 0x4, 0xc42015ff20, 0x3, 0x3, 0x0, 0x0, ...)
2018-04-11T09:49:14.718-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4:   /usr/local/go/src/reflect/value.go:434 +0x905
2018-04-11T09:49:14.718-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: reflect.Value.Call(0xc4202a2720, 0xc4202a6090, 0x13, 0xc4202bf720, 0x3, 0x3, 0xc4205ac240, 0x0, 0x0)
2018-04-11T09:49:14.718-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4:   /usr/local/go/src/reflect/value.go:302 +0xa4
2018-04-11T09:49:14.718-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: net/rpc.(*service).call(0xc4202fc100, 0xc420076050, 0xc4200121b0, 0xc4201bc500, 0xc4201429a0, 0x2203780, 0xc4203f2440, 0x16, 0x22037c0, 0xc4203f2650, ...)
2018-04-11T09:49:14.718-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4:   /usr/local/go/src/net/rpc/server.go:381 +0x142
2018-04-11T09:49:14.718-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4: created by net/rpc.(*Server).ServeCodec
2018-04-11T09:49:14.718-0700 [DEBUG] plugin.terraform-provider-azurerm_v1.1.1_x4:   /usr/local/go/src/net/rpc/server.go:475 +0x36b
2018/04/11 09:49:14 [ERROR] root: eval: *terraform.EvalRefresh, err: azurerm_storage_account.test: unexpected EOF
2018/04/11 09:49:14 [ERROR] root: eval: *terraform.EvalRefresh, err: azurerm_app_service_plan.test: unexpected EOF
2018/04/11 09:49:14 [ERROR] root: eval: *terraform.EvalSequence, err: azurerm_storage_account.test: unexpected EOF
2018/04/11 09:49:14 [ERROR] root: eval: *terraform.EvalSequence, err: azurerm_app_service_plan.test: unexpected EOF
2018/04/11 09:49:14 [TRACE] [walkRefresh] Exiting eval tree: azurerm_storage_account.test
2018/04/11 09:49:14 [TRACE] [walkRefresh] Exiting eval tree: azurerm_app_service_plan.test
2018/04/11 09:49:14 [TRACE] dag/walk: upstream errored, not walking "azurerm_app_service.test"
2018/04/11 09:49:14 [TRACE] dag/walk: upstream errored, not walking "provider.azurerm (close)"
2018-04-11T09:49:14.722-0700 [DEBUG] plugin: plugin process exited: path=/Users/johnbel/terraform-work/test/.terraform/plugins/darwin_amd64/terraform-provider-azurerm_v1.1.1_x4
2018/04/11 09:49:14 [DEBUG] plugin: waiting for all plugin processes to complete...
2018-04-11T09:49:14.784-0700 [WARN ] plugin: error closing client during Kill: err="connection is shut down"



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

FNG172324:test johnbel$ terraform -v
Terraform v0.11.4
+ provider.azurerm v1.1.1

Your version of Terraform is out of date! The latest version
is 0.11.6. You can update by downloading from www.terraform.io/downloads.html

该提问来源于开源项目:terraform-providers/terraform-provider-azurerm

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • weixin_39740346 weixin_39740346 2020-12-08 18:32

    Hello ,

    Thank you for opening this issue. The crash seems to be caused by azure returning an empty location for the resource and the provider not checking for nil.

    relevant line 174 in v1.1.1 line: d.Set("location", azureRMNormalizeLocation(*resp.Location))

    This has been wrapped with a check in the latest unreleased version of the provider, v1.3.3, and I expect once it is released and you upgrade there will no longer be a crash 🙂

    点赞 评论 复制链接分享
  • weixin_39943442 weixin_39943442 2020-12-08 18:32

    Here is what I did to produce the error:

    I was able to resolve this by doing the following:

    terraform state list resource 1 resource 2 resource 3

    terraform state rm resource 1 terraform state rm resource 2 terraform state rm resource 3

    These 3 resources were some how cached somewhere even though I removed all resources manually. These resources were created with terraform.

    On Wed, Apr 11, 2018 at 10:53 AM, kt wrote:

    Hello https://github.com/nycjay01,

    Thank you for opening this issue. The crash seems to be caused by azure returning an empty location for the resource and the provider not checking for nil.

    relevant line 174 in v1.1.1 line: d.Set("location", azureRMNormalizeLocation(*resp.Location))

    This has been wrapped with a check in the latest unreleased version of the provider, v1.3.3, and I expect once it is released and you upgrade there will no longer be a crash 🙂

    — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terraform-providers/terraform-provider-azurerm/issues/1112#issuecomment-380540313, or mute the thread https://github.com/notifications/unsubscribe-auth/AVfFlq97ZgdmoB2PWG8zvVwncA0_hD_Fks5tnkMxgaJpZM4TQbcc .

    -- Thank You,

    John Beltrez 646 824 5828

    点赞 评论 复制链接分享
  • weixin_39795292 weixin_39795292 2020-12-08 18:32

    Closing this since it's fixed in master & will go out as part of the next release (v1.3.3)

    点赞 评论 复制链接分享
  • weixin_39717598 weixin_39717598 2020-12-08 18:32

    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.com. Thanks!

    点赞 评论 复制链接分享

相关推荐