Skip to content
ohsudo, Home

Tags

#locking

Error: Error acquiring the state lock
Infrastructure as Code

Terraform "Error acquiring the state lock": who holds it, and when force-unlock is safe

Fix Terraform and OpenTofu "Error acquiring the state lock": read the lock info, wait or find the running job, and use force-unlock only on a stale lock.

Intermediate · 4 min read