Terraform acquires a state lock to protect the state from being written by multiple users at the same time.


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.

Terraform.tfstate file got corrupted. rename your terraform.tfstate file.  

Error: Error locking state: Error acquiring the state lock: open terraform.tfstate: permission denied

Terraform acquires a state lock to protect the state from being writtenby 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.
aryan@aryan-VirtualBox:~/docker$ ll
aryan@aryan-VirtualBox:~/docker$ ls .terraform/
aryan@aryan-VirtualBox:~/docker$ less terraform.tfstate
aryan@aryan-VirtualBox:~/docker$ mv terraform.tfstate old_terraform.tfstate

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.