cacheport

Error · GitHub Actions

GitHub Actions "Cache not found for input keys": what it means

actions/cache looked for an entry matching your key and restore-keys and found none. It is a message, not a failure: the job continues with an empty cache and saves a new entry at the end if the job succeeds.

What you see

build log
Cache not found for input keys: Linux-node-3f2a9c..., Linux-node-

Common causes

  • The lockfile changed, so the key changed, which is expected.
  • The entry was evicted because the repository went over its cache storage limit or the entry was not used for a while.
  • The job runs on a branch that cannot read caches from other branches except the default branch.
  • A key built from a file path that does not exist, so hashFiles returns an empty string.

How to fix it

  1. 01

    Add restore-keys

    A prefix match restores the newest similar cache when the exact key misses.

    .github/workflows/ci.yml
    - uses: actions/cache@v4
      with:
        path: ~/.npm
        key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
        restore-keys: |
          ${{ runner.os }}-npm-
  2. 02

    Check the key inputs

    Print the hash to make sure the file pattern matches something.

    .github/workflows/ci.yml
    - run: echo "${{ hashFiles('**/package-lock.json') }}"
  3. 03

    Make misses cheap

    When the cache misses, dependencies are downloaded. A registry cache in your region turns that into a fast, local download.

    .npmrc
    registry=https://acme.cacheport.cc/npm/

Other network failures in builds

Start on the free plan

20 GB of cache, every registry, unlimited users. Upgrade when your pipelines outgrow it.