mirror of https://github.com/hashicorp/terraform
* fix: handle all StateMgr errors during backend migration Fixes a nil pointer dereference panic that occurs during backend migration when StateMgr returns an error other than ErrDefaultWorkspaceNotSupported. The bug occurred because the code only checked for the specific ErrDefaultWorkspaceNotSupported error. When any other error occurred (such as permission errors like storage.objects.get access denied), destinationState remained nil, but the code continued and attempted to call destinationState.RefreshState(), causing a panic. This fix adds an else clause to catch and return all other errors from StateMgr, preventing the nil pointer dereference and providing users with a clear error message instead of a crash. Fixes #24100 * Add changelog entry for backend migration nil pointer fix 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Mark Hall <mark.hall993@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>pull/38081/head
parent
1d06b6d1ac
commit
4aefefee4b
@ -0,0 +1,5 @@
|
||||
kind: BUG FIXES
|
||||
body: 'backend: Fix nil pointer dereference crash during `terraform init` when the destination backend returns an error'
|
||||
time: 2025-12-23T18:45:16.000000Z
|
||||
custom:
|
||||
Issue: "38027"
|
||||
Loading…
Reference in new issue