Terraform: Error: Error acquiring the state lock: ResourceNotFoundException: Requested resource not found / failed to retrieve lock info
The S3 backend's dynamodb_table doesn't exist, so locking fails.
Error acquiring the state lock: ResourceNotFoundException: Requested resource not foundError: Error acquiring the state lock ResourceNotFoundExceptionfailed to retrieve lock info: ResourceNotFoundExceptionError: Error releasing the state lock: ResourceNotFoundExceptionDynamoDB table does not exist state lock Meaning
Create the table with partition key LockID (String) in the same region as the backend, billing mode PAY_PER_REQUEST, or remove dynamodb_table if you don't use locking (newer Terraform supports use_lockfile = true for S3-native locking). Check table name/region/profile.
Common causes
- Table never created
- Wrong table name/region
- Table deleted
- Different AWS account/profile
- Using DynamoDB-based locking after migrating to S3 native locks
⚡ Quick fix
- Create table:
aws dynamodb create-table --table-name tf-lock --attribute-definitions AttributeName=LockID,AttributeType=S --key-schema AttributeName=LockID,KeyType=HASH --billing-mode PAY_PER_REQUEST - Fix
dynamodb_table/region - Use
use_lockfile = trueon recent Terraform
Detailed fix by platform
AWS
aws dynamodb describe-table --table-name tf-lock --region eu-west-1
How to diagnose
- Table — Exists?
- Key — LockID?
- Region — Same?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Backend configuration changed (migrate or reconfigure) Terraform: Error: Backend configuration changed — A change in the backend configuration has been detected, which may require migrating existing state
- Backend initialization required Terraform: Error: Backend initialization required, please run "terraform init" — Reason: Initial configuration of the requested backend "s3"
- Error acquiring the state lock Terraform: Error: Error acquiring the state lock — ConditionalCheckFailedException / state blob is already locked
Most viewed in Terraform
- Inconsistent dependency lock file Terraform: Error: Inconsistent dependency lock file — provider x: required by this configuration but no version is selected
- Reference to undeclared resource Terraform: Error: Reference to undeclared resource / Reference to undeclared input variable
- Resource is tainted and must be replaced Terraform: # aws_instance.web is tainted, so must be replaced — -/+ destroy and then create replacement
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026