Loading...
Loading...
### Terraform Version ```shell Terraform v1.3.8 on linux_amd64 ``` ### Terraform Configuration Files ```terraform terraform { backend "s3" { bucket = "" key = "bug/unexpected-end-of-json-input/terraform.tfstate" encrypt = true kms_key_id = "" dynamodb_table = "" } } ``` ### Debug Output https://gist.github.com/petur/b66b6c7fce877ddb1bf3cc7629101de0 ### Expected Behavior When terraform is run with `-lock-timeout`, it should either acquire the lock, or retry until the timeout expires. ### Actual Behavior Terraform fails with the error: ``` ╷ │ Error: Error acquiring the state lock │ │ Error message: 2 errors occurred: │ * ConditionalCheckFailedException: The conditional request failed │ * unexpected end of JSON input │ │ │ │ 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. ╵ ``` ### Steps to Reproduce 1. `terraform init` 2. Duplicate the folder containing the configuration 3. Run `while TF_LOG=trace terraform plan -lock-timeout=60s; do : ; done` in both folders (needs two shells). (This is an artificial way to reproduce the issue. It was found in CI where multiple people push changes and plans get run in parallel.) ### Additional Context _No response_ ### References _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.