DVC "dvc repro ... failed" pipeline stage in CI
dvc repro ran a pipeline stage and its command exited non-zero, so DVC reports the stage failed to reproduce. DVC did its job; the underlying command (a script or tool) is what failed.
What this error means
dvc repro stops with "ERROR: failed to reproduce 'stage-name'" after the stage command's own error output.
dvc
ERROR: failed to reproduce 'train':
failed to run: python src/train.py, exited with 1Common causes
The stage command itself errored
The script the stage runs (training, preprocessing) raised, so DVC surfaces its non-zero exit as a reproduce failure.
A dependency was missing at stage time
The stage needed input data or a package that was not pulled or installed, so its command failed.
How to fix it
Read and fix the stage command output
- Scroll to the stage command output above the DVC error.
- Fix the underlying failure (a bug, a missing input, a bad path).
- Re-run
dvc reprofor that stage.
Terminal
dvc repro trainEnsure inputs and deps are present first
Pull tracked inputs and install packages before repro so stages have what they need.
Terminal
pip install -r requirements.txt
dvc pull
dvc reproHow to prevent it
- Pull data and install deps before
dvc reproin CI. - Declare all stage dependencies in
dvc.yamlso DVC pulls them. - Run stages locally with
dvc reprobefore pushing.
Related guides
DVC "dvc.lock ... does not match" in CIFix DVC "dvc.lock does not match" / stages out of date in CI - the committed dvc.lock is stale relative to dv…
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,…
DVC "experiment ... failed" (dvc exp) in CIFix DVC "ERROR: Failed to reproduce experiment" (dvc exp run) in CI - an experiment run failed, usually becau…