GitHub Actions "Failed to save cache: reserveCache ... Cache already exists"
GitHub Actions cache entries are immutable; when two jobs try to save the same key concurrently, the second reserveCache call loses the race and reports the key already exists.
What this error means
A save step warns "Failed to save cache: reserveCache failed: Cache already exists. Scope: ..., Key: ...". The cache for that key still exists from the winning job.
github-actions
Failed to save cache: reserveCache failed: Cache already exists. Scope: refs/heads/main, Key: Linux-node-3f2a1b, Version: ...Common causes
Concurrent jobs saving the same key
Parallel matrix legs or jobs computed the same key and raced to save; only the first reservation wins.
Key is too coarse
A key that does not vary per matrix dimension collides across legs that all try to save it.
How to fix it
Make keys unique or accept the race
- Add matrix dimensions (os, version, arch) to the key so legs do not collide.
- Treat the warning as benign when one save winning is acceptable.
- Centralize cache saving in a single job that others restore from.
.github/workflows/ci.yml
key: ${{ runner.os }}-${{ matrix.node }}-node-${{ hashFiles('**/package-lock.json') }}How to prevent it
- Include per-leg dimensions in cache keys.
- Save shared caches from one job, restore in the rest.
- Recognize the warning as harmless when expected.
Related guides
GitHub Actions "Cache not found for input keys"Understand GitHub Actions "Cache not found for input keys" from actions/cache - no entry matched the primary…
GitHub Actions cache key collision / immutable cache not updatingFix a GitHub Actions cache that never reflects new content because the key is reused and cache entries are im…
GitHub Actions cache key changes every run (never hits)Fix a GitHub Actions cache that never hits because the key includes a value that changes on every run, such a…