Terragrunt auto-init "This module is not yet installed" in CI
Terragrunt normally runs init automatically before plan or apply. If auto-init is disabled (--terragrunt-no-auto-init) and you did not init first, Terraform aborts because providers and modules are not installed.
What this error means
A plan step fails with "Error: Module not installed" / "Run terraform init" or "Backend initialization required", because auto-init was turned off and no explicit init ran.
Error: Module not installed
This module is not yet installed. Run "terraform init" to install all modules
required by this configuration.
ERRO[0001] terragrunt: --terragrunt-no-auto-init is set and the module was not initialized.Common causes
Auto-init was disabled without a preceding init
The workflow passes --terragrunt-no-auto-init (often for speed) but never ran an explicit terragrunt init, so plan hits an uninitialized module.
The .terragrunt-cache was not persisted
A cache-based init from a previous job was not restored, so the module directory is empty when plan runs with auto-init off.
How to fix it
Run init explicitly when auto-init is off
- Add a
terragrunt init(orrun-all init) step before plan. - Keep
--terragrunt-no-auto-initonly if init runs separately. - Re-run so the module is installed before plan.
- run: terragrunt run-all init --terragrunt-non-interactive
- run: terragrunt run-all plan --terragrunt-no-auto-initLeave auto-init enabled
Simply drop the no-auto-init flag so Terragrunt initializes before each command.
terragrunt planHow to prevent it
- Only disable auto-init when a dedicated init step precedes plan/apply.
- Persist or restore
.terragrunt-cacheif you rely on prior init. - Prefer
run-all initonce, then plan across the stack.