Skip to content
Latchkey

GitHub Actions "Unable to reserve cache ... another job may be creating it"

A cache save logs "Unable to reserve cache" because another concurrent job already reserved the same key. Only one job can create a given cache entry, so the others skip saving - usually harmless, but a sign your key is shared across parallel jobs.

What this error means

A matrix or parallel job warns that it could not reserve the cache key because another job is creating it, and that job's save is skipped. The cache still gets created by the winning job.

Actions log
Warning: Failed to save: Unable to reserve cache with key deps-abc123, another
job may be creating this cache. More than one cache cannot be created with the
same key in the same run.

Common causes

Concurrent jobs share an identical key

Parallel matrix legs computing the same cache key race to reserve it. Only the first wins; the rest get the reservation conflict and skip saving.

Same key across a fan-out

A key that does not include a per-job dimension (os, node version) collides whenever those jobs run at once.

How to fix it

Make keys unique per parallel job

Include the matrix dimensions in the cache key so concurrent legs do not contend for one entry.

.github/workflows/ci.yml
- uses: actions/cache@v4
  with:
    path: ~/.npm
    key: deps-${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}

Treat the warning as benign when keys must match

  1. If sharing one key is intentional, the warning is harmless - one job still creates the cache.
  2. Use restore-keys so all jobs can read the single shared entry once created.
  3. Avoid relying on every job saving; one successful save is enough.

How to prevent it

  • Include matrix dimensions in cache keys to avoid concurrent-key collisions.
  • Use restore-keys so jobs share a single created cache.
  • Treat the reserve conflict as benign when the key is deliberately shared.

Frequently asked questions

What causes ""Unable to reserve cache""?
Parallel matrix legs computing the same cache key race to reserve it. Only the first wins; the rest get the reservation conflict and skip saving.
How do I fix "Unable to reserve cache"?
Include the matrix dimensions in the cache key so concurrent legs do not contend for one entry.
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