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.
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.
dvc repro trainEnsure inputs and deps are present first
Pull tracked inputs and install packages before repro so stages have what they need.
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.