Error: Error acquiring the state lock: blob metadata terraformlockid was empty This error prevents Terraform from executing because it cannot confirm whether the state file is currently locked by another process. Below, we’ll break down what this error means, why it happens, and how to fix it. Terraform uses state locking to prevent concurrent modifications to your infrastructure. When using the Azure backend (Azure Storage Account with a blob container), the lock is stored as metadata on the state blob (typically terraform.tfstate ). The metadata key is terraformlockid .
If you manage Azure infrastructure with Terraform, you might have encountered a frustrating error when running terraform plan or terraform apply : blob metadata terraformlockid was empty
This error is alarming at first, but it’s usually safe to fix by simply removing the empty metadata. Once cleared, Terraform will resume normal locking behavior. Error: Error acquiring the state lock: blob metadata