terraform
init
ai_generated
true
Error: Backend initialization required, please run 'terraform init'
ID: terraform/backend-initialization-required
98%Fix Rate
98%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 115 | active | — | — | — |
Root Cause
Terraform backend configuration changed but terraform init wasn't run to apply the change.
genericWorkarounds
-
97% success Run terraform init to initialize the new backend
Terraform will prompt to migrate state if the backend changed
Sources: https://developer.hashicorp.com/terraform/cli/commands/init
-
93% success Use terraform init -migrate-state to move state between backends
Safely copies state from old backend to new backend during init
Dead Ends
Common approaches that don't work:
-
Manually editing .terraform directory files
85% fail
May corrupt the local state cache
-
Copying state files between backends manually
75% fail
Easy to lose state or corrupt it; use terraform init -migrate-state instead
Error Chain
Frequently confused with: