Error: state snapshot was created by a newer version
Resolves OpenTofu's 'state snapshot was created by ... which is newer than current' by upgrading the binary to at least the version that wrote the state. Use when a teammate or CI applied with a newer tofu or terraform than you have installed. Never hand-edit the version marker.
TL;DR: The state was last written by a newer tofu (or terraform) than the one you're running. Upgrade your binary to at least that version. Never hand-edit the version marker in the state file to force it to load.
Error: state snapshot was created by OpenTofu v1.12.0, which is newer than current v1.10.0(The same error appears with Terraform version stamps when migrating between the two tools.)
Steps
- Read both versions from the error: the writer (
v1.12.0) and your current (v1.10.0).
Expected: you know the minimum version you need.
- Install a binary at least as new as the writer:
tofuenv install 1.12.6 && tofuenv use 1.12.6(or tenv, or your OS package).
Expected: tofu version shows >= the writer version.
- Re-run your command.
Expected: the state loads; the error is gone.
When this applies
- The error names two versions and yours is older.
- A teammate or CI applied with a newer release than you have installed.
- During Terraform-to-OpenTofu migration, when the state was last written by a Terraform newer than your tofu.
When it doesn't apply
Error: Unsupported OpenTofu Core versionis about your CONFIG'srequired_version, not the state's writer version.- Corrupt or truncated state files fail with parse errors, not version errors.
Tool versions
All OpenTofu versions. State format v4 is shared across recent Terraform and OpenTofu, so the check keys on the version stamp, not the tool name.
Why it happens
State records the exact version that last wrote it. A newer writer may have used state features the older reader doesn't understand, so the older tool refuses rather than risk misreading your infrastructure.
Edge cases
- Never hand-edit
versionorterraform_versionin the state to force a load. You risk corrupting resource decoding and losing the state you were trying to save. - Teams should pin one tofu version (
.opentofu-versionfile, CI matrix,required_version) so nobody leapfrogs the rest. - During migration, treat the cutover as one-way: add a CI guard so nobody keeps running
terraform applyagainst tofu-managed state and stamps the marker back.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.