Actions cache not restoring between runs even though key matches #203043
🏷️ Discussion TypeQuestion 💬 Feature/Topic AreaCode Search and Navigation BodyI've got a workflow using actions/cache to cache node_modules, and it worked fine for weeks. Now it just doesn't seem to be restoring anymore, every run says "Cache not found for input keys" even though I can see a cache with a matching key in the repo's Actions cache list. Nothing changed in the workflow file, same key format, same paths. Only thing that's different is we merged in a few PRs that touched the lockfile, so the key hash would've changed at some point, but it should just create a new cache entry, not break restoring on subsequent runs. For anyone who's run into this: Does the 10GB per-repo cache limit cause older caches to get silently evicted, and would that explain intermittent misses? Trying to figure out if this is an eviction issue or if my save step is quietly not working. |
Replies: 1 comment
|
Yeah, this lines up with a few known cache behaviors: Caches do get evicted once the repo hits the 10GB total limit, oldest unused ones first, so if you've got a bunch of caches piling up from different branches/PRs, older node_modules caches can get bumped even if your specific key still shows up in the list UI (that list can lag behind actual eviction). I'd start by grepping the logs for the cache action's save/restore lines directly rather than trusting the summary, that usually tells you immediately whether it's an eviction issue or a silent save failure. |
Yeah, this lines up with a few known cache behaviors:
Caches do get evicted once the repo hits the 10GB total limit, oldest unused ones first, so if you've got a bunch of caches piling up from different branches/PRs, older node_modules caches can get bumped even if your specific key still shows up in the list UI (that list can lag behind actual eviction).
Caches also expire after 7 days of no access, so if a branch went quiet for a while and nobody's builds hit that key, it's gone even though nothing look wrong on your end.
On the "did save actually work" question, check the raw logs for the cache step specifically, if there's a warning like "Cache save failed" or "Skipping cache due to k…