Loading...
Loading...
I received an error: ``` A resource with the ID "/subscriptions/ee5e21a4-eabf-4433-b676-e77f214d87f0/resourceGroups/in1_rsg_ep_auth_request/providers/Microsoft.Web/serverfarms/eharin1ue2apiasp" already exists ``` although this resource is no where to be found in the azure portal. It's like it's in limbo or something. When I try to import it, terraform crashes. <!-- Hi there, Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html. If your issue relates to a specific Terraform provider, please open it in the provider's own repository. The index of providers is at https://github.com/terraform-providers. To fix problems, we need clear reproduction cases - we need to be able to see it happen locally. A reproduction case is ideally something a Terraform Core engineer can git-clone or copy-paste and run immediately, without inventing any details or context. * A short example can be directly copy-pasteable; longer examples should be in separate git repositories, especially if multiple files are needed * Please include all needed context. For example, if you figured out that an expression can cause a crash, put the expression in a variable definition or a resource * Set defaults on (or omit) any variables. The person reproducing it should not need to invent variable settings * If multiple steps are required, such as running terraform twice, consider scripting it in a simple shell script. For example, see [this case](https://github.com/danieldreier/terraform-issue-reproductions/tree/master/25719). Providing a script can be easier than explaining what changes to make to the config between runs. * Omit any unneeded complexity: remove variables, conditional statements, functions, modules, providers, and resources that are not needed to trigger the bug * When possible, use the [null resource](https://www.terraform.io/docs/providers/null/resource.html) provider rather than a real provider in order to minimize external dependencies. We know this isn't always feasible. The Terraform Core team doesn't have deep domain knowledge in every provider, or access to every cloud platform for reproduction cases. --> ### Terraform Version <!--- Run `terraform version` to show the version, and paste the result between the ``` marks below. If you are not running the latest version of Terraform, please try upgrading because your issue may have already been fixed. --> ``` $ terraform --version Terraform v0.14.9 + provider registry.terraform.io/hashicorp/azurerm v2.52.0 ``` ### Terraform Configuration Files <!-- Paste the relevant parts of your Terraform configuration between the ``` marks below. For Terraform configs larger than a few resources, or that involve multiple files, please make a GitHub repository that we can clone, rather than copy-pasting multiple files in here. For security, you can also encrypt the files using our GPG public key at https://www.hashicorp.com/security. --> ```terraform resource "azurerm_app_service_plan" "api" { name = local.app_service_plan_name location = module.region.location resource_group_name = data.azurerm_resource_group.resource_group.name kind = "Linux" reserved = true app_service_environment_id = var.app_service_plan_id sku { tier = "Isolated" size = "I1" capacity = 2 } lifecycle { ignore_changes = [ tags, ] } timeouts { create = "6h" update = "4h" delete = "4h" } } ``` ### Debug Output <!-- Full debug output can be obtained by running Terraform with the environment variable `TF_LOG=trace`. Please create a GitHub Gist containing the debug output. Please do _not_ paste the debug output in the issue, since debug output is long. Debug output may contain sensitive information. Please review it before posting publicly, and if you are concerned feel free to encrypt the files using the HashiCorp security public key. --> ### Crash Output [crash.log](https://github.com/hashicorp/terraform/files/6205003/crash.log) ### Expected Behavior <!-- What should have happened? --> ### Actual Behavior ``` $ terraform import azurerm_app_service_plan.api '/subscriptions/ee5e21a4-eabf-4433-b676-e77f214d87f0/resourceGroups/in1_ rsg_ep_auth_request/providers/Microsoft.Web/serverfarms/eharin1ue2apiasp' Acquiring state lock. This may take a few moments... panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x10 pc=0x1a412f1] goroutine 16 [running]: github.com/hashicorp/terraform/backend/remote-state/azure.(*RemoteClient).Lock(0xc0005500f0, 0xc000117b00, 0xc0005500f0, 0x186742d04c0, 0xc0005500f0, 0x1) /home/circleci/project/project/backend/remote-state/azure/client.go:154 +0x291 github.com/hashicorp/terraform/states/remote.(*State).Lock(0xc00064d3e0, 0xc000117b00, 0x0, 0x0, 0x0, 0x0) /home/circleci/project/project/states/remote/state.go:208 +0xc4 github.com/hashicorp/terraform/states/statemgr.LockWithContext(0x33bc900, 0xc00064d440, 0x186742d0498, 0xc00064d3e0, 0xc000117b00, 0x0, 0x0, 0x0, 0x0) /home/circleci/project/project/states/statemgr/locker.go:76 +0x88 github.com/hashicorp/terraform/command/clistate.(*locker).Lock.func1(0x0, 0x0) /home/circleci/project/project/command/clistate/state.go:116 +0x65 github.com/hashicorp/terraform/helper/slowmessage.Do.func1(0xc00064d4a0, 0xc00053b140) /home/circleci/project/project/helper/slowmessage/slowmessage.go:20 +0x2e created by github.com/hashicorp/terraform/helper/slowmessage.Do /home/circleci/project/project/helper/slowmessage/slowmessage.go:19 +0x7e !!!!!!!!!!!!!!!!!!!!!!!!!!! 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. SECURITY WARNING: the "crash.log" file that was created may contain sensitive information that must be redacted before it is safe to share on the issue tracker. [1]: https://github.com/hashicorp/terraform/issues !!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!! ``` ### Steps to Reproduce <!-- Please list the full steps required to reproduce the issue, for example: 1. `terraform init` 2. `terraform apply` --> ### Additional Context <!-- Are there anything atypical about your situation that we should know? For example: is Terraform running in a wrapper script or in a CI system? Are you passing any unusual command line options or environment variables to opt-in to non-default behavior? --> ### References <!-- Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: - #6017 -->
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.