Skip to content
Latchkey

CocoaPods "CDN: trunk Repo update failed" in CI

CocoaPods could not reach the CDN that serves its spec index. The request timed out or returned a 5xx - a transient network failure on the CocoaPods CDN, not a problem with your Podfile.

What this error means

pod install prints "CDN: trunk Repo update failed" with a timeout or HTTP 5xx, often mid-fetch of the spec index. Re-running the job usually succeeds with no change - the hallmark of a transient network issue.

pod output
[!] CDN: trunk Repo update failed - 10 error(s):
CDN: trunk URL couldn't be downloaded:
https://cdn.cocoapods.org/all_pods_versions_a_b_c.txt
Response: Timeout was reached

Common causes

Transient CDN outage or slowness

The CocoaPods CDN briefly timed out or returned a 5xx. These blips clear on their own and are unrelated to your dependencies.

Restrictive network or low timeout on the runner

A proxy, DNS hiccup, or a short default timeout can make a slow-but-working CDN look failed on a congested runner.

How to fix it

Retry the install

Because this is transient, a simple retry usually clears it.

Terminal
for i in 1 2 3; do pod install && break || sleep 15; done

Pre-fetch / cache the spec repo

Cache CocoaPods state between runs so a flaky CDN matters less, and refresh once up front.

.github/workflows/ci.yml
- uses: actions/cache@v4
  with:
    path: ~/.cocoapods
    key: pods-${{ hashFiles('Podfile.lock') }}
- run: pod install --repo-update

How to prevent it

  • Cache ~/.cocoapods keyed on Podfile.lock.
  • Wrap pod install in a small retry loop for CDN flake.
  • Commit Podfile.lock so resolution is deterministic and cacheable.

Frequently asked questions

What causes ""CDN: trunk Repo update failed""?
The CocoaPods CDN briefly timed out or returned a 5xx. These blips clear on their own and are unrelated to your dependencies.
How do I fix "CDN: trunk Repo update failed"?
Because this is transient, a simple retry usually clears it.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card