Skip to content
Latchkey

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.

github-actions
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

  1. Include matrix/OS dimensions in the cache key so parallel legs do not collide.
  2. If a shared key is intended, let the race resolve naturally; the data is still restored from the winning save.
  3. Use restore-keys so jobs that skip saving still get a usable cache.
.github/workflows/ci.yml
- 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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →