GitLab CI Cache Not Restored - "Successfully extracted cache" Missing
A job that should reuse a cache instead rebuilds from scratch. GitLab either found no cache for the key, was told only to push it, or ran on a runner that cannot see the cache.
What this error means
Logs show "Checking cache for <key>... no cache" (instead of "Successfully extracted cache"), and dependency steps reinstall everything every run, making jobs slow.
Checking cache for node-default-protected...
WARNING: file does not exist
Failed to extract cacheCommon causes
Cache key changes every run
A key built from a volatile value (commit SHA, timestamp) never matches a prior run, so every job is a cache miss.
Pull policy or key/paths mismatch
A job set to policy: push writes but never restores; or the producing and consuming jobs use different key/paths, so nothing lines up.
Runners do not share cache storage
Local runner caches are per-host. Across multiple runners without a shared/distributed cache (S3), one runner cannot read another’s cache.
How to fix it
Use a stable key tied to the lockfile
cache:
key:
files:
- package-lock.json
paths:
- node_modules/
policy: pull-pushShare cache across runners
- Configure a distributed cache (S3/GCS) in the runner
config.toml. - Ensure producing and consuming jobs use identical
keyandpaths. - Use
pull-pushon jobs that should both read and update the cache.
How to prevent it
- Key caches on lockfiles, never on SHAs or timestamps.
- Use a distributed cache when more than one runner is involved.
- Keep
key/pathsconsistent between producer and consumer jobs.