BM: Baca dalam Bahasa Melayu
World T3: State & Teams
Locking: one builder at a time
You will learn: why the register gets a busy sign, and what to do when it is stuck.
Checked with OpenTofu 1.13 on 1 Nov 2026
The problem
Aina’s tofu apply is halfway done. Ben starts his own apply on the same register. What should happen to Ben’s run?
Pick one answer.
Watch
A state lock: A busy sign on the register. While one run writes, another run stops with a lock error. is a “busy” sign on the register. Ben’s plan stopped at once. Nothing changed.
Try it
Who is building right now? Tap that line.
Tap the line that names who holds the lock.
0 of 1 found
Hint
Look for the word Who.Try it
Ben’s run hit a lock. Put his next steps in order.
First step at the top. Put these in order. Use the arrows, or drag.
- Only if their run died: force-unlock with the ID
- Wait for their run to finish, then try again
- Ask that person, or check the pipeline
- Read Who and Created in the error
Predict
Ben is in a hurry. Can he just add -lock=false?
Pick one answer.
Try it
Aina’s laptop crashed mid-apply. Her lock stayed behind. Build the careful fix.
Tap the pieces in the right order.
Hint
Three pieces: the tool, the command, then the ID.Check
Swipe: good teamwork, or needs work?
Swipe right for good, left for needs work. Or use the buttons.
Waited for Aina's apply to finish, then planned again
You did it!
You can now read a lock error and free a stuck lock safely.
Go deeper (optional)
Most shared backends lock: s3 with use_lockfile = true, gcs, azurerm, pg. Terraform’s docs call DynamoDB locking for s3 deprecated; OpenTofu keeps both. The local backend uses the computer’s own file lock. That is how this real error happened: two runs on one machine.
Real rep (optional): two terminals, one folder, one register.
Real mission
tofu init && tofu apply -auto-approvetofu applytofu plan
0 of 4 steps done · Your ticks are saved.
Bahasa Melayu
tofu apply Aina sudah separuh jalan. Ben mulakan apply sendiri pada daftar yang sama. Apa patut jadi pada larian Ben?
State lock (kunci state) ialah tanda “sibuk” pada daftar. Plan Ben terus berhenti. Tiada apa berubah.
Siapa sedang membina sekarang? Tekan baris itu.
Larian Ben terkena kunci. Susun langkah seterusnya.
Ben tergesa-gesa. Bolehkah dia tambah -lock=false sahaja?
Laptop Aina rosak semasa apply. Kuncinya tertinggal. Bina pembetulan yang berhati-hati.
Leret: kerja berpasukan yang bagus, atau perlu dibaiki?
Kini anda boleh baca ralat kunci dan bebaskan kunci tersekat dengan selamat.
You finished this before. Practice is always welcome!
Official docs: OpenTofu: state locking · tofu force-unlock · tofu plan (-lock, -lock-timeout) · OpenTofu: s3 backend locking
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?