Terraform: Failed to unlock state: failed to retrieve lock info: unexpected end of JSON input

Viewed 5697
  • Terraform v0.13.5
  • provider aws v3.7.0
  • Backend: AWS S3+DynamoDB

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?

2 Answers

Solution: double-check you're in correct terraform workspace.

I had to switch to the right workspace and issue the command terraform force-unlcok -force to get away with the issue.

Related