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 during Azure backend lock release #32871

Closed
1 task done
ScottS-byte opened this issue Feb 14, 2023 · 5 comments
Closed
1 task done

Terraform crash during Azure backend lock release #32871

ScottS-byte opened this issue Feb 14, 2023 · 5 comments
Labels
backend/azure bug crash duplicate issue closed because another issue already tracks this problem

Comments

@ScottS-byte
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v1.3.8 on darwin_arm64

AzureRM Provider Version

3.43.0

Affected Resource(s)/Data Source(s)

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

Terraform Configuration Files

terraform {
  required_version = ">= 1.3.0, < 1.4.0"
  backend "azurerm" {
    resource_group_name  = "TheName"
    storage_account_name = "thename1234567"
    container_name       = "statename"
    key                  = "dev/terraform.tfstate"
  }
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">= 3.35.0, < 4.0.0"
    }
    tls = {
      source  = "hashicorp/tls"
      version = "~> 4.0.4"
    }
    kubernetes = {
      source  = "hashicorp/kubernetes"
      version = "2.17.0"
    }
    random = {
      source  = "hashicorp/random"
      version = "3.4.3"
    }
  }
}

provider "azurerm" {
  features {
    key_vault {
      purge_soft_delete_on_destroy       = false
      purge_soft_deleted_keys_on_destroy = false
      recover_soft_deleted_key_vaults    = false
    }
    resource_group {
      prevent_deletion_if_contains_resources = false
    }
  }
}

provider "kubernetes" {
  config_path = "~/.kube/config"
}

provider "random" {}

Debug Output/Panic Output

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
Please report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version, the stack trace
shown below, and any additional information which may help replicate the issue.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

runtime error: invalid memory address or nil pointer dereference
goroutine 14 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
	runtime/debug/stack.go:16 +0x1c
github.com/hashicorp/terraform/internal/logging.PanicHandler()
	github.com/hashicorp/terraform/internal/logging/panic.go:55 +0x170
panic({0x104dfd0e0, 0x10641c9f0})
	runtime/panic.go:884 +0x204
github.com/hashicorp/terraform/internal/backend/remote-state/azure.(*RemoteClient).Put(0x14000861590, {0x140003b02c0, 0x14b, 0x160})
	github.com/hashicorp/terraform/internal/backend/remote-state/azure/client.go:88 +0x404
github.com/hashicorp/terraform/internal/states/remote.(*State).PersistState(0x14000d5fd40, 0x10502b5a0?)
	github.com/hashicorp/terraform/internal/states/remote/state.go:202 +0x4fc
github.com/hashicorp/terraform/internal/states/statemgr.WriteAndPersist({0x12e472bd0, 0x14000d5fd40}, 0x0?, 0x1400095de80?)
	github.com/hashicorp/terraform/internal/states/statemgr/helper.go:53 +0x58
github.com/hashicorp/terraform/internal/backend/local.(*Local).opApply(0x0?, {0x1051a8d38, 0x14000d1f700}, {0x1051a8d38, 0x14000d1f740}, 0x14000d2c480, 0x14000d1f6c0)
	github.com/hashicorp/terraform/internal/backend/local/backend_apply.go:201 +0xd14
github.com/hashicorp/terraform/internal/backend/local.(*Local).Operation.func1()
	github.com/hashicorp/terraform/internal/backend/local/backend.go:323 +0xd8
created by github.com/hashicorp/terraform/internal/backend/local.(*Local).Operation
	github.com/hashicorp/terraform/internal/backend/local/backend.go:316 +0x440

Expected Behaviour

No crash/lock released

Actual Behaviour

Crashed/unknown lock condition

Steps to Reproduce

Execute a terraform destroy

Important Factoids

No response

References

No response

@ScottS-byte
Copy link
Author

Also, the Resource Group was imported into terraform management. That showed as successful.

@github-actions github-actions bot removed the bug label Feb 14, 2023
@wuxu92
Copy link

wuxu92 commented Feb 15, 2023

Hi @ScottS-byte thanks for your feedback. but this looks like a terraform issue, which not relate to azurerm provider. may you file a issue in https://github.com/hashicorp/terraform/issues?

@manicminer
Copy link
Member

manicminer commented Mar 16, 2023

Transferring to hashicorp/terraform since this is a backend issue.

@manicminer manicminer transferred this issue from hashicorp/terraform-provider-azurerm Mar 16, 2023
@manicminer
Copy link
Member

Thanks for reporting this @ScottS-byte. This looks to be a duplicate of #32872, closing in favor of that issue. Please check #32872 for further updates.

@manicminer manicminer closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2023
@crw crw added duplicate issue closed because another issue already tracks this problem bug and removed bug labels Mar 21, 2023
@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend/azure bug crash duplicate issue closed because another issue already tracks this problem
Projects
None yet
Development

No branches or pull requests

4 participants