# Self-Healing CI: Auto-Retrying a PyPI 429 Rate Limit

> A pip install that fails with HTTP 429 from files.pythonhosted.org hit a shared-egress rate limit, not a bad package. See the manual fix and how self-healing CI backs off and retries.

Source: https://latchkey.dev/learn/self-healing-ci/self-healing-pypi-rate-limit-429  
Updated: 2026-09-02

A pip install that dies on "HTTP error 429 while getting" was rate limited by PyPI, not served a broken package: the same requirement installs cleanly once the window resets.

## 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

### Does a PyPI 429 mean my requirements file is wrong?

No. A 429 is a rate limit on the request, not a verdict on the package. A missing or misnamed package returns 404, and a version that cannot be satisfied fails resolution with a different message.

---

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
