Skip to content

Commit

Permalink
backend/remote: Fix broken state lock retry
Browse files Browse the repository at this point in the history
When using the -lock-timeout option with the remote backend configured
in local operations mode, Terraform would fail to retry acquiring the
lock. This was caused by the lock error message having a missing Info
field, which the state manager requires to be present in order to
attempt retries.
  • Loading branch information
alisdair committed Feb 19, 2021
1 parent 6871d0c commit 02eb283
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions backend/remote/backend_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (r *remoteClient) Lock(info *statemgr.LockInfo) (string, error) {
})
if err != nil {
if err == tfe.ErrWorkspaceLocked {
lockErr.Info = info
err = fmt.Errorf("%s (lock ID: \"%s/%s\")", err, r.organization, r.workspace.Name)
}
lockErr.Err = err
Expand Down

0 comments on commit 02eb283

Please sign in to comment.