Hi, I'm Nicholas 👋

I'm a Senior Platform Engineer

Buy Me A Coffee

Removing Lock State from terraform

Date published:

In this blog post, I will show you how to remove the lock state error message on your terraform code. The other day I was running a pipeline code and got this error message saying the state file is locked like the one shown below.

The solution I found is that you can go to your remote state in your blob storage if you are storing your state file remotely in Azure and click on Break lease. You can also run the “terraform force -unlock to remotely unlock the state file. https://www.terraform.io/cli/commands/force-unlock

Further reading, hope this help someone