Hi Neha Kapoor
The safest approach is to only use terraform force-unlock <LOCK_ID> after you've confirmed that no Terraform operation is currently running against the same state. Before removing the lock, check your CI/CD pipeline history, active build agents, and any manual Terraform sessions to make sure there isn't an ongoing plan or apply that legitimately owns the lock.
You should review the lock metadata, as it usually contains details such as who created the lock, when it was created, and the operation that was running. If the pipeline has already failed or been terminated and no active process is referencing the state, the lock can generally be considered stale.
Once you've verified that, you can safely run the force-unlock command and then execute a terraform plan to confirm that the state remains healthy and accessible. As a best practice, try to identify why locks are being left behind in the first place, such as agent crashes, interrupted deployments, or backend connectivity issues, to prevent the problem from recurring.
If everything is okay, don't forget to share your experience with the issue by "Accept answer". If you need more information, feel free to leave a message. We are happy to help!