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
- Run
dvc reproto bringdvc.lockin line withdvc.yaml. - Commit the updated
dvc.lock. - 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 --cloudHow to prevent it
- Run
dvc reproand commitdvc.lockafter anydvc.yamlchange. - Add a
dvc statuscheck to CI to catch drift. - Treat
dvc.locklike a lockfile: always committed with the change.
Related guides
DVC "dvc repro ... failed" pipeline stage in CIFix DVC "ERROR: failed to reproduce ... stage" in CI - a dvc repro pipeline stage command exited non-zero. Th…
DVC "md5 ... changed" WARNING in CIFix DVC "WARNING: md5 ... changed" in CI - a tracked file's hash no longer matches its .dvc record, so DVC se…
DVC "circular dependency" in the pipeline in CIFix DVC "ERROR: circular dependency" in CI - a stage output feeds back as a dependency of an upstream stage,…