Skip to content
Latchkey

GitHub Actions "Cache not found for input keys"

actions/cache could not find an entry matching the primary key or any restore-keys prefix, so it reports a miss and the dependent step rebuilds from scratch.

What this error means

The cache step logs "Cache not found for input keys: <key>" and cache-hit is false, so installs or builds run without the cached data.

github-actions
Cache not found for input keys: Linux-node-3f2a1b, Linux-node-

Common causes

First run or key never saved

No prior run saved an entry under that key, so there is nothing to restore (a normal cold cache).

Key changed since the last save

A hash input (lockfile, runner.os) changed the primary key and no restore-keys prefix covers the older entries.

How to fix it

Add fallback restore-keys

  1. Keep a precise primary key tied to the lockfile hash.
  2. Add broader restore-keys prefixes for partial hits.
  3. Confirm the save step runs on the branch that should seed the cache.
.github/workflows/ci.yml
- uses: actions/cache@v4
  with:
    path: ~/.npm
    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
    restore-keys: |
      ${{ runner.os }}-node-

How to prevent it

  • Always pair a precise key with broader restore-keys.
  • Seed the cache on the default branch.
  • Keep key inputs stable run-to-run.

Frequently asked questions

What causes ""Cache not found""?
No prior run saved an entry under that key, so there is nothing to restore (a normal cold cache).
How do I fix "Cache not found"?
Add fallback restore-keys

Related guides

References

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