Error AtlasError Documentation and Resolution

Terraform could not acquire the state lock

Error acquiring the state lock.

Terraform could not continue because the backend reported that the state was already locked or could not be locked safely for a write operation.

Error acquiring the state lockstate
Error acquiring the state lock.
  • Another Terraform operation is already holding the lock for the same state.
  • A previous run failed and left a stale lock behind.
  • The backend lock operation failed due to configuration or connectivity issues.
  1. Check whether another Terraform run is still active against the same state and wait for it to complete if so.
  2. Verify that the chosen backend supports locking and is configured correctly.
  3. Use terraform force-unlock only when you are certain the existing lock is stale and not owned by another active run.
Terraform: State Locking
Terraform Error acquiring the state lock: causes and fixes | Error Atlas