Skip to content
Latchkey

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.

terragrunt
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

  1. Add a terragrunt init (or run-all init) step before plan.
  2. Keep --terragrunt-no-auto-init only if init runs separately.
  3. Re-run so the module is installed before plan.
.github/workflows/ci.yml
- run: terragrunt run-all init --terragrunt-non-interactive
- run: terragrunt run-all plan --terragrunt-no-auto-init

Leave auto-init enabled

Simply drop the no-auto-init flag so Terragrunt initializes before each command.

Terminal
terragrunt plan

How to prevent it

  • Only disable auto-init when a dedicated init step precedes plan/apply.
  • Persist or restore .terragrunt-cache if you rely on prior init.
  • Prefer run-all init once, then plan across the stack.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →