Replace this template with your information
Failed Terraform apply left remote state file at https://gitlab.com/api/v4/projects/20733912/terraform/state/primary_hub and am unable to lock.
Error message on subsequent terraform plan:
Error: Error locking state: Error acquiring the state lock: HTTP remote state already locked: ID=450e834d-dc84-2a87-9bbd-751c127b10aa
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.
Am able to retrieve contents of state file using following command:
curl --header “private-token: [redacted]” https://gitlab.com/api/v4/projects/20733912/terraform/state/primary_hub
But following command fails with 404 error:
curl --request UNLOCK --header “PRIVATE-TOKEN: [redacted]” https://gitlab.com/api/v4/projects/20733912/terraform/state/primary_hub
Have also tried running terraform force-unlock -force 53fddacc-f27c-d6eb-2d45-7fa9302bd154 and removing .terraform directory.
Code I’m using is based on https://gitlab.com/nicholasklick/terraform-example/-/tree/master and was all working OK until the file became locked.
As there is no GUI currently for viewing or unlocking the state file need assistance please.