Reputation: 6854
terraform plan
was aborted, and now it cannot acquire the state lock. I'm trying to release it manually but get error:
terraform force-unlock -force xxx-xxx-xx-dddd
Failed to unlock state: failed to retrieve lock info:
unexpected end of JSON input
The state file looks complete and passes json syntax validation successfully.
How to fix that?
Upvotes: 15
Views: 16676
Reputation: 1282
I had the same issue. In my case, there were more than 1 .tfstate
files in the working directory. This was causing the problem.
1- Ensure you have only 1 .tfstate
file in the working directory
2- Ensure .tfstate file is valid.
Upvotes: 1
Reputation: 39
I had to switch to the right workspace and issue the command terraform force-unlcok -force to get away with the issue.
Upvotes: 0