From 02eb283ad484c6ac135734f849b332dc7cef7f48 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Fri, 19 Feb 2021 15:47:18 -0500 Subject: [PATCH] backend/remote: Fix broken state lock retry 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. --- backend/remote/backend_state.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/remote/backend_state.go b/backend/remote/backend_state.go index 5bbba65e1..22b9563ec 100644 --- a/backend/remote/backend_state.go +++ b/backend/remote/backend_state.go @@ -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