unknown command: "clear-cache"
Fixes Terragrunt's 'unknown command: clear-cache' by deleting .terragrunt-cache manually. Use when following old advice to clear the cache on 1.0+. There is no replacement command; the cache is scratch space you delete yourself.
TL;DR: terragrunt clear-cache doesn't exist anymore (removed in the 1.0 CLI redesign). A corrupt .terragrunt-cache is fixed by deleting the directory yourself; Terragrunt recreates it as needed.
unknown command: "clear-cache". Terragrunt no longer forwards unknown commands by default.Steps
- Find the caches:
find . -type d -name ".terragrunt-cache".
Expected: you see how many there are (run --all leaves one per unit).
- Delete them:
find . -type d -name ".terragrunt-cache" -prune -exec rm -rf {} +.
Expected: the directories are gone.
- Re-run your command (e.g.
terragrunt run -- init).
Expected: modules re-download fresh; checksum/zip errors from the corrupt cache are gone.
When this applies
unknown command: "clear-cache"on Terragrunt 1.0+.- Module load failures that smell like a corrupt cache: checksum mismatches,
failed to open zip archive, stale module code after a source change.
When it doesn't apply
- Below 1.1.3 with PARALLEL runs and checksum errors: upgrade first. Before 1.1.3, concurrent runs staged provider downloads at the same path and the first to finish could delete an archive the other was unpacking; clearing the cache doesn't fix a race.
- A moved tag serving new content under an old ref: re-pin to a commit SHA instead.
Tool versions
Terragrunt 1.0+ (command removed in the redesign).
Why it happens
Pre-1.0 Terragrunt forwarded unknown commands to terraform, so clear-cache felt like a built-in. The 1.x CLI no longer forwards, and the cache was deliberately left as plain scratch space on disk with no command wrapper.
Edge cases
- For stale module code after changing
sourceor bumpingref, preferterragrunt run --source-update -- initover wiping the cache; it refetches in place. - Set
TG_DOWNLOAD_DIRto relocate the cache outside the working tree if scattered.terragrunt-cachedirs annoy you.
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.