Skip to content

Commit

Permalink
handle force-unlock error better (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgroschupp authored Nov 17, 2024
1 parent 094d996 commit d8c14e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ func UnLockState(metadata *types.RequestMetadata, storageClient types.StorageCli
if !force {
var lock types.LockInfo
if err := json.Unmarshal(body, &lock); err != nil {
if err == io.EOF {
var syntaxError *json.SyntaxError
if err == io.EOF || errors.As(err, &syntaxError) {
log.Println(`WARNING: force-unlock is currently broken.
Reason: https://github.com/hashicorp/terraform/blob/master/backend/remote-state/http/client.go is broken.
See issue https://github.com/hashicorp/terraform/issues/28421.
Unlock function in HTTP TF backend does not using lockID.
Our backend would never know the ID to unlock when force-unlock was used.
` + storageClient.ForceUnLockWorkaroundMessage(metadata.Params))
Expand Down

0 comments on commit d8c14e7

Please sign in to comment.