GitHub Actions cache "another job is already creating this cache"
Cache keys are reserved atomically. When two jobs with the identical key race to save, one wins the reservation and the others report the cache is already being created. The losing jobs simply do not save; it is mostly benign and transient.
What this error means
Parallel matrix or fan-out jobs sharing one cache key log that another job is already creating the cache, and one save is skipped.
Warning: Failed to save: Unable to reserve cache with key node-modules-<hash>,
another job may be creating this cache.Common causes
Multiple jobs share one cache key
Parallel jobs compute the same key and race the reservation; only the first succeeds.
No key differentiation across matrix legs
The key does not include matrix dimensions, so every leg collides.
How to fix it
Differentiate keys or accept the race
- Include matrix/OS dimensions in the cache key so parallel legs do not collide.
- If a shared key is intended, let the race resolve naturally; the data is still restored from the winning save.
- Use restore-keys so jobs that skip saving still get a usable cache.
- uses: actions/cache@v4
with:
path: node_modules
key: node-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
node-${{ runner.os }}-How to prevent it
- Add matrix dimensions to cache keys to avoid avoidable collisions.
- On Latchkey managed runners, transient cache-reservation races are retried automatically so a benign create-race does not surface as a failure.