Skip to content
Latchkey

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 1

Common 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

  1. Scroll to the stage command output above the DVC error.
  2. Fix the underlying failure (a bug, a missing input, a bad path).
  3. Re-run dvc repro for that stage.
Terminal
dvc repro train

Ensure 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 repro

How to prevent it

  • Pull data and install deps before dvc repro in CI.
  • Declare all stage dependencies in dvc.yaml so DVC pulls them.
  • Run stages locally with dvc repro before pushing.

Related guides

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