Skip to content
Latchkey

DVC "dvc.lock ... does not match" in CI

DVC compared the committed dvc.lock against dvc.yaml and the current data and found them inconsistent. In a locked or check step, DVC refuses to proceed on a stale lockfile instead of silently rerunning.

What this error means

dvc status shows stages "changed" / out of date, or a dvc repro --pull / dvc status -c step reports that dvc.lock does not match the pipeline.

dvc
train:
    changed deps:
        modified:           src/train.py
ERROR: dvc.lock does not match the pipeline. Run 'dvc repro' to update it.

Common causes

dvc.yaml changed without relocking

A stage command or dependency was edited but dvc.lock was not regenerated, so the two disagree.

dvc.lock was not committed

A local dvc repro updated dvc.lock, but it was never committed, so CI checks an outdated lockfile.

How to fix it

Reproduce and commit the lockfile

  1. Run dvc repro to bring dvc.lock in line with dvc.yaml.
  2. Commit the updated dvc.lock.
  3. Re-run CI so the locked check passes.
Terminal
dvc repro
git add dvc.lock
git commit -m "Update dvc.lock"

Gate lock consistency in CI

Fail fast when the lock drifts so the fix lands with the pipeline change.

.github/workflows/ci.yml
- run: dvc status --cloud

How to prevent it

  • Run dvc repro and commit dvc.lock after any dvc.yaml change.
  • Add a dvc status check to CI to catch drift.
  • Treat dvc.lock like a lockfile: always committed with the change.

Related guides

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