Resolve "Inconsistent Dependency Lock File" Error in Terraform
Encountering the Inconsistent Dependency Lock File error in Terraform? This guide explains the causes and provides step-by-step solutions to resolve the.
Terraform
Complete guide to Terraform logging. Set TF_LOG to TRACE, DEBUG, INFO, WARN, or ERROR. Save verbose output to a file with TF_LOG_PATH. Works on Linux, macOS.
Set TF_LOG=DEBUG (or TRACE for maximum detail) and TF_LOG_PATH=terraform.log as environment variables before running any Terraform command. Logs include API calls, provider operations, and internal state changes.
| Level | What You Get | When to Use |
|---|---|---|
TRACE | Everything — API payloads, internal state, provider debug | Deep debugging, filing bug reports |
DEBUG | API calls, provider operations, detailed errors | Most debugging scenarios |
INFO | High-level operation info | General monitoring |
WARN | Potential issues, deprecations | Catching problems early |
ERROR | Only errors | Production CI/CD logs |
export TF_LOG="DEBUG"
export TF_LOG_PATH="terraform-debug.log"
terraform plan$env:TF_LOG = "DEBUG"
$env:TF_LOG_PATH = "terraform-debug.log"
terraform planTF_LOG=DEBUG terraform plan 2>&1 | tee terraform-debug.log# Log only the core (skip provider noise)
export TF_LOG_CORE=DEBUG
export TF_LOG_PROVIDER=ERROR
# Or log only the provider (skip core)
export TF_LOG_CORE=ERROR
export TF_LOG_PROVIDER=DEBUG
export TF_LOG_PATH="terraform-debug.log"
terraform applyThis is useful when you know the issue is in the provider (API call failing) vs. Terraform core (state or HCL parsing).
2026-04-21T10:30:15.123Z [DEBUG] provider.terraform-provider-aws:
HTTP Request Sent: method=POST url=https://ec2.us-east-1.amazonaws.com
2026-04-21T10:30:15.456Z [DEBUG] provider.terraform-provider-aws:
HTTP Response Received: status=200
2026-04-21T10:30:15.789Z [DEBUG] dag/walk: vertex "aws_instance.web" is waiting| Pattern | Meaning |
|---|---|
HTTP Request Sent | API call being made |
HTTP Response Received: status=4xx | Authentication or permission error |
HTTP Response Received: status=5xx | AWS/Azure/GCP service error |
waiting on dependency | Resource blocked by another |
plugin crashed | Provider binary error |
When Terraform crashes, it writes a crash log automatically:
# Find crash logs
ls crash.log
ls crash-*.log
# These contain stack traces — attach to bug reports# GitLab CI example
plan:
script:
- export TF_LOG=WARN
- export TF_LOG_PATH=terraform.log
- terraform plan -out=plan.tfplan
artifacts:
paths:
- terraform.log
when: on_failure# GitHub Actions
- name: Terraform Plan
env:
TF_LOG: WARN
TF_LOG_PATH: terraform.log
run: terraform plan# Add to ~/.bashrc or ~/.bash_profile
export TF_LOG="DEBUG"
export TF_LOG_PATH="$HOME/terraform-debug.log"# Add to $PROFILE
$env:TF_LOG = "DEBUG"
$env:TF_LOG_PATH = "$HOME\terraform-debug.log"unset TF_LOG
unset TF_LOG_PATH
unset TF_LOG_CORE
unset TF_LOG_PROVIDER*.log to .gitignorewhen: on_failure to only keep logs on errorsTF_LOG=DEBUG with TF_LOG_PATH is your first move when debugging any Terraform issue. Use TF_LOG_CORE and TF_LOG_PROVIDER to isolate problems. In CI/CD, log at WARN level and save artifacts only on failure. Always check for secrets before sharing logs.
Encountering the Inconsistent Dependency Lock File error in Terraform? This guide explains the causes and provides step-by-step solutions to resolve the.
Install and run Terraform on Ubuntu 26.04 LTS Resolute Raccoon. Covers sudo-rs as default, APT 3.2 rollback, Kernel 7.0, Wayland-only, ROCm, and building...
Learn the purpose and benefits of Terraform modules and how they enhance reusability, organization, and scalability in managing infrastructure as code.
Complete Terraform commands reference. Learn terraform init, plan, apply, destroy, state, import, output, workspace, fmt, validate