-
Notifications
You must be signed in to change notification settings - Fork 298
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
provider.azurerm v1.22.0 crashes terraform v0.11.11 and causes error locking tfstate #39
Comments
Hi @enorlando It looks like something in your configuration is causing terraform to panic, would you mind sharing with us some terraform config that triggers this crash so we can see whats going on? Thanks! |
Hi @katbyte I'm not sure where in the terraform config it is crashing. I have enabled trace logging and searched through the logs however it does not show me where it crashes during the plan. How can I pinpoint when it panic's as we have many terraform files for different azure configurations? |
hi @enorlando Taking a look into this - this error appears to be coming from a bug in the AzureRM Backend in Terraform Core, rather than something specific to this Provider. This bug exists in the Backend within Terraform 0.11 and was being tracked in this issue - however a fix for this has been merged and will ship as a part of Terraform 0.12. At this time it should be possible to unlock the Blob File within the Storage Account and re-try again, which should give you the underlying error (which should tell us how to proceed with this) - would you be able to take a look? Thanks! |
This is the error received when I break the lease from the Blob file and re-try Terraform Plan Error: Error locking state: Error acquiring the state lock: storage: service returned error: StatusCode=409, ErrorCode=LeaseAlreadyPresent, ErrorMessage=There is already a lease present. Terraform acquires a state lock to protect the state from being written |
Hi @tombuildsstuff |
hi @enorlando Thanks for confirming that - this is a duplicate of hashicorp/terraform#17046 and as such I'm going to close it in favour of that issue, which has been resolved and the fix is available as of Terraform 0.12. Regarding a release date for Terraform 0.12 - Beta 1 of Terraform 0.12 has recently been released however there's no more information about the release date available at this time, unfortunately. Thanks! |
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@hashicorp.com. Thanks! |
Community Note
Terraform (and AzureAD Provider) Version
Affected Resource(s)
Terraform v0.11.11
Terraform Configuration Files
Debug Output
Panic Output
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x176c6a8]
goroutine 6110 [running]:
github.com/hashicorp/terraform/terraform.(*NodeRefreshableManagedResourceInstance).evalTreeManagedResourceNoState(0xc000308030, 0xa2176d0, 0xc0008480a0)
/private/tmp/terraform-20181217-80581-zpqwjg/terraform-0.11.11/src/github.com/hashicorp/terraform/terraform/node_resource_refresh.go:238 +0x328
github.com/hashicorp/terraform/terraform.(*NodeRefreshableManagedResourceInstance).EvalTree(0xc000308030, 0x3ae1700, 0xc000308030)
/private/tmp/terraform-20181217-80581-zpqwjg/terraform-0.11.11/src/github.com/hashicorp/terraform/terraform/node_resource_refresh.go:98 +0x6e
github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x3ae1700, 0xc000308030, 0x0, 0x0)
/private/tmp/terraform-20181217-80581-zpqwjg/terraform-0.11.11/src/github.com/hashicorp/terraform/terraform/graph.go:113 +0x9a2
github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc0009f8000, 0x3ae1700, 0xc000308030, 0xc0002fe2c0)
/private/tmp/terraform-20181217-80581-zpqwjg/terraform-0.11.11/src/github.com/hashicorp/terraform/dag/walk.go:387 +0x367
created by github.com/hashicorp/terraform/dag.(*Walker).Update
/private/tmp/terraform-20181217-80581-zpqwjg/terraform-0.11.11/src/github.com/hashicorp/terraform/dag/walk.go:310 +0x986
Expected Behavior
Terraform should have successfully run a plan.
Steps to Reproduce
Important Factoids
Below error when running terraform plan second time. When the tfstate state is leased in azure, it will lock again running a plan
Error: Error locking state: Error acquiring the state lock: storage: service returned error: StatusCode=409, ErrorCode=LeaseAlreadyPresent, ErrorMessage=There is already a lease present.
RequestId:b2592325-701e-004a-607e-c2a9a8000000
Time:2019-02-12T02:57:14.9888560Z, RequestInitiated=Tue, 12 Feb 2019 02:57:14 GMT, RequestId=b2592325-701e-004a-607e-c2a9a8000000, API Version=2016-05-31, QueryParameterName=, QueryParameterValue=
Lock Info:
ID: xxxxx
Path: xxxxxx
Operation: OperationTypePlan
Who: xxxxxx
Version: 0.11.11
Created: 2019-02-12 02:56:55.201233 +0000 UTC
Info:
Terraform acquires a state lock to protect the state from being written
by multiple users at the same time. Please resolve the issue above and try
again. For most commands, you can disable locking with the "-lock=false"
flag, but this is not recommended.
The text was updated successfully, but these errors were encountered: