C3W2 Data Engineering - Terraform plan error - 2nd attempt at lab

Hello, I attempted this lab but only made it to section 4 before having to quit due to time. I came back today to try to pick up where I left off and I’m getting the following error with Terraform Plan:

│ Error: Error acquiring the state lock

│ Error message: resource temporarily unavailable
│ Lock Info:
│ ID: 88871473-06e3-4f23-539f-42ccc5276991
│ Path: /home/coder/.local/share/code-server/User/de-c3w2a1-026665917197-us-east-1-terraform-state.state
│ Operation: OperationTypePlan
│ Who: coder@b52f9d52d3ba
│ Version: 1.10.3
│ Created: 2025-10-29 12:36:38.193381155 +0000 UTC
│ Info:


│ Terraform acquires a state lock to protect the state from being written
│ by multiple users at the same time. Please resolve the issue above and try
│ again. For most commands, you can disable locking with the “-lock=false”
│ flag, but this is not recommended.

Update, I figured it out but will leave up as reference to others. The terraform was still running.

In terminal:

See if any terraform process is still running:
ps -ef | grep -i terraform | grep -v grep

I got this response:

coder 590 337 0 12:36 pts/2 00:00:02 terraform plan

you will use the coder ID in next step (PID = 590 in my case):

Kill the stuck process (replace [PID] with the real PID from first message):

kill -9 [PID]

Then rerun terraform process

1 Like