You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cache restore on versions 3 and 4 not working #1361
Failed to save: Unable to reserve cache with key db09ccc890352b660ddd94bbcf7ce4b880b254099c5050c6059b00b0b4c5777e, another job may be creating this cache. More details: Cache already exists.
Not sure if its related but even deleting all caches it wont recreate them...
Reacted by Bill Cawthra, Robert Marciniak, Zachary Hamm, Reinier Ruiz Ramos and Ajeet D'Souza
Same issue here. Have been wracking my brain why this doesn't work and then wanted to eventually open an issue and found out there's one already.
Trying v2 now as recommended above.
@mark-jordanovic-lewis just to ensure, do you have exactly same value in the "path" parameter both in save and restore? I had different and restore failed too.
We are seeing similar issues on v4 where the cache is not found despite clearly existing, only 1/5 runs are picked up correctly, is the cache action not reliable-ish?
I encountered the same issue. Save v4 + restore v2 cannot work as well. Using save v2 + restore v2 can resolve the problem. However, it seems that Node.js 16 is going to be deprecated.
I encountered the same issue. Save v4 + restore v2 cannot work as well. Using save v2 + restore v2 can resolve the problem. However, it seems that Node.js 16 is going to be deprecated.
I just found the reason: in v4, the path for restore and save must be the same. The error message doesn't give such information.
Reacted by Mark JL (_jail) and Rehan van der Merwe
I encountered the same issue. Save v4 + restore v2 cannot work as well. Using save v2 + restore v2 can resolve the problem. However, it seems that Node.js 16 is going to be deprecated.
I just realized I had a trailing slash in one of the places and not the others. Now I made sure all the path strings are exactly the same and it seems to work without issues.
Just want to highlight that we're also having problems with v3 and v4.
Our build (at a high level) does this:
(1) Download dependencies (using Composer as it's a PHP app, but I don't think that detail is important) and cache them using actions/cache/save@v4
(2a) Build frontend assets (after restoring Composer dependencies with actions/cache/restore@v4)
(2b) Run static analysis (after restoring Composer dependencies with actions/cache/restore@v4)
(3) Run tests
Steps (2a) and (2b) need step (1) and run concurrently after step (1) is finished. The call to actions/cache/restore@v4 works in step 2b and fails in step 2a.
After reverting to v2 this works as expected.
Our workflow file looks something like the following:
The cache backend service has been rewritten from the ground up for improved performance and reliability. actions/cache now integrates with the new cache service (v2) APIs.
The new service will gradually roll out as of February 1st, 2025. The legacy service will also be sunset on the same date. Changes in these release are fully backward compatible.
We are deprecating some versions of this action. We recommend upgrading to version v4 or v3 as soon as possible before February 1st, 2025. (Upgrade instructions below).
If you are using pinned SHAs, please use the SHAs of versions v4.2.0 or v3.4.0
If you do not upgrade, all workflow runs using any of the deprecated actions/cache will fail.
Upgrading to the recommended versions will not break your workflows.
Read more about the change & access the migration guide: #1510.
Is GitHub really going to sit on this and let it break for everyone without trying to clarify it?
Just want to highlight that we're also having problems with v3 and v4.
Our build (at a high level) does this:
(1) Download dependencies (using Composer as it's a PHP app, but I don't think that detail is important) and cache them using actions/cache/save@v4 (2a) Build frontend assets (after restoring Composer dependencies with actions/cache/restore@v4) (2b) Run static analysis (after restoring Composer dependencies with actions/cache/restore@v4) (3) Run tests
Steps (2a) and (2b) need step (1) and run concurrently after step (1) is finished. The call to actions/cache/restore@v4 works in step 2b and fails in step 2a.
After reverting to v2 this works as expected.
Not sure if it helps anyone else, but just wanted to highlight that we were able to fix the issue by:
using relative path values, e.g: path: ./vendor.
using exactly the same base image in all steps. When using different base images the cache is doesn't appear to be shared. This is not ideal for our use-case but is a workable solution 🤷♂️
Activity
mark-jordanovic-lewis commentedon Mar 20, 2024
Cause of the above issue is a difference in the actions/checkout version. There must be a difference in the way they reference the branch.matthiasPOE commentedon Mar 20, 2024
Im currently getting:
Failed to save: Unable to reserve cache with key db09ccc890352b660ddd94bbcf7ce4b880b254099c5050c6059b00b0b4c5777e, another job may be creating this cache. More details: Cache already exists.Not sure if its related but even deleting all caches it wont recreate them...
serpro69 commentedon Mar 22, 2024
Same issue here. Have been wracking my brain why this doesn't work and then wanted to eventually open an issue and found out there's one already.
Trying v2 now as recommended above.
upd: v2 works as expected
yrtimiD commentedon Apr 7, 2024
@mark-jordanovic-lewis just to ensure, do you have exactly same value in the "path" parameter both in save and restore? I had different and restore failed too.
mark-jordanovic-lewis commentedon Apr 7, 2024
Correct. Same parameters in each use of the action.
fix(build,ci): downgrade to cache action v2
fix(build,ci): downgrade to cache action v2
SimonSchick commentedon May 2, 2024
We are seeing similar issues on v4 where the cache is not found despite clearly existing, only 1/5 runs are picked up correctly, is the cache action not reliable-ish?
njzjz commentedon May 14, 2024
I encountered the same issue. Save v4 + restore v2 cannot work as well. Using save v2 + restore v2 can resolve the problem. However, it seems that Node.js 16 is going to be deprecated.
njzjz commentedon May 24, 2024
I just found the reason: in v4, the
pathforrestoreandsavemust be the same. The error message doesn't give such information.wmertens commentedon May 26, 2024
@njzjz I'm encountering this problem too and the paths are the same for me
lsdm83114 commentedon May 26, 2024
MostefaKamalLala commentedon Jun 5, 2024
Facing the same issue, any fix anytime soon?
restore v2 does not exist. it's only cache v2
10 remaining items
wmertens commentedon Jul 18, 2024
I just realized I had a trailing slash in one of the places and not the others. Now I made sure all the path strings are exactly the same and it seems to work without issues.
mdeweerd commentedon Aug 21, 2024
I confirm that caching works after:
path:value with./;path:value for save and restore (I had wildcards in the save action path).Qual: Fix caching for windows workflow (#30705)
Qual: Fix caching for windows workflow (#30705) (#30728)
Prefix cache path with `./`
Prefix cache paths with `./`
Call `Pkg.resolve()` before hashing Manifest (#519)
coreymcmahon commentedon Nov 17, 2024
Just want to highlight that we're also having problems with v3 and v4.
Our build (at a high level) does this:
(1) Download dependencies (using Composer as it's a PHP app, but I don't think that detail is important) and cache them using
actions/cache/save@v4(2a) Build frontend assets (after restoring Composer dependencies with
actions/cache/restore@v4)(2b) Run static analysis (after restoring Composer dependencies with
actions/cache/restore@v4)(3) Run tests
Steps (2a) and (2b)
needstep (1) and run concurrently after step (1) is finished. The call toactions/cache/restore@v4works in step 2b and fails in step 2a.After reverting to v2 this works as expected.
Our workflow file looks something like the following:
JJ-Kamminga commentedon Dec 3, 2024
Had a similar issue as many in this thread.
Can confirm that it works with an absolute path, inputted identically as
pathin therestoreandsaveactions (v4).Would not be an issue IMO if the documentation was clearer on this.
hammzj commentedon Jan 22, 2025
So cache@v2 is going to be deprecated soon which makes this all the more difficult as there will be a required upgrade to v3/v4 now: https://github.com/actions/cache?tab=readme-ov-file#whats-new
Is GitHub really going to sit on this and let it break for everyone without trying to clarify it?
coreymcmahon commentedon Jan 24, 2025
Not sure if it helps anyone else, but just wanted to highlight that we were able to fix the issue by:
pathvalues, e.g:path: ./vendor.Godspeed and good luck!
aryairani commentedon Feb 11, 2025
The base image (assuming this means the
runs-on:name) seems to be newly case sensitive in the new backend. I couldn't find this documented anywhere.[ci] fix macOS testing
[ci] fix macOS testing
[ci] fix macOS testing