Error on Terraform plan

hi expert,
Good day, I facing an error when running Terraform plan, and I try run the force unlock, but show is LocalState is not locked

can help on this issue? thanks a lot

Hi @ecvkvin,

The local state storage uses the file locking mechanisms provided by your operating system to achieve state locking, and so those locks are managed automatically by your operating system and cannot be “stolen” using the force-unlock command. That command is intended instead for the various remote state backends that handle locking by calling a remote API; a remote API always requires explicit unlocking calls, which is what the Terraform command will call.

In your case it seems like something is already holding the lock outside of the terraform plan command you tried to run. I can’t tell what that is from here, but I would suggest looking at the other processes running on your system to see if there are any other Terraform processes running, or if there’s anything else on your system that might for some reason be trying to access this state file. You will need to stop that other program (or somehow make it release its lock) so that the OS will allow your Terraform command to lock the state file.

thanks for your help. now is work it