Open
Description
Terraform Version
v0.15.0
Terraform Configuration Files
terraform {
backend "http" {
address = "https://tfstate.xxx/project"
lock_address = "https://tfstate.xxx/project"
unlock_address = "https://tfstate.xxx/project"
}
}
Debug Output
terraform force-unlock uuid-here
Do you really want to force-unlock?
Terraform will remove the lock on the remote state.
This will allow local Terraform commands to modify this state, even though it
may be still be in use. Only 'yes' will be accepted to confirm.
Enter a value: yes
Failed to unlock state: Unexpected HTTP response code 423
Expected Behaviour
Terraform unlocks the remote state with ID uuid-here
Actual Behaviour
Terraform sends an unlock request with an EMPTY body (ignoring the ID passed on the command line)
Additional Context
Looking at the implementation of the http Unlock call:
terraform/backend/remote-state/http/client.go
Line 116 in 6697245
The id
is never used and the existing lockInfo
data is sent, which works fine in the happy flow of things but when trying to force-unlock
from the command line it results in Terraform sending an unlock requests with an empty body leaving the remote http backend confused as to what to do.