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?
Solution: double-check you're in correct terraform workspace.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With