DVC "Failed to collect ... missing cache" in CI
DVC read the tracking metadata and expected cache objects that are not present locally. On a fresh CI checkout the cache is empty until you pull, so it reports missing cache files.
What this error means
A dvc command fails with "Failed to collect" and lists files "missing cache" or "not in cache", typically right after checkout before any dvc pull ran.
dvc
ERROR: Failed to collect 'data/train.csv': missing cache files:
name: data/train.csv, md5: 3a1b...Common causes
No dvc pull on the fresh checkout
CI cloned the repo with only the tiny .dvc pointers; the real data lives on the remote and was never pulled into the cache.
A partial or interrupted pull
An earlier dvc pull failed midway, leaving some objects absent from the cache while metadata still references them.
How to fix it
Pull data before using it
- Add a
dvc pullstep after checkout and before any stage or test that reads the data. - Confirm the remote and credentials are set so the pull can complete.
- Re-run the job.
.github/workflows/ci.yml
- run: dvc pullForce a clean re-fetch
If a prior pull was partial, fetch the missing objects explicitly.
Terminal
dvc fetch
dvc checkoutHow to prevent it
- Always
dvc pullafter checkout before reading tracked data. - Cache the
.dvc/cachebetween runs so pulls are incremental. - Fail the job early if the pull step reports missing objects.
Related guides
DVC "Checkout failed ... data ... not in cache" in CIFix DVC "ERROR: Checkout failed for ... data ... not in cache" in CI - dvc checkout cannot materialize worksp…
DVC "unable to find DVC remote" in CIFix DVC "ERROR: unable to find DVC remote" in CI - dvc pull/push has no default remote configured, or the nam…
DVC "failed to pull data from the cloud" (remote auth) in CIFix DVC "ERROR: failed to pull data from the cloud" in CI - the remote is reachable but the runner has no val…