How to fix Error: force-unlock requires at least one argument: the lock id in Terraform

TerraformBEGINNERMEDIUMUpdated Dec 30, 2025· 123 views

The Terraform force-unlock command was executed without specifying a lock ID. This command requires a unique lock ID as an argument to safely unlock your state file.

Quick fix

Fixes Error: force-unlock requires at least one argument: the lock id

Error acquiring the state lock: ConditionalCheckFailedException:
Lock ID: a1b2c3d4-5678-9101-1234-567890abcdef
  1. Locate the lock ID from the original lock error
  2. Run terraform force-unlock with the lock ID
  3. Confirm the unlock operation
  4. Verify the lock has been released
terraform — error
Error acquiring the state lock: ConditionalCheckFailedException:
Lock ID: a1b2c3d4-5678-9101-1234-567890abcdef
Error: force-unlock requires at least one argument: the lock id

What this error means

Terraform's force-unlock command is used to manually release state locks that have become stuck or orphaned. This error occurs when you attempt to run `terraform force-unlock` without providing the required lock ID argument. The lock ID is a unique identifier that Terraform displays when a lock is held, and it's required to prevent accidental unlocking of the wrong state file. This safety mechanism ensures that only intentional force-unlocks occur and helps protect against data corruption or concurrent modifications to your infrastructure state.

Typical symptoms

  • Received 'Error: force-unlock requires at least one argument' when running terraform force-unlock
  • Terminal shows usage message for terraform force-unlock command
  • Unable to unlock a state that appears to be stuck or locked
  • Command fails immediately without attempting to unlock anything

Common causes

  1. Running terraform force-unlock without providing a lock ID argument
  2. Misunderstanding the command syntax and forgetting the required argument
  3. Copy-pasting an example that was incomplete or missing the lock ID
  4. Not knowing where to find the lock ID from the original lock error message

How to fix "Error: force-unlock requires at least one argument: the lock id"

1Locate the lock ID from the original lock error

When you encounter a Terraform state lock, the error message will display the lock information including the unique lock ID. Look for a message similar to:

bash
Error acquiring the state lock: ConditionalCheckFailedException:
Lock ID: a1b2c3d4-5678-9101-1234-567890abcdef

The lock ID is the unique identifier shown in the error output. If you've already cleared the screen, check the .tfstate.lock file in your state backend for the lock information.

2Run terraform force-unlock with the lock ID

Once you have the lock ID, run the force-unlock command with it as an argument:

bash
terraform force-unlock a1b2c3d4-5678-9101-1234-567890abcdef

Replace a1b2c3d4-5678-9101-1234-567890abcdef with your actual lock ID. Terraform will prompt you to confirm the unlock operation.

3Confirm the unlock operation

When prompted, confirm that you want to proceed with the force-unlock:

bash
Do you really want to unlock the state?
  [no] > yes

Type yes and press Enter. If you want to skip the confirmation prompt, you can add the -force flag:

bash
terraform force-unlock a1b2c3d4-5678-9101-1234-567890abcdef -force
4Verify the lock has been released

After the command completes successfully, verify that the state lock is cleared by attempting a regular Terraform operation:

bash
terraform plan

If the plan runs without lock errors, the force-unlock was successful. The state file is now accessible for new operations.

Advanced notes

Force-unlock should only be used as a last resort after confirming that no other Terraform operations are running. Using force-unlock while another process is modifying the state can cause state corruption or data loss. If you're using Terraform Cloud or Terraform Enterprise, the force-unlock CLI command is not available by design—instead, use the UI to unlock workspaces through the Settings > Locking menu. For remote backends like S3, DynamoDB, or Consul, ensure you have the correct IAM permissions or access credentials to interact with the lock storage mechanism. The lock ID is stored in your backend's lock tracking system and may persist there even after the unlock command succeeds, so don't rely on the lock file existing to verify the unlock.

Frequently asked questions

What does "Error: force-unlock requires at least one argument: the lock id" mean?
Terraform's force-unlock command is used to manually release state locks that have become stuck or orphaned. This error occurs when you attempt to run terraform force-unlock without providing the required lock ID argument. The lock ID is a unique identifier that Terraform displays when a lock is held, and it's required to prevent accidental unlocking of the wrong state file.
How do I fix "Error: force-unlock requires at least one argument: the lock id"?
The Terraform force-unlock command was executed without specifying a lock ID. This command requires a unique lock ID as an argument to safely unlock your state file.
What causes "Error: force-unlock requires at least one argument: the lock id"?
Running terraform force-unlock without providing a lock ID argument Misunderstanding the command syntax and forgetting the required argument Copy-pasting an example that was incomplete or missing the lock ID
Is the "Error: force-unlock requires at least one argument: the lock id" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading