Dhaval Shah
Dhaval Shah

Reputation: 143

Error acquiring the state lock: resource temporarily unavailable

when i am running terraform apply from my local i am getting this error . i have also checked that no process is going on in terraform but still getting this error.

Error: Error locking state: Error acquiring the state lock: resource temporarily unavailable
Lock Info:
ID:        9b3a1535-a936-fd2c-64e1-5fde7b227737
Path:      terraform.tfstate
Operation: OperationTypeApply
Who:       [email protected]
Version:   0.13.0
Created:   2021-05-21 20:54:48.108408 +0000 UTC
Info: 

 

Upvotes: 1

Views: 4684

Answers (2)

rk92
rk92

Reputation: 593

Two things to check.

Are you reaching out to a storage bucket that holds your state, if so are you passing in the correct bucket and prefix fields?

Did you previously run through an apply step with that same state and have to terminate the operation early? If so there may be a default.tflock in the same prefix folder as the default.tfstate file. You can manually go into your storage bucket and delete the .tflock file or follow these steps.

Upvotes: 1

Vinayak Singla
Vinayak Singla

Reputation: 142

Generally this happens if your host is out of cpu or memory. Check if any of them is at limit other thing could be if you have a lot of ssh connection that can also cause this.

Upvotes: 0

Related Questions