Terraform
Jan 18, 2026 4 min read

Fix Terraform Provider Version Mismatch

Lock-file drift after a CI upgrade — how to align providers across environments.

Problem

bash
Error: Inconsistent dependency lock file

Root cause

Your local Terraform installed a newer provider than what `.terraform.lock.hcl` records, or a teammate updated it on a different OS/arch.

Solution

Re-lock for the platforms you use

bash
terraform providers lock -platform=linux_amd64 -platform=darwin_arm64 -platform=linux_arm64

Commit the updated lockfile

bash
git add .terraform.lock.hcl && git commit -m 'tf: relock providers'

Frequently asked questions

Related fixes

Weekly digest

One DevOps fix in your inbox each week

Short, practical, no fluff. Real errors, real fixes — straight from production postmortems.