A pipeline cancelled during an apply leaves the lock held, and every subsequent run fails with a lock ID and a timestamp.
Error: Error acquiring the state lock
ID: 6f0a8c2e-...
Operation: OperationTypeApply
Who: runner@fv-az412
Created: 2023-08-05 09:41:02 UTC
the checklist before force-unlock:
1 is the run actually dead? check the CI run, not the age
2 did the apply partially complete? read the log
3 take a state backup, by hand, now
4 then force-unlock, with the ID from the error
Step two is the one people skip: a cancelled apply may have created resources that are not in the state, and force-unlocking then running again produces a second set. The cancellation handling in the pipeline is the real fix — a trap that runs force-unlock on the run’s own lock ID during cleanup, so the lock never outlives the process that took it.