- TFC/TFE workspace
- Configuration on local machine with remote backend or cloud integration initialized
- Configuration directory contains a non-empty
- Using Terraform v1.1.6 or earlier
terraform applywith Terraform v1.1.6 or earlier results in an error because the
terraform.tfstatefile is uploaded along with the configuration, causing a conflict with the workspace's backend.
Terraform v0.14.8 Initializing plugins and modules... Initializing the backend... Error: Error locking destination state: Error acquiring the state lock: resource not found 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. Operation failed: failed running terraform init (exit 1)
- Terraform v1.1.7 and later ignore the
terraform.tfstatefile when performing remote operations from a local machine. Upgrade to v1.1.7 or later.
- Delete the local
terraform.tfstatefile that is causing the conflict