# Self-Healing CI: Clearing a Corrupted Dependency Cache and Retrying

> A corrupted or partial dependency cache fails the build until cleared. See the manual fix and how self-healing CI evicts it and retries automatically.

Source: https://latchkey.dev/learn/self-healing-ci/self-heal-dependency-cache-corrupt  
Updated: 2026-06-25

When a build breaks on a corrupted cache, the cache is the problem, not your code - clearing it and rebuilding from a clean state fixes it every time.

## What makes a failure safely retryable

Automatic retry is only correct for failures that are genuinely transient. Retrying a deterministic failure wastes minutes and hides a real defect, so the classification matters more than the retry mechanism.

- Safe to retry: network timeouts, registry 5xx, transient DNS failures, a service container that was not ready, a spot instance reclaimed mid-run.
- Not safe to retry: assertion failures, compile errors, lint violations, anything that fails identically on every attempt.
- Ambiguous, and worth investigating rather than retrying: out-of-memory kills, disk exhaustion, and flaky tests. These repeat under load and a retry only hides the trend.
- Always record that a retry happened. A pipeline that silently retries is a pipeline whose real failure rate you do not know.

## FAQ

### What causes Self-Healing CI: clearing a corrupted dependency cache and retrying?

A build fails with a checksum mismatch, an unexpected-EOF on an archive, or a "cache entry is corrupt" error. The dependencies are fine; a cache entry was written partially or got corrupted. A human clears the cache and re-runs, and the build passes unchanged.

### How do I fix Self-Healing CI: clearing a corrupted dependency cache and retrying manually?

[object Object]

### Can Self-Healing CI: clearing a corrupted dependency cache and retrying be fixed automatically?

A corrupt-cache failure has a recognizable integrity-error signature, and the remedy is deterministic: discard the bad entry and rebuild from source. A self-healing CI pipeline detects the corruption, evicts the affected cache, retries the step so the cache is rebuilt cleanly, and only escalates if the failure recurs against a fresh

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
