cicd caching ai_generated true

Warning: cache not found for input keys: node-modules-v1-abc123

ID: cicd/cache-key-not-found

Also available as: JSON · Markdown
87%Fix Rate
89%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

GitHub Actions cache lookup did not find a matching cache entry for the specified key. This results in slower builds as dependencies must be re-downloaded. Caused by cache key mismatches, cache eviction, or first-time runs on a branch.

generic

Workarounds

  1. 88% success Use restore-keys as fallback for partial cache matches
    In the actions/cache step, add restore-keys with progressively less specific prefixes. Example: key: node-v1-${{ hashFiles('**/package-lock.json') }}, restore-keys: node-v1-. This allows falling back to an older cache.
  2. 90% success Verify the cache key includes the correct hash files
    Ensure hashFiles() points to the correct lockfile (package-lock.json, yarn.lock, pnpm-lock.yaml). Verify the file exists and is committed. Check that the hash path glob matches your monorepo structure.

Dead Ends

Common approaches that don't work:

  1. Using a static cache key without any hash component 70% fail

    A static key means the cache is never invalidated when dependencies change, leading to stale caches and build inconsistencies

  2. Caching the entire node_modules directory without a lockfile hash 65% fail

    Without a lockfile hash in the key, the cache serves outdated dependencies even after package.json changes, causing runtime errors

Error Chain

Leads to:
Preceded by:
Frequently confused with: