-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache Not Matching: One or more cache(s) with similar key but they have different version or scope #1376
Comments
When running:
Result:
There seems to be some issue with the getCacheVersion function. From what I can tell, it seems to be giving different results when creating and restoring cache. Creating getCacheVersion: 70108c5493886eef63e4ea83249a420f4e651fe696225cdb3e6597dca83b6a5d |
@rplankenhorn I think 'paths' need to match for a cache to be restored from a saved cache. The version is based on 'paths'. Quick look thru your code showed one is |
@MSP-Greg Thanks for getting back to me and good catch. I made the changes here but the cache is still not matching. I completely deleted all the cache, recreated them, and then ran the job a third time to try and restore them: https://github.com/rplankenhorn/github-actions-cache-issue/actions/runs/4480149929/jobs/7875080489
As you can see, still getting the same error. Here is the link to the full job: https://github.com/rplankenhorn/github-actions-cache-issue/actions/runs/4480149929/jobs/7875080489 |
Can you try changing: const cacheId = restoreCache(cachedPaths, primaryKey); to const cacheId = restoreCache(cachedPaths.slice(), primaryKey); |
Edit: Actually, this might have more to do with Git and ASDF but will continue to investigate.
Interesting. Now the cache is matching but I am getting a different error when trying to restore:
|
@MSP-Greg I was able to resolve the above error and now cache is restoring properly. So passing in a shallow copy of the array rather than the array itself is what fixed the issue? Should the restore/save functions be updated to automatically handle this for the user? |
Yes. It should be an array of strings, so I think
See PR #1378 |
Duplicate of #1377 |
Describe the bug
When using the
@actions/cache
package, I am unable to restore caches created using the exact same running on subsequent runs.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Cache should be matched and restored.
Screenshots
![Screenshot 2023-03-17 at 3 52 19 PM](https://user-images.githubusercontent.com/228338/226016014-64af4b84-fc8f-4175-b548-abc1b323b217.png)
Additional context
Note: Caching works as expected when using the published
@action/save
and@action/restore
.The text was updated successfully, but these errors were encountered: