CircleCI "Restoring cache: no cache found"
A restore_cache step found nothing to restore, so dependencies reinstall from scratch. The key changed, no listed key matched a saved cache, or save and restore keys differ.
What this error means
Logs show "Skipping cache - no cache found" instead of restoring, and the install step runs full every time. The job still passes but is slow and wastes minutes.
Restoring cache
Found a cache from build ... at v1-deps-
Skipping cache - no cache found for key v1-deps-{{ checksum "package-lock.json" }}Common causes
Key changes every run
A key built from a volatile value (a timestamp, the build number) never matches a prior save, so every restore misses.
save_cache and restore_cache keys differ
If the key template used to save does not match the one used (or its fallback prefixes) to restore, nothing lines up.
No fallback (partial) key
Without a broader fallback prefix, a checksum change (any lockfile edit) is a hard miss instead of a partial restore.
How to fix it
Use matching keys with a fallback prefix
- restore_cache:
keys:
- v1-deps-{{ checksum "package-lock.json" }}
- v1-deps-
- run: npm ci
- save_cache:
key: v1-deps-{{ checksum "package-lock.json" }}
paths:
- node_modulesAlign save and restore
- Use an identical primary key template in
save_cacheandrestore_cache. - Add a broader fallback prefix in
restore_cache.keysfor partial hits. - Avoid volatile values (build number, timestamp) in cache keys.
How to prevent it
- Key caches on lockfile checksums, never on volatile values.
- Always include a fallback prefix for partial restores.
- Keep save and restore key templates identical.