diff --git a/state/remote/state.go b/state/remote/state.go index 8e157101d..575e4d187 100644 --- a/state/remote/state.go +++ b/state/remote/state.go @@ -2,7 +2,7 @@ package remote import ( "bytes" - "fmt" + "log" "sync" "github.com/hashicorp/terraform/state" @@ -35,7 +35,10 @@ func (s *State) WriteState(state *terraform.State) error { defer s.mu.Unlock() if s.readState != nil && !state.SameLineage(s.readState) { - return fmt.Errorf("incompatible state lineage; given %s but want %s", state.Lineage, s.readState.Lineage) + // This can't error here, because we need to be able to overwrite the + // state in some cases, like `state push -force` or `workspace new + // -state=` + log.Printf("[WARN] incompatible state lineage; given %s but want %s", state.Lineage, s.readState.Lineage) } // We create a deep copy of the state here, because the caller also has