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

0.10.3 - Remote state lock release error, every apply #16012

Closed
samirageb opened this issue Sep 3, 2017 · 3 comments · Fixed by #16015
Closed

0.10.3 - Remote state lock release error, every apply #16012

samirageb opened this issue Sep 3, 2017 · 3 comments · Fixed by #16015
Assignees

Comments

@samirageb
Copy link
Contributor

This behavior appears to have started with terraform 10.3 and the only workaround I have atm is to disable state locking.

Terraform Version

0.10.3
go runtime 1.9

Affected Resource(s)

  • azurerm_resource_group
  • anything azure really, this this is tied to remote state

Terraform Configuration Files

variable "rg_name"                      { }
variable "location"                     { }

# Remote state data source, no interpolations allowed
terraform {
  backend "azurerm" {
    key = "***.terraform.tfstate"
    storage_account_name = "***"
    container_name       = "terraform-state"
  }
}

# Configure TF provider: Microsoft Azure
provider "azurerm" {
  version         = "~> 0.1"
  subscription_id = "***"
  client_id       = "***"
  client_secret   = "***"
  tenant_id       = "***"
}

resource "azurerm_resource_group" "bug_eastus" {
  name     = "${var.rg_name}"
  location = "${var.location}"
}

Debug Output

Terraform Init Output

Terraform Apply Output

Expected Behavior

Command returns upon completion

Actual Behavior

-Azure Rg successfully gets provisioned
-Lease on remote .tfstate Azure blob still shows 'leased', and must be manually broken

Steps to Reproduce

  1. terraform apply

Important Factoids

-I have confirmed this happens regardless of Azure storage account encryption at rest
-Appending a -lock=false to all terraform commands is the current workaround
-The repro steps were conducted on a fresh directory, with no .terraform folder created, or existing remote state file.
-Eventually this issue results in a .errorstate, which CAN be succesfully pushed if I manually delete the blob lease on the .tfstate blob

References

Originally posted here but told this behavior is part of TF core.

@attachmentgenie
Copy link

we see this behavior too using terraform 0.10.3 and azure plugin terraform-provider-azurerm_v0.1.5_x4

@tombuildsstuff
Copy link
Contributor

Hey @samirageb @attachmentgenie

Thanks for reporting this issue - I've taken a look into this and opened PR #16015 which includes a fix for this issue.

Thanks!

@ghost
Copy link

ghost commented Apr 7, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
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.

4 participants