Error: Failed to decode current backend config
Fixes Terragrunt's 'Error: Failed to decode current backend config' by clearing the stale .terragrunt-cache. Use when terragrunt init fails decoding a backend config after an upgrade, and the fix is deleting the cache dir. Not for genuine backend config errors.
TL;DR: The .terragrunt-cache holds a backend record written by an older version that the current binary can't decode. The error suggests -reconfigure, but the real fix is deleting the stale .terragrunt-cache so init starts clean.
Error: Failed to decode current backend config
The backend configuration created by the most recent run of "terraform init"
could not be decoded: unsupported attribute "lock_table". The configuration
may have been initialized by an earlier version that used an incompatible
configuration structure. Run "terraform init -reconfigure" to force
re-initialization of the backend.Steps
- Delete the unit's cache:
rm -rf .terragrunt-cache(from the unit directory).
Expected: the stale backend record is gone.
- Re-run
terragrunt init.
Expected: Initializing the backend... completes without the decode error.
- If MANY units are affected (e.g. after a version bump across the repo):
find . -type d -name ".terragrunt-cache" -prune -exec rm -rf {} +.
Expected: all units re-init clean.
When this applies
Failed to decode current backend config/unsupported attributeright after upgrading the tofu/terraform version or the backend schema.- The config itself didn't change; only the tool version did.
When it doesn't apply
- You actually CHANGED the backend config (bucket, key, region): then
-reconfigurevs-migrate-stateis the real decision, not cache clearing. Backend initialization required: that's a missing init, not a stale one.
Tool versions
All Terragrunt versions (cache layout unchanged across 1.x).
Why it happens
Terragrunt copies the module into .terragrunt-cache and init records the backend config there. After a version upgrade, the cached record uses a schema the new binary can't decode, and init fails before it ever re-reads your current config.
Edge cases
- There is no
terragrunt clear-cachecommand (removed in the 1.0 redesign); deleting the directory yourself IS the supported operation. - Set
TG_DOWNLOAD_DIRto move the cache outside the working tree if stale caches keep biting in CI.
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.