WhatsApp

What to Do When Terraform Reports a State Lock That Will Not Clear

11/10/2026

Terraform may refuse to run because a state lock remains after a terminal closed, a runner stopped, or a network interruption. Removing the lock without confirming that no process is still changing state can allow concurrent writes and damage the infrastructure record.

Identify the lock holder

Read the lock details, backend logs, pipeline status, and recent operator activity. Confirm that no local or CI job is still running for the same workspace. Check whether the state backend is healthy and whether a previous process is waiting on a network response.

  • Ask the lock owner to confirm completion when possible.
  • Preserve a state backup before any recovery action.
  • Use the backend's documented force-unlock procedure only after verifying the lock is stale.
  • Run a plan afterward and review every proposed change before applying.

Document the interruption and improve runner cancellation or locking visibility if the issue recurs. Informatix Systems lists infrastructure automation and observability services. Contact Informatix Systems to review IaC state operations.